mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-04 12:05:29 -04:00
TIFF: Add support for SAMPLEFORMAT_COMPLEXINT/SAMPLEFORMAT_COMPLEXIEEEFP
This commit is contained in:
parent
18f31f2dd4
commit
734b90863a
@ -71,6 +71,10 @@ interface TIFFExtension {
|
||||
int SAMPLEFORMAT_INT = 2;
|
||||
int SAMPLEFORMAT_FP = 3;
|
||||
int SAMPLEFORMAT_UNDEFINED = 4;
|
||||
/** Complex signed integer */
|
||||
int SAMPLEFORMAT_COMPLEXINT = 5;
|
||||
/** Complex IEEE floating point */
|
||||
int SAMPLEFORMAT_COMPLEXIEEEFP = 6;
|
||||
|
||||
int YCBCR_POSITIONING_CENTERED = 1;
|
||||
int YCBCR_POSITIONING_COSITED = 2;
|
||||
|
@ -809,6 +809,7 @@ public final class TIFFImageReader extends ImageReaderBase {
|
||||
case TIFFBaseline.SAMPLEFORMAT_UINT:
|
||||
return bitsPerSample <= 8 ? DataBuffer.TYPE_BYTE : bitsPerSample <= 16 ? DataBuffer.TYPE_USHORT : DataBuffer.TYPE_INT;
|
||||
case TIFFExtension.SAMPLEFORMAT_INT:
|
||||
case TIFFExtension.SAMPLEFORMAT_COMPLEXINT:
|
||||
switch (bitsPerSample) {
|
||||
case 8:
|
||||
return DataBuffer.TYPE_BYTE;
|
||||
@ -818,9 +819,10 @@ public final class TIFFImageReader extends ImageReaderBase {
|
||||
return DataBuffer.TYPE_INT;
|
||||
}
|
||||
|
||||
throw new IIOException("Unsupported BitsPerSample for SampleFormat 2/Signed Integer (expected 8/16/32): " + bitsPerSample);
|
||||
throw new IIOException("Unsupported BitsPerSample for SampleFormat 2/Signed Integer, 5/Complex Integer (expected 8/16/32): " + bitsPerSample);
|
||||
|
||||
case TIFFExtension.SAMPLEFORMAT_FP:
|
||||
case TIFFExtension.SAMPLEFORMAT_COMPLEXIEEEFP:
|
||||
if (bitsPerSample == 16 || bitsPerSample == 32) {
|
||||
return DataBuffer.TYPE_FLOAT;
|
||||
}
|
||||
@ -828,9 +830,9 @@ public final class TIFFImageReader extends ImageReaderBase {
|
||||
return DataBuffer.TYPE_DOUBLE;
|
||||
}
|
||||
|
||||
throw new IIOException("Unsupported BitsPerSample for SampleFormat 3/Floating Point (expected 16/32/64): " + bitsPerSample);
|
||||
throw new IIOException("Unsupported BitsPerSample for SampleFormat 3/Floating Point, 6/Complex Floating Point (expected 16/32/64): " + bitsPerSample);
|
||||
default:
|
||||
throw new IIOException("Unknown TIFF SampleFormat (expected 1, 2, 3 or 4): " + sampleFormat);
|
||||
throw new IIOException("Unknown TIFF SampleFormat (expected 1, 2, 3, 4, 5 or 6): " + sampleFormat);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user