Browse Source

A little sanitation

af/merge-core
James Jackson-South 10 years ago
parent
commit
8b8ea351a2
  1. 4
      src/ImageSharp.Formats.Bmp/BmpEncoderCore.cs
  2. 8
      src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs
  3. 1
      src/ImageSharp.Formats.Jpeg/JpegEncoderCore.cs
  4. 1
      src/ImageSharp/Image/ImageBase{TColor}.cs

4
src/ImageSharp.Formats.Bmp/BmpEncoderCore.cs

@ -131,11 +131,11 @@ namespace ImageSharp.Formats
switch (this.bmpBitsPerPixel) switch (this.bmpBitsPerPixel)
{ {
case BmpBitsPerPixel.Pixel32: case BmpBitsPerPixel.Pixel32:
this.Write32Bit<TColor>(writer, pixels); this.Write32Bit(writer, pixels);
break; break;
case BmpBitsPerPixel.Pixel24: case BmpBitsPerPixel.Pixel24:
this.Write24Bit<TColor>(writer, pixels); this.Write24Bit(writer, pixels);
break; break;
} }
} }

8
src/ImageSharp.Formats.Jpeg/JpegDecoderCore.cs

@ -5,10 +5,8 @@
namespace ImageSharp.Formats namespace ImageSharp.Formats
{ {
using System; using System;
using System.Buffers;
using System.IO; using System.IO;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using ImageSharp.Formats.Jpg; using ImageSharp.Formats.Jpg;
@ -586,7 +584,7 @@ namespace ImageSharp.Formats
byte yellow = this.ycbcrImage.CrChannel.Pixels[co + (x / scale)]; byte yellow = this.ycbcrImage.CrChannel.Pixels[co + (x / scale)];
TColor packed = default(TColor); TColor packed = default(TColor);
this.PackCmyk<TColor>(ref packed, cyan, magenta, yellow, x, y); this.PackCmyk(ref packed, cyan, magenta, yellow, x, y);
pixels[x, y] = packed; pixels[x, y] = packed;
} }
}); });
@ -744,7 +742,7 @@ namespace ImageSharp.Formats
byte cr = this.ycbcrImage.CrChannel.Pixels[co + (x / scale)]; byte cr = this.ycbcrImage.CrChannel.Pixels[co + (x / scale)];
TColor packed = default(TColor); TColor packed = default(TColor);
this.PackYcck<TColor>(ref packed, yy, cb, cr, x, y); this.PackYcck(ref packed, yy, cb, cr, x, y);
pixels[x, y] = packed; pixels[x, y] = packed;
} }
}); });
@ -1037,7 +1035,7 @@ namespace ImageSharp.Formats
} }
this.InputProcessor.ReadFull(this.Temp, 0, remaining); this.InputProcessor.ReadFull(this.Temp, 0, remaining);
this.RestartInterval = ((int)this.Temp[0] << 8) + (int)this.Temp[1]; this.RestartInterval = (this.Temp[0] << 8) + this.Temp[1];
} }
/// <summary> /// <summary>

1
src/ImageSharp.Formats.Jpeg/JpegEncoderCore.cs

@ -8,7 +8,6 @@ namespace ImageSharp.Formats
using System; using System;
using System.Buffers; using System.Buffers;
using System.IO; using System.IO;
using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using ImageSharp.Formats.Jpg; using ImageSharp.Formats.Jpg;

1
src/ImageSharp/Image/ImageBase{TColor}.cs

@ -6,7 +6,6 @@
namespace ImageSharp namespace ImageSharp
{ {
using System; using System;
using System.Buffers;
using System.Diagnostics; using System.Diagnostics;
/// <summary> /// <summary>

Loading…
Cancel
Save