1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the documentation of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:FDL$
10 ** GNU Free Documentation License
11 ** Alternatively, this file may be used under the terms of the GNU Free
12 ** Documentation License version 1.3 as published by the Free Software
13 ** Foundation and appearing in the file included in the packaging of
17 ** Alternatively, this file may be used in accordance with the terms
18 ** and conditions contained in a signed written agreement between you
26 ****************************************************************************/
32 \brief The QColormap class maps device independent QColors to device
33 dependent pixel values.
36 /*! \enum QColormap::Mode
38 This enum describes how QColormap maps device independent RGB
39 values to device dependent pixel values.
41 \value Direct Pixel values are derived directly from the RGB
42 values, also known as "True Color."
44 \value Indexed Pixel values represent indexes into a vector of
45 available colors, i.e. QColormap uses the index of the color that
46 most closely matches an RGB value.
48 \value Gray Similar to \c Indexed, pixel values represent a vector
49 of available gray tones. QColormap uses the index of the gray
50 tone that most closely matches the computed gray tone of an RGB
55 \fn QColormap QColormap::instance(int screen)
57 Returns the colormap for the specified \a screen. If \a screen is
58 -1, this function returns the colormap for the default screen.
62 \fn QColormap::QColormap(const QColormap &colormap)
64 Constructs a copy of another \a colormap.
68 \fn QColormap::~QColormap()
70 Destroys the colormap.
74 \fn int QColormap::size() const
76 Returns the size of the colormap for \c Indexed and \c Gray modes;
77 Returns -1 for \c Direct mode.
83 \fn uint QColormap::pixel(const QColor &color) const
85 Returns a device dependent pixel value for the \a color.
91 \fn int QColormap::depth() const
93 Returns the depth of the device.
99 \fn QColormap::Mode QColormap::mode() const
101 Returns the mode of this colormap.
107 \fn const QColor QColormap::colorAt(uint pixel) const
109 Returns a QColor for the \a pixel.
115 \fn const QVector<QColor> QColormap::colormap() const
117 Returns a vector of colors which represents the devices colormap
118 for \c Indexed and \c Gray modes. This function returns an empty
119 vector for \c Direct mode.
124 /*! \fn HPALETTE QColormap::hPal()
126 This function is only available on Windows.
128 Returns an handle to the HPALETTE used by this colormap. If no
129 HPALETTE is being used, this function returns zero.
134 \fn QColormap &QColormap::operator=(const QColormap &colormap)
136 Assigns the given \a colormap to \e this color map and returns
137 a reference to \e this color map.
141 \fn void QColormap::initialize()
146 \fn void QColormap::cleanup()