ColorUtilities.getMinimum/Maximum does not work for 16 bit unsigned data
------------------------------------------------------------------------
Key: GEOT-2631
URL: http://jira.codehaus.org/browse/GEOT-2631
Project: GeoTools
Issue Type: Bug
Components: core coverage
Affects Versions: 2.5.6
Reporter: Gabriel Roldán
Assignee: Gabriel Roldán
Fix For: 2.5.7
This prevents the normalize contrast enhancement to be applied to UShort
rasters. The following patch solves it:
{code}
Index: ColorUtilities.java
===================================================================
--- ColorUtilities.java (revision 33625)
+++ ColorUtilities.java (working copy)
@@ -444,6 +444,7 @@
public static double getMinimum(int dataType) {
switch (dataType) {
case DataBuffer.TYPE_BYTE:
+ case DataBuffer.TYPE_USHORT:
return 0;
case DataBuffer.TYPE_SHORT:
return Short.MIN_VALUE;
@@ -470,6 +471,8 @@
switch (dataType) {
case DataBuffer.TYPE_BYTE:
return 255;
+ case DataBuffer.TYPE_USHORT:
+ return 65535;
case DataBuffer.TYPE_SHORT:
return Short.MAX_VALUE;
case DataBuffer.TYPE_INT:
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel