Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qrgbafloat.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \class QRgbaFloat
6 \brief The QRgbaFloat struct contains a four part RGBA floating-point color.
7 \since 6.2
8
9 \ingroup painting
10 \inmodule QtGui
11
12 QRgbaFloat is a template class where \a F specifies the floating-point type
13 used for the color components. Qt provides two type aliases: QRgbaFloat16
14 using 16-bit half-precision floats, and QRgbaFloat32 using 32-bit
15 single-precision floats.
16
17 \sa QRgb, QRgba64, QColor
18*/
19
20/*!
21 \typealias QRgbaFloat::FastType
22
23 Alias for \e float.
24*/
25
26/*!
27 \typedef QRgbaFloat16
28 \relates QRgbaFloat
29
30 A 64-bit data-structure containing four 16-bit floating point color channels: Red, green, blue and alpha.
31*/
32
33/*!
34 \typedef QRgbaFloat32
35 \relates QRgbaFloat
36
37 A 128-bit data-structure containing four 32-bit floating point color channels: Red, green, blue and alpha.
38*/
39
40/*!
41 \fn template<typename F> QRgbaFloat QRgbaFloat<F>::fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
42
43 Constructs a QRgbaFloat value from the four 16-bit integer color channels \a red, \a green, \a blue and \a alpha.
44
45 \sa fromRgba()
46*/
47
48/*!
49 \fn template<typename F> QRgbaFloat QRgbaFloat<F>::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
50
51 Constructs a QRgbaFloat value from the four 8-bit color channels \a red, \a green, \a blue and \a alpha.
52
53 \sa fromArgb32()
54*/
55
56/*!
57 \fn template<typename F> QRgbaFloat QRgbaFloat<F>::fromArgb32(uint rgb)
58
59 Constructs a QRgbaFloat value from the 32bit ARGB value \a rgb.
60
61 \sa fromRgba(), toArgb32()
62*/
63
64/*!
65 \fn template<typename F> bool QRgbaFloat<F>::isOpaque() const
66
67 Returns whether the color is fully opaque.
68
69 \sa isTransparent(), alpha()
70*/
71
72/*!
73 \fn template<typename F> bool QRgbaFloat<F>::isTransparent() const
74
75 Returns whether the color is fully transparent.
76
77 \sa isOpaque(), alpha()
78*/
79
80/*!
81 \fn template<typename F> float QRgbaFloat<F>::red() const
82
83 Returns the red color component.
84
85 \sa setRed()
86*/
87
88/*!
89 \fn template<typename F> void QRgbaFloat<F>::setRed(float red)
90
91 Sets the red color component of this color to \a red.
92
93 \sa red()
94*/
95
96/*!
97 \fn template<typename F> float QRgbaFloat<F>::green() const
98
99 Returns the green color component.
100
101 \sa setGreen()
102*/
103
104/*!
105 \fn template<typename F> void QRgbaFloat<F>::setGreen(float green)
106
107 Sets the green color component of this color to \a green.
108
109 \sa green()
110*/
111
112/*!
113 \fn template<typename F> float QRgbaFloat<F>::blue() const
114
115 Returns the blue color component.
116
117 \sa setBlue()
118*/
119
120/*!
121 \fn template<typename F> void QRgbaFloat<F>::setBlue(float blue)
122
123 Sets the blue color component of this color to \a blue.
124
125 \sa blue()
126*/
127
128/*!
129 \fn template<typename F> float QRgbaFloat<F>::alpha() const
130
131 Returns the alpha channel.
132
133 \sa setAlpha()
134*/
135
136/*!
137 \fn template<typename F> void QRgbaFloat<F>::setAlpha(float alpha)
138
139 Sets the alpha of this color to \a alpha.
140
141 \sa alpha()
142*/
143
144/*!
145 \fn template<typename F> float QRgbaFloat<F>::redNormalized() const
146
147 Returns the red color component normalized to values between \c 0.0f and \c 1.0f.
148
149 \sa setRed()
150*/
151
152/*!
153 \fn template<typename F> float QRgbaFloat<F>::greenNormalized() const
154
155 Returns the green color component normalized to values between \c 0.0f and \c 1.0f.
156
157 \sa setGreen()
158*/
159
160/*!
161 \fn template<typename F> float QRgbaFloat<F>::blueNormalized() const
162
163 Returns the blue color component normalized to values between \c 0.0f and \c 1.0f.
164
165 \sa setBlue()
166*/
167
168/*!
169 \fn template<typename F> float QRgbaFloat<F>::alphaNormalized() const
170
171 Returns the alpha channel normalized to values between \c 0.0f and \c 1.0f.
172
173 \sa alpha()
174*/
175
176/*!
177 \fn template<typename F> quint8 QRgbaFloat<F>::red8() const
178
179 Returns the red color component as an 8-bit.
180*/
181
182/*!
183 \fn template<typename F> quint8 QRgbaFloat<F>::green8() const
184
185 Returns the green color component as an 8-bit.
186*/
187
188/*!
189 \fn template<typename F> quint8 QRgbaFloat<F>::blue8() const
190
191 Returns the blue color component as an 8-bit.
192*/
193
194/*!
195 \fn template<typename F> quint8 QRgbaFloat<F>::alpha8() const
196
197 Returns the alpha channel as an 8-bit.
198*/
199
200/*!
201 \fn template<typename F> uint QRgbaFloat<F>::toArgb32() const
202
203 Returns the color as a 32-bit ARGB value.
204
205 \sa fromArgb32()
206*/
207
208/*!
209 \fn template<typename F> quint16 QRgbaFloat<F>::red16() const
210
211 Returns the red color component as a 16-bit integer.
212*/
213
214/*!
215 \fn template<typename F> quint16 QRgbaFloat<F>::green16() const
216
217 Returns the green color component as a 16-bit integer.
218*/
219
220/*!
221 \fn template<typename F> quint16 QRgbaFloat<F>::blue16() const
222
223 Returns the blue color component as a 16-bit integer.
224*/
225
226/*!
227 \fn template<typename F> quint16 QRgbaFloat<F>::alpha16() const
228
229 Returns the alpha channel as a 16-bit integer.
230*/
231
232/*!
233 \fn template<typename F> QRgbaFloat QRgbaFloat<F>::premultiplied() const
234
235 Returns the color with the alpha premultiplied.
236
237 \sa unpremultiplied()
238*/
239
240/*!
241 \fn template<typename F> QRgbaFloat QRgbaFloat<F>::unpremultiplied() const
242
243 Returns the color with the alpha unpremultiplied.
244
245 \sa premultiplied()
246*/