|
|
@ -114,6 +114,17 @@ internal static class HorizontalPredictor |
|
|
UndoRgb48BitLittleEndianRow(pixelBytes, width, y); |
|
|
UndoRgb48BitLittleEndianRow(pixelBytes, width, y); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
case TiffColorType.Rgba16161616: |
|
|
|
|
|
if (isBigEndian) |
|
|
|
|
|
{ |
|
|
|
|
|
UndoRgb64BitBigEndianRow(pixelBytes, width, y); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
UndoRgb64BitLittleEndianRow(pixelBytes, width, y); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -504,15 +515,11 @@ internal static class HorizontalPredictor |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static void UndoRgba64Bit(Span<byte> pixelBytes, int width, bool isBigEndian) |
|
|
private static void UndoRgb64BitBigEndianRow(Span<byte> pixelBytes, int width, int y) |
|
|
{ |
|
|
{ |
|
|
int rowBytesCount = width * 8; |
|
|
int rowBytesCount = width * 8; |
|
|
int height = pixelBytes.Length / rowBytesCount; |
|
|
|
|
|
if (isBigEndian) |
|
|
|
|
|
{ |
|
|
|
|
|
for (int y = 0; y < height; y++) |
|
|
|
|
|
{ |
|
|
|
|
|
int offset = 0; |
|
|
int offset = 0; |
|
|
|
|
|
|
|
|
Span<byte> rowBytes = pixelBytes.Slice(y * rowBytesCount, rowBytesCount); |
|
|
Span<byte> rowBytes = pixelBytes.Slice(y * rowBytesCount, rowBytesCount); |
|
|
ushort r = TiffUtilities.ConvertToUShortBigEndian(rowBytes.Slice(offset, 2)); |
|
|
ushort r = TiffUtilities.ConvertToUShortBigEndian(rowBytes.Slice(offset, 2)); |
|
|
offset += 2; |
|
|
offset += 2; |
|
|
@ -550,12 +557,12 @@ internal static class HorizontalPredictor |
|
|
offset += 2; |
|
|
offset += 2; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
private static void UndoRgb64BitLittleEndianRow(Span<byte> pixelBytes, int width, int y) |
|
|
{ |
|
|
|
|
|
for (int y = 0; y < height; y++) |
|
|
|
|
|
{ |
|
|
{ |
|
|
|
|
|
int rowBytesCount = width * 8; |
|
|
int offset = 0; |
|
|
int offset = 0; |
|
|
|
|
|
|
|
|
Span<byte> rowBytes = pixelBytes.Slice(y * rowBytesCount, rowBytesCount); |
|
|
Span<byte> rowBytes = pixelBytes.Slice(y * rowBytesCount, rowBytesCount); |
|
|
ushort r = TiffUtilities.ConvertToUShortLittleEndian(rowBytes.Slice(offset, 2)); |
|
|
ushort r = TiffUtilities.ConvertToUShortLittleEndian(rowBytes.Slice(offset, 2)); |
|
|
offset += 2; |
|
|
offset += 2; |
|
|
@ -593,6 +600,24 @@ internal static class HorizontalPredictor |
|
|
offset += 2; |
|
|
offset += 2; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void UndoRgba64Bit(Span<byte> pixelBytes, int width, bool isBigEndian) |
|
|
|
|
|
{ |
|
|
|
|
|
int rowBytesCount = width * 8; |
|
|
|
|
|
int height = pixelBytes.Length / rowBytesCount; |
|
|
|
|
|
if (isBigEndian) |
|
|
|
|
|
{ |
|
|
|
|
|
for (int y = 0; y < height; y++) |
|
|
|
|
|
{ |
|
|
|
|
|
UndoRgb64BitBigEndianRow(pixelBytes, width, y); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
for (int y = 0; y < height; y++) |
|
|
|
|
|
{ |
|
|
|
|
|
UndoRgb64BitLittleEndianRow(pixelBytes, width, y); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|