Views
Maps Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvIntervalColorModel Class Reference

Implements a color model that performs a linear interpolation to compute the pixel colors with intervals specified by the user. More...

#include <ilviews/maps/rendering/cmodel.h>

Inheritance diagram for IlvIntervalColorModel:
IlvMapColorModel

Public Member Functions

 IlvIntervalColorModel (const IlUChar *redMap, const IlUChar *greenMap, const IlUChar *blueMap, IlUInt colorCount, const IlInt *limits, IlUInt limitCount)
 Creates an instance of IlvIntervalColorModel. More...
 
 IlvIntervalColorModel (const IlvIntervalColorModel &model)
 Creates a new instance of IlvIntervalColorModel by copying the specified color model. More...
 
virtual IlvMapColorModelcopy () const
 Returns a copy of the object. More...
 
virtual IlUChar getAlpha (IlInt pixel) const
 Returns the alpha component for a pixel value. More...
 
virtual IlUChar getBlue (IlInt pixel) const
 Returns the blue component for a pixel value. More...
 
IlUInt getColors (IlUChar *&redmap, IlUChar *&greenmap, IlUChar *&bluemap) const
 Returns the color array. More...
 
virtual IlUChar getGreen (IlInt pixel) const
 Returns the green component for a pixel value. More...
 
IlUInt getLimits (IlInt *&limits) const
 Returns the limit array. More...
 
virtual IlUChar getRed (IlInt pixel) const
 Returns the red component for a pixel value. More...
 
IlBoolean isPersistent () const
 Indicates if this color model is persistent. More...
 
- Public Member Functions inherited from IlvMapColorModel
virtual void getRGBA (IlInt pixel, IlUChar &red, IlUChar &green, IlUChar &blue, IlUChar &alpha) const
 Returns the RGBA component for a pixel value. More...
 
void save (IlvOutputFile &file) const
 Saves the object to an output file. More...
 
virtual void write (IlvOutputFile &file) const =0
 Writes the color model to an output file. More...
 

Static Public Member Functions

static IlvIntervalColorModelMakeElevationColorModel ()
 Returns a predefined interval color model with values adapted to renderer elevation rasters. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IlvMapColorModel
 IlvMapColorModel ()
 Initializes a new color model instance.
 

Detailed Description

Implements a color model that performs a linear interpolation to compute the pixel colors with intervals specified by the user.

Library: ilvmaps

This color model can be used to create images from an IlvMapRaster.

See also
IlvDefaultRasterRenderer.

Constructor & Destructor Documentation

◆ IlvIntervalColorModel() [1/2]

IlvIntervalColorModel::IlvIntervalColorModel ( const IlUChar redMap,
const IlUChar greenMap,
const IlUChar blueMap,
IlUInt  colorCount,
const IlInt limits,
IlUInt  limitCount 
)

Creates an instance of IlvIntervalColorModel.

Parameters
redMapThe value of chars indicating the red component of the colors for the interval limits. The value can be between 0 and 255. The first value of the array is for MinInt and the last value is for MaxInt. Intermediate limits are specified in the limits array.
greenMapThe value of chars indicating the green component of the colors for the interval limits. The value can be between 0 and 255. The first value of the array is for MinInt and the last value is for MaxInt. Intermediate limits are specified in the limits array.
blueMapThe value of chars indicating the blue component of the colors for the interval limits. The value can be between 0 and 255. The first value of the array is for MinInt and the last value is for MaxInt. Intermediate limits are specified in the limits array.
colorCountThe size of the arrays redMap, greenMap and blueMap.
limitsThe values of the interval limits.
limitCountThe size of the array limits.
Note
The number of limits must be colorCount - 2.

◆ IlvIntervalColorModel() [2/2]

IlvIntervalColorModel::IlvIntervalColorModel ( const IlvIntervalColorModel model)

Creates a new instance of IlvIntervalColorModel by copying the specified color model.

Parameters
modelThe model to be copied.

Member Function Documentation

◆ copy()

virtual IlvMapColorModel* IlvIntervalColorModel::copy ( ) const
virtual

Returns a copy of the object.

Returns
The copy of the object.

Implements IlvMapColorModel.

◆ getAlpha()

virtual IlUChar IlvIntervalColorModel::getAlpha ( IlInt  pixel) const
virtual

Returns the alpha component for a pixel value.

Parameters
pixelThe pixel to get the alpha value from.
Returns
The alpha component for the pixel pixel.

Implements IlvMapColorModel.

◆ getBlue()

virtual IlUChar IlvIntervalColorModel::getBlue ( IlInt  pixel) const
virtual

Returns the blue component for a pixel value.

Parameters
pixelThe pixel to get the blue value from.
Returns
The blue component for the pixel pixel.

Implements IlvMapColorModel.

◆ getColors()

IlUInt IlvIntervalColorModel::getColors ( IlUChar *&  redmap,
IlUChar *&  greenmap,
IlUChar *&  bluemap 
) const

Returns the color array.

Parameters
redmapReturns a pointer to the internal array of red map.
greenmapReturns a pointer to the internal array of green map.
bluemapReturns a pointer to the internal array of blue map.
Returns
The number of colors.

◆ getGreen()

virtual IlUChar IlvIntervalColorModel::getGreen ( IlInt  pixel) const
virtual

Returns the green component for a pixel value.

Parameters
pixelThe pixel to get the green value from.
Returns
The green component for the pixel pixel.

Implements IlvMapColorModel.

◆ getLimits()

IlUInt IlvIntervalColorModel::getLimits ( IlInt *&  limits) const

Returns the limit array.

Parameters
limitsReturns a pointer to the internal array of limits.
Returns
The number of limits.

◆ getRed()

virtual IlUChar IlvIntervalColorModel::getRed ( IlInt  pixel) const
virtual

Returns the red component for a pixel value.

Parameters
pixelThe pixel to get the red value from.
Returns
The red component for the pixel pixel.

Implements IlvMapColorModel.

◆ isPersistent()

IlBoolean IlvIntervalColorModel::isPersistent ( ) const
virtual

Indicates if this color model is persistent.

Returns
Always IlTrue.

Reimplemented from IlvMapColorModel.

◆ MakeElevationColorModel()

static IlvIntervalColorModel* IlvIntervalColorModel::MakeElevationColorModel ( )
static

Returns a predefined interval color model with values adapted to renderer elevation rasters.

Returns
An IlvIntervalColorModel object that must be deleted by the user.