Browse Source

Remove unnecessary cast.

af/merge-core
James Jackson-South 10 years ago
parent
commit
bb8b33f674
  1. 7
      src/ImageSharp/Formats/Jpg/JpegEncoderCore.cs

7
src/ImageSharp/Formats/Jpg/JpegEncoderCore.cs

@ -404,6 +404,7 @@ namespace ImageSharp.Formats
/// <param name="count">The number of bits</param> /// <param name="count">The number of bits</param>
private void Emit(uint bits, uint count) private void Emit(uint bits, uint count)
{ {
// TODO: This requires optimization. We have far too many writes to the underlying stream going on.
count += this.bitCount; count += this.bitCount;
bits <<= (int)(32 - count); bits <<= (int)(32 - count);
bits |= this.accumulatedBits; bits |= this.accumulatedBits;
@ -545,9 +546,9 @@ namespace ImageSharp.Formats
pixels[Math.Min(x + i, xmax), Math.Min(y + j, ymax)].ToBytes(b, 0, ComponentOrder.XYZ); pixels[Math.Min(x + i, xmax), Math.Min(y + j, ymax)].ToBytes(b, 0, ComponentOrder.XYZ);
YCbCr color = new Color(b[0], b[1], b[2]); YCbCr color = new Color(b[0], b[1], b[2]);
int index = (8 * j) + i; int index = (8 * j) + i;
yBlock[index] = (int)color.Y; yBlock[index] = color.Y;
cbBlock[index] = (int)color.Cb; cbBlock[index] = color.Cb;
crBlock[index] = (int)color.Cr; crBlock[index] = color.Cr;
} }
} }
} }

Loading…
Cancel
Save