Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TColor256Util Class Reference

Enables conversion, in both directions, between a TRgb object and an index into an arbitrary 256 colour palette. More...

#include <gdi.h>

Public Member Functions

IMPORT_C void Construct (const CPalette &aPalette)
 Initialises the two lookup tables using the specified palette.
 
IMPORT_C TInt Color256 (TRgb aRgb) const
 Gets the entry from the inverse colour lookup table for the colour that most closely matches the specified TRgb value.
 
IMPORT_C void Color256 (TUint8 *aDestination, const TRgb *aSource, TInt aNumPixels) const
 Gets the entries from the inverse colour lookup table for the colours that most closely match the specified TRgb values.
 
TRgb Color256 (TInt aColor256) const
 Gets the TRgb value of the entry at the specified index in the colour lookup table.
 

Static Public Member Functions

static IMPORT_C const TColor256Util * Default ()
 Returns a pointer to the system default 256 colour palette.
 

Public Attributes

TUint32 iColorTable [256]
 256 colour lookup table.
 
TUint8 iInverseColorTable [0x1000]
 Inverse colour lookup table.
 

Detailed Description

Enables conversion, in both directions, between a TRgb object and an index into an arbitrary 256 colour palette.

API status
Published to all clients. Released API.

Definition at line 393 of file gdi.h.

Member Function Documentation

◆ Color256() [1/3]

TRgb TColor256Util::Color256 ( TInt  aColor256) const
inline

Gets the TRgb value of the entry at the specified index in the colour lookup table.

Parameters
aColor256The index into the colour lookup table.

(generated from Symbian Developer Library)

◆ Color256() [2/3]

IMPORT_C TInt TColor256Util::Color256 ( TRgb  aRgb) const

Gets the entry from the inverse colour lookup table for the colour that most closely matches the specified TRgb value.

Entries in the inverse colour lookup table are indices into the palette that the object was created with. Essentially, this function matches aRgb to the index of the nearest colour in the palette.

Parameters
aRgbThe conversion colour.

(generated from Symbian Developer Library)

◆ Color256() [3/3]

IMPORT_C void TColor256Util::Color256 ( TUint8 *  aDestination,
const TRgb *  aSource,
TInt  aNumPixels 
) const

Gets the entries from the inverse colour lookup table for the colours that most closely match the specified TRgb values.

Parameters
aDestinationOn return, a pointer to a buffer containing the entries from the inverse colour lookup table.
aSourcePointer to the first TRgb value to match.
aNumPixelsThe number of TRgb values to match.

(generated from Symbian Developer Library)

◆ Construct()

IMPORT_C void TColor256Util::Construct ( const CPalette &  aPalette)

Initialises the two lookup tables using the specified palette.

Parameters
aPaletteThe palette of colours used to initialise the colour lookup tables.

(generated from Symbian Developer Library)

◆ Default()

static IMPORT_C const TColor256Util * TColor256Util::Default ( )
static

Returns a pointer to the system default 256 colour palette.

(generated from Symbian Developer Library)

Member Data Documentation

◆ iColorTable

TUint32 TColor256Util::iColorTable[256]

256 colour lookup table.

Each entry is a 32 bit value which corresponds to a TRgb value in the palette passed to Construct(). If there are more than 256 colours in the palette, the first 256 colours are used in this table. If there are fewer than 256 entries, the remaining entries in the table are set to zero.

Definition at line 408 of file gdi.h.

◆ iInverseColorTable

TUint8 TColor256Util::iInverseColorTable[0x1000]

Inverse colour lookup table.

It has 4096 entries. Each entry is the index of a colour in the palette that the object was created with (see Construct()) that most closely matches the 4096 degrees of intensity of red, green and blue on a uniform 16x16x16 colour cube.

It is called "inverse" because iColorTable maps indices (0..255) to TRgb values, but this table maps TRgb values to palette indices.

Definition at line 419 of file gdi.h.


The documentation for this class was generated from the following files: