|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.coverage.TypeMap
Utility methods for choosing a sample model or a
color model on the basis of a range of values.
This class provides also some methods for mapping SampleDimensionType
to DataBuffer
types.
Method Summary | |
static org.opengis.coverage.ColorInterpretation |
getColorInterpretation(java.awt.image.ColorModel model,
int band)
Returns the color interpretation code for the specified color model and band number. |
static int |
getDataBufferType(org.opengis.coverage.SampleDimensionType type)
Returns the DataBuffer type. |
static org.opengis.util.InternationalString |
getName(org.opengis.coverage.SampleDimensionType type)
Returns the sample dimension type name as an international string. |
static NumberRange |
getPositiveRange(org.opengis.coverage.SampleDimensionType type)
Returns the range of positive sample values (excluding 0). |
static NumberRange |
getRange(org.opengis.coverage.SampleDimensionType type)
Returns the full range of sample values for the specified dimension type. |
static org.opengis.coverage.SampleDimensionType |
getSampleDimensionType(double min,
double max)
Returns the smallest sample dimension type capable to hold the specified range of values. |
static org.opengis.coverage.SampleDimensionType |
getSampleDimensionType(long min,
long max)
Returns the smallest sample dimension type capable to hold the specified range of values. |
static org.opengis.coverage.SampleDimensionType |
getSampleDimensionType(javax.media.jai.util.Range range)
Returns the smallest sample dimension type capable to hold the specified range of values. |
static org.opengis.coverage.SampleDimensionType |
getSampleDimensionType(java.awt.image.SampleModel model,
int band)
Returns the sample dimension type for the specified sample model and band number. |
static int |
getSize(org.opengis.coverage.SampleDimensionType type)
Returns the size in bits. |
static boolean |
isFloatingPoint(org.opengis.coverage.SampleDimensionType type)
Returns for floating-point data type. |
static boolean |
isSigned(org.opengis.coverage.SampleDimensionType type)
Returns for signed sample type. |
static java.lang.Number |
wrapSample(double value,
org.opengis.coverage.SampleDimensionType type,
boolean allowWidening)
Wraps the specified value into a number of the specified data type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static org.opengis.coverage.SampleDimensionType getSampleDimensionType(javax.media.jai.util.Range range)
range
- The range of values.
public static org.opengis.coverage.SampleDimensionType getSampleDimensionType(double min, double max)
min
- The lower value, inclusive.max
- The upper value, inclusive as well.
public static org.opengis.coverage.SampleDimensionType getSampleDimensionType(long min, long max)
min
- The lower value, inclusive.max
- The upper value, inclusive as well.
public static org.opengis.coverage.SampleDimensionType getSampleDimensionType(java.awt.image.SampleModel model, int band) throws java.lang.IllegalArgumentException
model
- The sample model.band
- The band to query.
java.lang.IllegalArgumentException
- if the band number is not in the valid range.public static org.opengis.util.InternationalString getName(org.opengis.coverage.SampleDimensionType type)
SampleDimensionType.UNSIGNED_16BITS
is "16 bits unsigned integer"
in English and "Entier non-sign? sur 16 bits" in French.
public static int getDataBufferType(org.opengis.coverage.SampleDimensionType type)
DataBuffer
type. This is one of the following constants:
TYPE_BYTE
,
TYPE_USHORT
,
TYPE_SHORT
,
TYPE_INT
,
TYPE_FLOAT
,
TYPE_DOUBLE
or
DataBuffer.TYPE_UNDEFINED
if the type is unrecognized.
public static int getSize(org.opengis.coverage.SampleDimensionType type)
DataBuffer.getDataTypeSize(int)
, which have values ranging
from 8 to 64.
public static boolean isSigned(org.opengis.coverage.SampleDimensionType type)
public static boolean isFloatingPoint(org.opengis.coverage.SampleDimensionType type)
public static NumberRange getRange(org.opengis.coverage.SampleDimensionType type)
public static NumberRange getPositiveRange(org.opengis.coverage.SampleDimensionType type)
public static java.lang.Number wrapSample(double value, org.opengis.coverage.SampleDimensionType type, boolean allowWidening) throws java.lang.IllegalArgumentException
value
- The value to wrap in a Number
object.type
- A constant from the SampleDimensionType
code list.allowWidening
- if this method is allowed to returns
a wider type than the usual one for the specified .
Number
.
java.lang.IllegalArgumentException
- if is not a recognized constant.
java.lang.IllegalArgumentException
- if is
and the specified can't fit in the specified sample type.public static org.opengis.coverage.ColorInterpretation getColorInterpretation(java.awt.image.ColorModel model, int band) throws java.lang.IllegalArgumentException
model
- The color model.band
- The band to query.
java.lang.IllegalArgumentException
- if the band number is not in the valid range.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |