Browse Source

Refactores post processor buffer clear

pull/1694/head
Dmitry Pentin 5 years ago
parent
commit
74a7e90cf5
  1. 16
      src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponentPostProcessor.cs

16
src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponentPostProcessor.cs

@ -108,19 +108,13 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
}
}
public void ClearSpectralStride(int step)
// TODO: refactor this
public void ClearSpectralBuffers()
{
int yBlockStart = step * this.BlockRowsPerStep;
for (int y = 0; y < this.BlockRowsPerStep; y++)
Buffer2D<Block8x8> spectralBlocks = this.Component.SpectralBlocks;
for (int i = 0; i < spectralBlocks.Height; i++)
{
int yBlock = yBlockStart + y;
if (yBlock >= this.SizeInBlocks.Height)
{
break;
}
this.Component.SpectralBlocks.GetRowSpan(yBlock).Clear();
spectralBlocks.GetRowSpan(i).Clear();
}
}

Loading…
Cancel
Save