IColorMap


IColorMap - Member Functions and Data by Group

Constructors & Destructor

Use these functions to create and destroy instances of this class.


[view class]
~IColorMap
public:
virtual ~IColorMap()

Destroy a color map instance.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IColorMap

Construct a color map object.


Overload 1
public:
IColorMap(const IColorMap&)

Copy constructor.

src
The color map to be copied.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IColorMap(EColorMapType colorMapType = kUserDefined)

Constructs a color map of the specified map type. The default map type is kUserDefined.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
public:
IColorMap(unsigned long, const IR8G8B8A8Color*)

Constructs a color map.

unsigned long
The number of colors.
const IR8G8B8A8Color*
A pointer to a color array.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 4
public:
IColorMap(unsigned long numberOfColors = 256)

Constructs a color map with the specified number of colors. The default is 256 colors.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 5
public:
IColorMap(IRGBAColorArray* colorArrayToAdopt)

Constructs a color map with a color array. Accepts a pointer to the color array.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Accessing the Color Data

Use these functions to access and manipulate the color data.


[view class]
colorIndex
public:
unsigned long colorIndex(const IBaseColor&) const

Returns the index of a color in the color map.

p
The IBaseColor whose index we need to get.

Exception

IGraphicException if the index is invalid

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
hasColorMapSupport
public:
static bool hasColorMapSupport()

Returns true if the system supports colormaps.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isColorIndexAllocated
public:
bool isColorIndexAllocated(unsigned long index) const

Returns true if the color index is allocated.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isSystemColor
public:
virtual bool isSystemColor(unsigned long) const

Tests whether a color is a system color and returns true if the color is a system color.

i
The color index need to be tested.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
mapColors
public:
unsigned long mapColors( unsigned long, const IR8G8B8A8Color* )

Map colors into the color array.

unsigned long
The number of colors.
const IR8G8B8A8Color*
A pointer to a color array.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
numberOfColors
public:
unsigned long numberOfColors() const

Returns the size of the color array.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator []
public:
const IR8G8B8A8Color& operator [](unsigned long) const

Index of operator to access the colors within the data structure.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
releaseCells
public:
unsigned long releaseCells()

Release all cells other than Reserved cells. Returns the number of released cells.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setColor
public:
virtual void setColor(unsigned long i, const IBaseColor& p)
Sets the color of the specified index in the color map.
i
The index to the color map.
p
The IBaseColor of the specified index.

Exception

IGraphicException if the index is invalid

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
systemColorIndex
public:
static unsigned long systemColorIndex(const IBaseColor&)

Get the index of a color in the system color map.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
systemColorRGB
public:
static unsigned long systemColorRGB(const long)

Get the rgb value of a color in the system color map, given the index.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment and Equality Operators

Use this operator function to handle color array assignment and equality tests.


[view class]
operator =
public:
IColorMap& operator =(const IColorMap&)

Assignment operator. Returns a non-constant reference to the left hand side object.

Src
The color map to be copied.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator ==
public:
virtual bool operator ==(const IColorMap&) const

Tests the two color arrays for equality.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Color Array Ownership

Use these functions to adopt and relinquish control of a color data array.


[view class]
adoptColorArray
public:
virtual void adoptColorArray( unsigned long size, IR8G8B8A8Color* colorArrayToAdopt )

Accept ownership of a color array.

size
The size of the new color array data.
colorArrayToAdopt
Pointer to the color array data to be adopted.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
orphanColorArray
public:
virtual IR8G8B8A8Color* orphanColorArray()

Relinquishes knowledge of, and responsibility for, the color array and returns it to the caller. Returns a pointer to the color array data that was orphaned.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Streaming Support

Use these functions to enable streaming of color maps.


[view class]
operator <<=
public:
IDataStream& operator <<=(IDataStream&)

This function supports streaming in the color map data.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator >>=
public:
IDataStream& operator >>=(IDataStream&) const

This function supports streaming out the color map data.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Using Color Maps

Use these functions to work with various types of color maps for the underlying platform.


[view class]
colorMapType
public:
EColorMapType colorMapType() const

Return the type of the color map.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
defaultColorMap
public:
static IColorMap& defaultColorMap()

Returns a reference to a default system color map.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
defaultSystemColorMap
public:
static IColorMap& defaultSystemColorMap()

Returns a reference to a default system color map.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
nativeColorMap
public:
unsigned long nativeColorMap()

Creates a platform specific native palette using IRGBAColorArray data. Returns the native palette being created.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setColorMapType
public:
void setColorMapType(EColorMapType)

Set the color map type to one of the values in EColorMapType.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDefaultColorMap
public:
static void setDefaultColorMap(IColorMap*)

Sets the default color map.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
trueColorMap
public:
static IColorMap& trueColorMap()

Returns a reference to a default true color map.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
webSafeColorMap
public:
static IColorMap& webSafeColorMap()

Returns a reference to a default web-safe color map.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IColorMap - Enumerations


[view class]
EColorCellStatus
enum EColorCellStatus { kNotFound=-, 
                        kReserved=0, 
                        kFree=1, 
                        kUsed=2 }

The status of cells in the color array.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
EColorMapType
enum EColorMapType { kSystem=-, 
                     kTrueColor=0, 
                     kUserDefined=1 }

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IColorMap - Inherited Member Functions and Data

Inherited Public Functions

IRGBAColorArray

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data