public class TLcdIndexColorModel extends IndexColorModel
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()
.pixel_bits, transferType
BITMASK, OPAQUE, TRANSLUCENT
Constructor and Description |
---|
TLcdIndexColorModel(ColorModel aColorModel,
TLcdColorMap aColorMap)
Creates a new
TLcdIndexColorModel . |
TLcdIndexColorModel(IndexColorModel aColorModel,
TLcdColorMap aColorMap)
Creates a new
TLcdIndexColorModel . |
TLcdIndexColorModel(int aBits,
int aSize,
TLcdColorMap aColorMap)
Creates a new
TLcdIndexColorModel , using the coloring
from the given TLcdColorMap . |
TLcdIndexColorModel(int aBits,
int aSize,
TLcdColorMap aColorMap,
ILcdRasterValueConverter aConverter)
Creates a new
TLcdIndexColorModel , using the coloring
from the given TLcdColorMap , and the given converter. |
TLcdIndexColorModel(int aBits,
TLcdColorMap aColorMap)
Creates a new
TLcdIndexColorModel . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
TLcdColorMap |
getColorMap()
Returns the color map used to create this object.
|
ILcdRasterValueConverter |
getConverter()
Returns the converter used to map the color map's data values to internal raster values.
|
int |
hashCode() |
convertToIntDiscrete, createCompatibleSampleModel, createCompatibleWritableRaster, finalize, 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
coerceData, getAlpha, getAlphaRaster, getBlue, getColorSpace, getComponentSize, getDataElement, getDataElements, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRGB, getRGBdefault, getTransferType, getUnnormalizedComponents, hasAlpha, isAlphaPremultiplied
public TLcdIndexColorModel(ColorModel aColorModel, TLcdColorMap aColorMap)
TLcdIndexColorModel
. It takes the coloring
from the given TLcdColorMap
. Remaining information such as
bit count etc are retrieved from the given ColorModel
.aColorModel
- The ColorModel
used to retrieve some
general properties from.aColorMap
- The ColorMap
used to retrieve the colors
from.public TLcdIndexColorModel(IndexColorModel aColorModel, TLcdColorMap aColorMap)
TLcdIndexColorModel
. It takes the coloring
from the given TLcdColorMap
. Remaining information such as
bit count etc are retrieved from the given IndexColorModel
.aColorModel
- The IndexColorModel
used to retrieve
some general properties from.aColorMap
- The ColorMap
used to retrieve the colors
from.public TLcdIndexColorModel(int aBits, TLcdColorMap aColorMap)
TLcdIndexColorModel
. It takes the coloring
from the given TLcdColorMap
.aBits
- The bit count of the data that will be colored using this
TLcdIndexColorModel
. See super.aColorMap
- The ColorMap
used to retrieve the colors
from.public TLcdIndexColorModel(int aBits, int aSize, TLcdColorMap aColorMap)
TLcdIndexColorModel
, using the coloring
from the given TLcdColorMap
.aBits
- The bit count of the data that will be colored using this
TLcdIndexColorModel
. See super.aColorMap
- The ColorMap
used to retrieve the colors
from.public TLcdIndexColorModel(int aBits, int aSize, TLcdColorMap aColorMap, ILcdRasterValueConverter aConverter)
TLcdIndexColorModel
, using the coloring
from the given TLcdColorMap
, and the given converter.aBits
- The bit count of the data that will be colored using this
TLcdIndexColorModel
. See super.aSize
- The map size of the TLcdIndexColorModel
. See
super.aColorMap
- The ColorMap
used to retrieve the colors
from.aConverter
- Describes how the color map's levels map to actual raster values.public TLcdColorMap getColorMap()
public ILcdRasterValueConverter getConverter()
public boolean equals(Object o)
equals
in class ColorModel
public int hashCode()
hashCode
in class ColorModel