Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvColorMap Class Reference

Colormap class. More...

#include <ilviews/bitmaps/colormap.h>

Public Member Functions

 IlvColorMap (IlUInt numcols=256)
 Constructor. More...
 
virtual ~IlvColorMap ()
 Destructor. Releases the memory used by the instance.
 
IlUChar getA (IlUInt index) const
 Returns the alpha component of the given index entry. More...
 
IlUChar getB (IlUInt index) const
 Returns the blue component of the given index entry. More...
 
IlUInt getColorNum () const
 Returns the number of color entries in the colormap. More...
 
IlBoolean getEntry (IlUInt index, IlUChar &r, IlUChar &g, IlUChar &b) const
 Returns the color components of the given entry. More...
 
IlBoolean getEntry (IlUInt index, IlUChar &r, IlUChar &g, IlUChar &b, IlUChar &a) const
 Returns all the color components of the given entry. More...
 
IlUChar getG (IlUInt index) const
 Returns the green component of the given index entry. More...
 
IlUChar getR (IlUInt index) const
 Returns the red component of the given index entry. More...
 
IlUInt getRefCount () const
 Returns the reference count for this instance.
 
void lock ()
 Locks the current instance.
 
IlBoolean setEntry (IlUInt index, IlUChar r, IlUChar g, IlUChar b, IlUChar a=255)
 Sets an entry of the colormap. More...
 
void unLock ()
 Unlocks the current instance. If the reference count is 0 the instance is deleted.
 

Detailed Description

Colormap class.

Library: xviews or winviews or mviews (mutually exclusive)

The IlvColorMap class lets you manipulate colormaps. This class hides internal memory storage of a colormap. Colormaps can have an unlimited amount of color entries, each being described as a quadruplet of red, green, blue, and alpha components. Colormaps can be shared and must be locked and unlocked.

See also
IlvIndexedBitmapData, IlvQuantizer

Constructor & Destructor Documentation

§ IlvColorMap()

IlvColorMap::IlvColorMap ( IlUInt  numcols = 256)

Constructor.

Initializes a new IlvColorMap object representing a colormap.

Parameters
numcolsThe number of entries in the colormap.

Member Function Documentation

§ getA()

IlUChar IlvColorMap::getA ( IlUInt  index) const

Returns the alpha component of the given index entry.

Parameters
indexThe index of the entry.
Returns
The alpha component of the given index entry.

§ getB()

IlUChar IlvColorMap::getB ( IlUInt  index) const

Returns the blue component of the given index entry.

Parameters
indexThe index of the entry.
Returns
The blue component of the given index entry.

§ getColorNum()

IlUInt IlvColorMap::getColorNum ( ) const

Returns the number of color entries in the colormap.

Returns
The number of color entries in the colormap.

§ getEntry() [1/2]

IlBoolean IlvColorMap::getEntry ( IlUInt  index,
IlUChar r,
IlUChar g,
IlUChar b 
) const

Returns the color components of the given entry.

Parameters
indexThe index of the entry.
rThe red component of the entry.
gThe green component of the entry.
bThe blue component of the entry.
Returns
IlTrue if index is a valid index entry, IlFalse if not.

§ getEntry() [2/2]

IlBoolean IlvColorMap::getEntry ( IlUInt  index,
IlUChar r,
IlUChar g,
IlUChar b,
IlUChar a 
) const

Returns all the color components of the given entry.

Parameters
indexThe index of the entry.
rThe red component of the entry.
gThe green component of the entry.
bThe blue component of the entry.
aThe alpha component of the entry.
Returns
IlTrue if index is a valid index entry, IlFalse if not.

§ getG()

IlUChar IlvColorMap::getG ( IlUInt  index) const

Returns the green component of the given index entry.

Parameters
indexThe index of the entry.
Returns
The green component of the given index entry.

§ getR()

IlUChar IlvColorMap::getR ( IlUInt  index) const

Returns the red component of the given index entry.

Parameters
indexThe index of the entry.
Returns
The red component of the given index entry.

§ setEntry()

IlBoolean IlvColorMap::setEntry ( IlUInt  index,
IlUChar  r,
IlUChar  g,
IlUChar  b,
IlUChar  a = 255 
)

Sets an entry of the colormap.

Parameters
indexThe index of the entry.
rThe red component of the entry.
gThe green component of the entry.
bThe blue component of the entry.
aThe alpha component of the entry.

© Copyright 2017, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.