|
|
|
@ -57,7 +57,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder |
|
|
|
/// </summary>
|
|
|
|
/// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
|
|
|
|
/// <param name="decoder">The <see cref="OrigJpegDecoderCore"/> instance</param>
|
|
|
|
public void InitializeDerivedData(MemoryManager memoryManager, OrigJpegDecoderCore decoder) |
|
|
|
/// <param name="metadataOnly">Whether to decode metadata only. If this is true, memory allocation for SpectralBlocks will not be necessary</param>
|
|
|
|
public void InitializeDerivedData(MemoryManager memoryManager, OrigJpegDecoderCore decoder, bool metadataOnly) |
|
|
|
{ |
|
|
|
// For 4-component images (either CMYK or YCbCrK), we only support two
|
|
|
|
// hv vectors: [0x11 0x11 0x11 0x11] and [0x22 0x11 0x11 0x22].
|
|
|
|
@ -80,7 +81,10 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder |
|
|
|
this.SubSamplingDivisors = c0.SamplingFactors.DivideBy(this.SamplingFactors); |
|
|
|
} |
|
|
|
|
|
|
|
this.SpectralBlocks = memoryManager.Allocate2D<Block8x8>(this.SizeInBlocks.Width, this.SizeInBlocks.Height, true); |
|
|
|
if (!metadataOnly) |
|
|
|
{ |
|
|
|
this.SpectralBlocks = memoryManager.Allocate2D<Block8x8>(this.SizeInBlocks.Width, this.SizeInBlocks.Height, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|