#374 Added support for TIFF 32 bit float Grayscale

This commit is contained in:
Harald Kuhr
2017-10-16 14:52:40 +02:00
parent c1fac78f3c
commit a15e69e019
2 changed files with 44 additions and 2 deletions
@@ -112,6 +112,9 @@ public final class ImageTypeSpecifiers {
// As the ComponentColorModel is broken for 32 bit unsigned int, we'll use our own version
return UInt32ImageTypeSpecifier.createInterleaved(ColorSpace.getInstance(ColorSpace.CS_GRAY), new int[] {0}, false, false);
}
else if (dataType == DataBuffer.TYPE_FLOAT || dataType == DataBuffer.TYPE_DOUBLE) {
return ImageTypeSpecifier.createInterleaved(ColorSpace.getInstance(ColorSpace.CS_GRAY), new int[] {0}, dataType, false, false);
}
// NOTE: The isSigned boolean is stored but *not used for anything* in the Grayscale ImageTypeSpecifier...
return ImageTypeSpecifier.createGrayscale(bits, dataType, false);
@@ -126,6 +129,9 @@ public final class ImageTypeSpecifiers {
// As the ComponentColorModel is broken for 32 bit unsigned int, we'll use our own version
return UInt32ImageTypeSpecifier.createInterleaved(ColorSpace.getInstance(ColorSpace.CS_GRAY), new int[] {0, 1}, true, isAlphaPremultiplied);
}
else if (dataType == DataBuffer.TYPE_FLOAT || dataType == DataBuffer.TYPE_DOUBLE) {
return ImageTypeSpecifier.createInterleaved(ColorSpace.getInstance(ColorSpace.CS_GRAY), new int[] {0, 1}, dataType, true, isAlphaPremultiplied);
}
// NOTE: The isSigned boolean is stored but *not used for anything* in the Grayscale ImageTypeSpecifier...
return ImageTypeSpecifier.createGrayscale(bits, dataType, false, isAlphaPremultiplied);