|
|
|
@ -12,21 +12,21 @@ namespace ImageSharp.Tests |
|
|
|
|
|
|
|
public class WhiteIsZeroTiffColorTests : PhotometricInterpretationTestBase |
|
|
|
{ |
|
|
|
private static Color Gray000 = new Color(255, 255, 255, 255); |
|
|
|
private static Color Gray128 = new Color(127, 127, 127, 255); |
|
|
|
private static Color Gray255 = new Color(0, 0, 0, 255); |
|
|
|
private static Color Gray0 = new Color(255, 255, 255, 255); |
|
|
|
private static Color Gray8 = new Color(119, 119, 119, 255); |
|
|
|
private static Color GrayF = new Color(0, 0, 0, 255); |
|
|
|
private static Color Bit0 = new Color(255, 255, 255, 255); |
|
|
|
private static Color Bit1 = new Color(0, 0, 0, 255); |
|
|
|
private static Rgba32 Gray000 = new Rgba32(255, 255, 255, 255); |
|
|
|
private static Rgba32 Gray128 = new Rgba32(127, 127, 127, 255); |
|
|
|
private static Rgba32 Gray255 = new Rgba32(0, 0, 0, 255); |
|
|
|
private static Rgba32 Gray0 = new Rgba32(255, 255, 255, 255); |
|
|
|
private static Rgba32 Gray8 = new Rgba32(119, 119, 119, 255); |
|
|
|
private static Rgba32 GrayF = new Rgba32(0, 0, 0, 255); |
|
|
|
private static Rgba32 Bit0 = new Rgba32(255, 255, 255, 255); |
|
|
|
private static Rgba32 Bit1 = new Rgba32(0, 0, 0, 255); |
|
|
|
|
|
|
|
private static byte[] Bilevel_Bytes4x4 = new byte[] { 0b01010000, |
|
|
|
0b11110000, |
|
|
|
0b01110000, |
|
|
|
0b10010000 }; |
|
|
|
|
|
|
|
private static Color[][] Bilevel_Result4x4 = new[] { new[] { Bit0, Bit1, Bit0, Bit1 }, |
|
|
|
private static Rgba32[][] Bilevel_Result4x4 = new[] { new[] { Bit0, Bit1, Bit0, Bit1 }, |
|
|
|
new[] { Bit1, Bit1, Bit1, Bit1 }, |
|
|
|
new[] { Bit0, Bit1, Bit1, Bit1 }, |
|
|
|
new[] { Bit1, Bit0, Bit0, Bit1 }}; |
|
|
|
@ -36,7 +36,7 @@ namespace ImageSharp.Tests |
|
|
|
0b01101001, 0b10100000, |
|
|
|
0b10010000, 0b01100000}; |
|
|
|
|
|
|
|
private static Color[][] Bilevel_Result12x4 = new[] { new[] { Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1 }, |
|
|
|
private static Rgba32[][] Bilevel_Result12x4 = new[] { new[] { Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1, Bit0, Bit1 }, |
|
|
|
new[] { Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1, Bit1 }, |
|
|
|
new[] { Bit0, Bit1, Bit1, Bit0, Bit1, Bit0, Bit0, Bit1, Bit1, Bit0, Bit1, Bit0 }, |
|
|
|
new[] { Bit1, Bit0, Bit0, Bit1, Bit0, Bit0, Bit0, Bit0, Bit0, Bit1, Bit1, Bit0 }}; |
|
|
|
@ -46,7 +46,7 @@ namespace ImageSharp.Tests |
|
|
|
0x08, 0x8F, |
|
|
|
0xF0, 0xF8 }; |
|
|
|
|
|
|
|
private static Color[][] Grayscale4_Result4x4 = new[] { new[] { Gray8, GrayF, Gray0, GrayF }, |
|
|
|
private static Rgba32[][] Grayscale4_Result4x4 = new[] { new[] { Gray8, GrayF, Gray0, GrayF }, |
|
|
|
new[] { GrayF, GrayF, GrayF, GrayF }, |
|
|
|
new[] { Gray0, Gray8, Gray8, GrayF }, |
|
|
|
new[] { GrayF, Gray0, GrayF, Gray8 }}; |
|
|
|
@ -56,7 +56,7 @@ namespace ImageSharp.Tests |
|
|
|
0x08, 0x80, |
|
|
|
0xF0, 0xF0 }; |
|
|
|
|
|
|
|
private static Color[][] Grayscale4_Result3x4 = new[] { new[] { Gray8, GrayF, Gray0 }, |
|
|
|
private static Rgba32[][] Grayscale4_Result3x4 = new[] { new[] { Gray8, GrayF, Gray0 }, |
|
|
|
new[] { GrayF, GrayF, GrayF }, |
|
|
|
new[] { Gray0, Gray8, Gray8 }, |
|
|
|
new[] { GrayF, Gray0, GrayF }}; |
|
|
|
@ -66,7 +66,7 @@ namespace ImageSharp.Tests |
|
|
|
000, 128, 128, 255, |
|
|
|
255, 000, 255, 128 }; |
|
|
|
|
|
|
|
private static Color[][] Grayscale8_Result4x4 = new[] { new[] { Gray128, Gray255, Gray000, Gray255 }, |
|
|
|
private static Rgba32[][] Grayscale8_Result4x4 = new[] { new[] { Gray128, Gray255, Gray000, Gray255 }, |
|
|
|
new[] { Gray255, Gray255, Gray255, Gray255 }, |
|
|
|
new[] { Gray000, Gray128, Gray128, Gray255 }, |
|
|
|
new[] { Gray255, Gray000, Gray255, Gray128 }}; |
|
|
|
@ -121,7 +121,7 @@ namespace ImageSharp.Tests |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[MemberData(nameof(Bilevel_Data))] |
|
|
|
public void Decode_WritesPixelData_Bilevel(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Color[][] expectedResult) |
|
|
|
public void Decode_WritesPixelData_Bilevel(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Rgba32[][] expectedResult) |
|
|
|
{ |
|
|
|
AssertDecode(expectedResult, pixels => |
|
|
|
{ |
|
|
|
@ -131,7 +131,7 @@ namespace ImageSharp.Tests |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[MemberData(nameof(Grayscale4_Data))] |
|
|
|
public void Decode_WritesPixelData_4Bit(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Color[][] expectedResult) |
|
|
|
public void Decode_WritesPixelData_4Bit(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Rgba32[][] expectedResult) |
|
|
|
{ |
|
|
|
AssertDecode(expectedResult, pixels => |
|
|
|
{ |
|
|
|
@ -141,7 +141,7 @@ namespace ImageSharp.Tests |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[MemberData(nameof(Grayscale8_Data))] |
|
|
|
public void Decode_WritesPixelData_8Bit(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Color[][] expectedResult) |
|
|
|
public void Decode_WritesPixelData_8Bit(byte[] inputData, int bitsPerSample, int left, int top, int width, int height, Rgba32[][] expectedResult) |
|
|
|
{ |
|
|
|
AssertDecode(expectedResult, pixels => |
|
|
|
{ |
|
|
|
|