Class TLcdIndexColorModel

All Implemented Interfaces:
Transparency

public class TLcdIndexColorModel extends IndexColorModel
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.

It will use 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().
  • Constructor Details

    • TLcdIndexColorModel

      public TLcdIndexColorModel(ColorModel aColorModel, TLcdColorMap aColorMap)
      Creates a new TLcdIndexColorModel. It takes the coloring from the given TLcdColorMap. Remaining information such as bit count etc are retrieved from the given ColorModel.
      Parameters:
      aColorModel - The ColorModel used to retrieve some general properties from.
      aColorMap - The ColorMap used to retrieve the colors from.
    • TLcdIndexColorModel

      public TLcdIndexColorModel(IndexColorModel aColorModel, TLcdColorMap aColorMap)
      Creates a new TLcdIndexColorModel. It takes the coloring from the given TLcdColorMap. Remaining information such as bit count etc are retrieved from the given IndexColorModel.
      Parameters:
      aColorModel - The IndexColorModel used to retrieve some general properties from.
      aColorMap - The ColorMap used to retrieve the colors from.
    • TLcdIndexColorModel

      public TLcdIndexColorModel(int aBits, TLcdColorMap aColorMap)
      Creates a new TLcdIndexColorModel. It takes the coloring from the given TLcdColorMap.
      Parameters:
      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.
    • TLcdIndexColorModel

      public TLcdIndexColorModel(int aBits, int aSize, TLcdColorMap aColorMap)
      Creates a new TLcdIndexColorModel, using the coloring from the given TLcdColorMap.
      Parameters:
      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.
    • TLcdIndexColorModel

      public TLcdIndexColorModel(int aBits, int aSize, TLcdColorMap aColorMap, ILcdRasterValueConverter aConverter)
      Creates a new TLcdIndexColorModel, using the coloring from the given TLcdColorMap, and the given converter.
      Parameters:
      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.
  • Method Details

    • getColorMap

      public TLcdColorMap 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

      public ILcdRasterValueConverter 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

      public boolean equals(Object o)
      Overrides:
      equals in class IndexColorModel
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class IndexColorModel