|
|
|
@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation |
|
|
|
internal static class TiffColorDecoderFactory<TPixel> |
|
|
|
where TPixel : unmanaged, IPixel<TPixel> |
|
|
|
{ |
|
|
|
public static TiffBaseColorDecoder<TPixel> Create(TiffColorType colorType, TiffBitsPerSample bitsPerSample, ushort[] colorMap, ByteOrder byteOrder) |
|
|
|
public static TiffBaseColorDecoder<TPixel> Create(Configuration configuration, TiffColorType colorType, TiffBitsPerSample bitsPerSample, ushort[] colorMap, ByteOrder byteOrder) |
|
|
|
{ |
|
|
|
switch (colorType) |
|
|
|
{ |
|
|
|
@ -65,12 +65,12 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation |
|
|
|
case TiffColorType.BlackIsZero8: |
|
|
|
DebugGuard.IsTrue(bitsPerSample.Channels == 1 && bitsPerSample.Channel0 == 8, "bitsPerSample"); |
|
|
|
DebugGuard.IsTrue(colorMap == null, "colorMap"); |
|
|
|
return new BlackIsZero8TiffColor<TPixel>(); |
|
|
|
return new BlackIsZero8TiffColor<TPixel>(configuration); |
|
|
|
|
|
|
|
case TiffColorType.BlackIsZero16: |
|
|
|
DebugGuard.IsTrue(bitsPerSample.Channels == 1 && bitsPerSample.Channel0 == 16, "bitsPerSample"); |
|
|
|
DebugGuard.IsTrue(colorMap == null, "colorMap"); |
|
|
|
return new BlackIsZero16TiffColor<TPixel>(byteOrder == ByteOrder.BigEndian); |
|
|
|
return new BlackIsZero16TiffColor<TPixel>(configuration, byteOrder == ByteOrder.BigEndian); |
|
|
|
|
|
|
|
case TiffColorType.BlackIsZero24: |
|
|
|
DebugGuard.IsTrue(bitsPerSample.Channels == 1 && bitsPerSample.Channel0 == 24, "bitsPerSample"); |
|
|
|
@ -114,7 +114,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation |
|
|
|
&& bitsPerSample.Channel0 == 8, |
|
|
|
"bitsPerSample"); |
|
|
|
DebugGuard.IsTrue(colorMap == null, "colorMap"); |
|
|
|
return new Rgb888TiffColor<TPixel>(); |
|
|
|
return new Rgb888TiffColor<TPixel>(configuration); |
|
|
|
|
|
|
|
case TiffColorType.Rgb101010: |
|
|
|
DebugGuard.IsTrue( |
|
|
|
@ -154,7 +154,7 @@ namespace SixLabors.ImageSharp.Formats.Tiff.PhotometricInterpretation |
|
|
|
&& bitsPerSample.Channel0 == 16, |
|
|
|
"bitsPerSample"); |
|
|
|
DebugGuard.IsTrue(colorMap == null, "colorMap"); |
|
|
|
return new Rgb161616TiffColor<TPixel>(isBigEndian: byteOrder == ByteOrder.BigEndian); |
|
|
|
return new Rgb161616TiffColor<TPixel>(configuration, isBigEndian: byteOrder == ByteOrder.BigEndian); |
|
|
|
|
|
|
|
case TiffColorType.Rgb242424: |
|
|
|
DebugGuard.IsTrue( |
|
|
|
|