CopperSpice API  1.7.2
QColormap Class Reference

The QColormap class maps device independent QColors to device dependent pixel values. More...

Public Types

enum  Mode
 

Public Methods

 QColormap (const QColormap &colormap)
 
 ~QColormap ()
 
const QColor colorAt (uint pixel) const
 
const QVector< QColorcolormap () const
 
int depth () const
 
Mode mode () const
 
QColormap & operator= (const QColormap &colormap)
 
uint pixel (const QColor &color) const
 
int size () const
 

Static Public Methods

static QColormap instance (int screen=-1)
 

Detailed Description

The QColormap class maps device independent QColors to device dependent pixel values.

See also
pixel()

Member Enumeration Documentation

This enum describes how QColormap maps device independent RGB values to device dependent pixel values.

ConstantValueDescription
QColormap::Direct0Pixel values are derived directly from the RGB values, also known as "True Color."
QColormap::Indexed1Pixel values represent indexes into a vector of available colors, i.e. QColormap uses the index of the color that most closely matches an RGB value.
QColormap::Gray2Similar to Indexed, pixel values represent a vector of available gray tones. QColormap uses the index of the gray tone that most closely matches the computed gray tone of an RGB value.

Constructor & Destructor Documentation

QColormap::QColormap ( const QColormap &  colormap)

Constructs a copy of another colormap.

QColormap::~QColormap ( )

Destroys the colormap.

Method Documentation

const QColor QColormap::colorAt ( uint  pixel) const

Returns a QColor for the pixel.

See also
pixel()
const QVector< QColor > QColormap::colormap ( ) const

Returns a vector of colors which represents the devices colormap for Indexed and Gray modes. This function returns an empty vector for Direct mode.

See also
size()
int QColormap::depth ( ) const

Returns the depth of the device.

See also
size()
QColormap QColormap::instance ( int  screen = -1)
static

Returns the colormap for the specified screen. If screen is -1, this function returns the colormap for the default screen.

Mode QColormap::mode ( ) const

Returns the mode of this colormap.

See also
QColormap::Mode
QColormap & QColormap::operator= ( const QColormap &  colormap)

Assigns the given colormap to this color map and returns a reference to this color map.

uint QColormap::pixel ( const QColor color) const

Returns a device dependent pixel value for the color.

See also
colorAt()
int QColormap::size ( ) const

Returns the size of the colormap for Indexed and Gray modes; Returns -1 for Direct mode.

See also
colormap()