Browse Source

Added initial support for the baseline interleaved stride conversion

pull/1694/head
Dmitry Pentin 5 years ago
parent
commit
3c59cd9c51
  1. 7
      src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs

7
src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs

@ -133,6 +133,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
else
{
this.ParseBaselineDataInterleaved();
// this is the only path where conversion is done right after the scan
this.spectralConverter.CommitConversion();
}
}
@ -160,6 +163,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
{
this.cancellationToken.ThrowIfCancellationRequested();
// decode from binary to spectral
for (int i = 0; i < mcusPerLine; i++)
{
// Scan an interleaved mcu... process components in order
@ -207,6 +211,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
mcu++;
this.HandleRestart();
}
// convert from spectral to actual pixels via given converter
this.spectralConverter.ConvertStride(j, j);
}
}

Loading…
Cancel
Save