Package com.luciad.util
Class TLcdIndexColorModel
java.lang.Object
java.awt.image.ColorModel
java.awt.image.IndexColorModel
com.luciad.util.TLcdIndexColorModel
- All Implemented Interfaces:
Transparency
Extension of
IndexColorModel
that takes a
TLcdColorMap
to define the coloring.
Important notice: the package com.luciad.imaging
presents a new API
for the modeling of raster data. For new projects, it is recommended to use
this API instead of ILcdRaster
et al. You can set the TLcdColorMap
directly on the
painter or styler or use TLcdIndexLookupOp
to manually map values to colors.
retrieveColor
on the given
TLcdColorMap
for every possible (integer) level to define the
exact coloring. The levels of the given TLcdColorMap
will be
converted to raster values using the configured
configured
raster value converter
, or simply interpreted as integers if
no converter is present.
All level values that are outside the valid range
(TLcdColorMap.getLevelInterval()
) will be completely transparent.
The TLcdColorMap
used to construct the
TLcdIndexColorModel
can be retrieved later on using
getColorMap()
. This allows to create a new
TLcdIndexColorModel
that is slightly different from a given
TLcdIndexColorModel
. For example,
TLcdColorMap color_map = ( TLcdColorMap ) given_index_color_model.getColorMap().clone();
//make modifications to the color map
color_map.setColor( 0, Color.blue );
//create slightly modified index color model
modified_index_color_model = new TLcdIndexColorModel( given_index_color_model,color_map )
As its superclass, this TLcdIndexColorModel
cannot be changed after it is
constructed. Therefore one should not modify the properties of the TLcdColorMap
after it is given to the constructor, nor should one modify the TLcdColorMap
returned by getColorMap()
.-
Field Summary
Fields inherited from class java.awt.image.ColorModel
pixel_bits, transferType
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
-
Constructor Summary
ConstructorDescriptionTLcdIndexColorModel
(int aBits, int aSize, TLcdColorMap aColorMap) Creates a newTLcdIndexColorModel
, using the coloring from the givenTLcdColorMap
.TLcdIndexColorModel
(int aBits, int aSize, TLcdColorMap aColorMap, ILcdRasterValueConverter aConverter) Creates a newTLcdIndexColorModel
, using the coloring from the givenTLcdColorMap
, and the given converter.TLcdIndexColorModel
(int aBits, TLcdColorMap aColorMap) Creates a newTLcdIndexColorModel
.TLcdIndexColorModel
(ColorModel aColorModel, TLcdColorMap aColorMap) Creates a newTLcdIndexColorModel
.TLcdIndexColorModel
(IndexColorModel aColorModel, TLcdColorMap aColorMap) Creates a newTLcdIndexColorModel
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the color map used to create this object.Returns the converter used to map the color map's data values to internal raster values.int
hashCode()
Methods inherited from class java.awt.image.IndexColorModel
convertToIntDiscrete, createCompatibleSampleModel, createCompatibleWritableRaster, getAlpha, getAlphas, getBlue, getBlues, getComponents, getComponents, getComponentSize, getDataElement, getDataElements, getDataElements, getGreen, getGreens, getMapSize, getRed, getReds, getRGB, getRGBs, getTransparency, getTransparentPixel, getValidPixels, isCompatibleRaster, isCompatibleSampleModel, isValid, isValid, toString
Methods inherited from class java.awt.image.ColorModel
coerceData, getAlpha, getAlphaRaster, getBlue, getColorSpace, getComponentSize, getDataElement, getDataElements, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRGB, getRGBdefault, getTransferType, getUnnormalizedComponents, hasAlpha, isAlphaPremultiplied
-
Constructor Details
-
TLcdIndexColorModel
Creates a newTLcdIndexColorModel
. It takes the coloring from the givenTLcdColorMap
. Remaining information such as bit count etc are retrieved from the givenColorModel
.- Parameters:
aColorModel
- TheColorModel
used to retrieve some general properties from.aColorMap
- TheColorMap
used to retrieve the colors from.
-
TLcdIndexColorModel
Creates a newTLcdIndexColorModel
. It takes the coloring from the givenTLcdColorMap
. Remaining information such as bit count etc are retrieved from the givenIndexColorModel
.- Parameters:
aColorModel
- TheIndexColorModel
used to retrieve some general properties from.aColorMap
- TheColorMap
used to retrieve the colors from.
-
TLcdIndexColorModel
Creates a newTLcdIndexColorModel
. It takes the coloring from the givenTLcdColorMap
.- Parameters:
aBits
- The bit count of the data that will be colored using thisTLcdIndexColorModel
. See super.aColorMap
- TheColorMap
used to retrieve the colors from.
-
TLcdIndexColorModel
Creates a newTLcdIndexColorModel
, using the coloring from the givenTLcdColorMap
.- Parameters:
aBits
- The bit count of the data that will be colored using thisTLcdIndexColorModel
. See super.aColorMap
- TheColorMap
used to retrieve the colors from.
-
TLcdIndexColorModel
public TLcdIndexColorModel(int aBits, int aSize, TLcdColorMap aColorMap, ILcdRasterValueConverter aConverter) Creates a newTLcdIndexColorModel
, using the coloring from the givenTLcdColorMap
, and the given converter.- Parameters:
aBits
- The bit count of the data that will be colored using thisTLcdIndexColorModel
. See super.aSize
- The map size of theTLcdIndexColorModel
. See super.aColorMap
- TheColorMap
used to retrieve the colors from.aConverter
- Describes how the color map's levels map to actual raster values.
-
-
Method Details
-
getColorMap
Returns the color map used to create this object. One should not modify the properties of the returned object.- Returns:
- the color map used to create this object.
-
getConverter
Returns the converter used to map the color map's data values to internal raster values.- Returns:
- the converter used to map the color map's data values to internal raster values.
-
equals
- Overrides:
equals
in classIndexColorModel
-
hashCode
public int hashCode()- Overrides:
hashCode
in classIndexColorModel
-