Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qcolormap.qdoc
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \class QColormap
6 \ingroup painting
7 \inmodule QtWidgets
8
9 \brief The QColormap class maps device independent QColors to device
10 dependent pixel values.
11*/
12
13/*! \enum QColormap::Mode
14
15 This enum describes how QColormap maps device independent RGB
16 values to device dependent pixel values.
17
18 \value Direct Pixel values are derived directly from the RGB
19 values, also known as "True Color."
20
21 \value Indexed Pixel values represent indexes into a list of
22 available colors, i.e. QColormap uses the index of the color that
23 most closely matches an RGB value.
24
25 \value Gray Similar to \c Indexed, pixel values represent a list
26 of available gray tones. QColormap uses the index of the gray
27 tone that most closely matches the computed gray tone of an RGB
28 value.
29*/
30
31/*!
32 \fn QColormap QColormap::instance(int screen)
33
34 Returns the colormap for the specified \a screen. If \a screen is
35 -1, this function returns the colormap for the default screen.
36*/
37
38/*!
39 \fn QColormap::QColormap(const QColormap &colormap)
40
41 Constructs a copy of another \a colormap.
42*/
43
44/*!
45 \fn QColormap::~QColormap()
46
47 Destroys the colormap.
48*/
49
50/*!
51 \fn int QColormap::size() const
52
53 Returns the size of the colormap for \c Indexed and \c Gray modes;
54 Returns -1 for \c Direct mode.
55
56 \sa colormap()
57*/
58
59/*!
60 \fn uint QColormap::pixel(const QColor &color) const
61
62 Returns a device dependent pixel value for the \a color.
63
64 \sa colorAt()
65*/
66
67/*!
68 \fn int QColormap::depth() const
69
70 Returns the depth of the device.
71
72 \sa size()
73*/
74
75/*!
76 \fn QColormap::Mode QColormap::mode() const
77
78 Returns the mode of this colormap.
79
80 \sa QColormap::Mode
81*/
82
83/*!
84 \fn const QColor QColormap::colorAt(uint pixel) const
85
86 Returns a QColor for the \a pixel.
87
88 \sa pixel()
89*/
90
91/*!
92 \fn const QList<QColor> QColormap::colormap() const
93
94 Returns a list of colors which represents the devices colormap
95 for \c Indexed and \c Gray modes. This function returns an empty
96 list for \c Direct mode.
97
98 \sa size()
99*/
100
101/*! \since 4.2
102
103 \fn QColormap &QColormap::operator=(const QColormap &colormap)
104
105 Assigns the given \a colormap to \e this color map and returns
106 a reference to \e this color map.
107*/
108
109/*!
110 \fn void QColormap::initialize()
111 \internal
112*/
113
114/*!
115 \fn void QColormap::cleanup()
116 \internal
117*/