|
|
|
@ -33,16 +33,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg |
|
|
|
/// </summary>
|
|
|
|
private readonly byte[] buffer = new byte[20]; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The default component id's.
|
|
|
|
/// </summary>
|
|
|
|
private static readonly byte[] DefaultComponentIds = { 1, 2, 3 }; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Component id's for RGB colorspace.
|
|
|
|
/// </summary>
|
|
|
|
private static readonly byte[] RgbComponentIds = { 82, 71, 66 }; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The quality, that will be used to encode the image.
|
|
|
|
/// </summary>
|
|
|
|
@ -191,15 +181,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg |
|
|
|
/// For color space RGB this will be RGB as ASCII, otherwise 1, 2, 3.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The component Ids.</returns>
|
|
|
|
private ReadOnlySpan<byte> GetComponentIds() |
|
|
|
{ |
|
|
|
if (this.colorType == JpegColorType.Rgb) |
|
|
|
{ |
|
|
|
return RgbComponentIds; |
|
|
|
} |
|
|
|
|
|
|
|
return DefaultComponentIds; |
|
|
|
} |
|
|
|
private ReadOnlySpan<byte> GetComponentIds() => this.colorType == JpegColorType.Rgb |
|
|
|
? new ReadOnlySpan<byte>(new byte[] { 82, 71, 66 }) |
|
|
|
: new ReadOnlySpan<byte>(new byte[] { 1, 2, 3 }); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Writes data to "Define Quantization Tables" block for QuantIndex.
|
|
|
|
|