IRGBAColorArray

IRGBAColorArray class is the basic storage for cross platform pixel data or color data such as a color lookup table (e.g., a palette in Windows and OS/2).


IRGBAColorArray - Member Functions and Data by Group

Constructors & Destructor

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


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

This function destroys the IRGBAColorArray.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IRGBAColorArray

This function constructs an instance of this class.


Overload 1
public:
IRGBAColorArray(unsigned long numberOfColors = 256)

Constructs a color array with the specified number of colors.

numberOfColors
The number of colors.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IRGBAColorArray(const IRGBAColorArray& source)

This function is the copy constructor.

source
The array to be copied.

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]
color
public:
IBaseColor color(unsigned long i) const

Returns the color of the specified index in the color array.

i
The index to the 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.

Return
The number of colors in the color array.

Exception

IGraphicException if the index is invalid

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
operator []

Index operator to facilitate access to the data structure by subclasses.


Overload 1
public:
const IR8G8B8A8Color& operator [](unsigned long i) const

This version of the index operator is used when the color array is a const object.

i
The index to the color array for the element

Return
A constant reference of the element

Exception

IGraphicException if the index is invalid

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IR8G8B8A8Color& operator [](unsigned long i)

This version of the index operator is used when the color array is non-const.

i
The index to the color array for the element

Return
A non-constant reference of the element

Exception

IGraphicException if the index is invalid

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 array.

i
The index to the color array.
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]
fColors
protected:
IR8G8B8A8Color* fColors

A pointer to the 8-bit color structure.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
fNumberOfColors
protected:
unsigned long fNumberOfColors

The size of the fColors color array.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment and Equality Operators

Use these operator functions to handle color array assignment and equality tests.


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

Assignment operator.

Src
The color array to be copied.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

Tests the two color arrays for equality.

const IRGBAColorArray&
The array to be compared with this one.

This function returns true if the two color arrays have the same depth and all color cells are equal.

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 )

Assume ownership of the allocation of a new color array data allocation.

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, returning it to the caller. The function 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 data.


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

This function supports streaming in the color array data.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

This function supports streaming out the color array data.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IRGBAColorArray - Inherited Member Functions and Data

Inherited Public Functions

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data