1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
6 \brief The QRgbaFloat struct contains a four part RGBA floating-point color.
12 \sa QRgb, QRgba64, QColor
16 \typealias QRgbaFloat::FastType
25 A 64-bit data-structure containing four 16-bit floating point color channels: Red, green, blue and alpha.
32 A 128-bit data-structure containing four 32-bit floating point color channels: Red, green, blue and alpha.
36 \fn template<typename F> QRgbaFloat<F>::fromRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
38 Constructs a QRgbaFloat value from the four 16-bit integer color channels \a red, \a green, \a blue and \a alpha.
44 \fn template<typename F> QRgbaFloat<F>::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
46 Constructs a QRgbaFloat value from the four 8-bit color channels \a red, \a green, \a blue and \a alpha.
52 \fn template<typename F> QRgbaFloat<F>::fromArgb32(uint rgb)
54 Constructs a QRgbaFloat value from the 32bit ARGB value \a rgb.
56 \sa fromRgba(), toArgb32()
60 \fn template<typename F> bool QRgbaFloat<F>::isOpaque() const
62 Returns whether the color is fully opaque.
64 \sa isTransparent(), alpha()
68 \fn template<typename F> bool QRgbaFloat<F>::isTransparent() const
70 Returns whether the color is fully transparent.
72 \sa isOpaque(), alpha()
76 \fn template<typename F> float QRgbaFloat<F>::red() const
78 Returns the red color component.
84 \fn template<typename F> void QRgbaFloat<F>::setRed(QRgbaFloat::FastType red)
86 Sets the red color component of this color to \a red.
92 \fn template<typename F> float QRgbaFloat<F>::green() const
94 Returns the green color component.
100 \fn template<typename F> void QRgbaFloat<F>::setGreen(QRgbaFloat::FastType green)
102 Sets the green color component of this color to \a green.
108 \fn template<typename F> float QRgbaFloat<F>::blue() const
110 Returns the blue color component.
116 \fn template<typename F> void QRgbaFloat<F>::setBlue(QRgbaFloat::FastType blue)
118 Sets the blue color component of this color to \a blue.
124 \fn template<typename F> float QRgbaFloat<F>::alpha() const
126 Returns the alpha channel.
132 \fn template<typename F> void QRgbaFloat<F>::setAlpha(QRgbaFloat::FastType alpha)
134 Sets the alpha of this color to \a alpha.
140 \fn template<typename F> float QRgbaFloat<F>::redNormalized() const
142 Returns the red color component normalized to values between \c 0.0f and \c 1.0f.
148 \fn template<typename F> float QRgbaFloat<F>::greenNormalized() const
150 Returns the green color component normalized to values between \c 0.0f and \c 1.0f.
156 \fn template<typename F> float QRgbaFloat<F>::blueNormalized() const
158 Returns the blue color component normalized to values between \c 0.0f and \c 1.0f.
164 \fn template<typename F> float QRgbaFloat<F>::alphaNormalized() const
166 Returns the alpha channel normalized to values between \c 0.0f and \c 1.0f.
172 \fn template<typename F> quint8 QRgbaFloat<F>::red8() const
174 Returns the red color component as an 8-bit.
178 \fn template<typename F> quint8 QRgbaFloat<F>::green8() const
180 Returns the green color component as an 8-bit.
184 \fn template<typename F> quint8 QRgbaFloat<F>::blue8() const
186 Returns the blue color component as an 8-bit.
190 \fn template<typename F> quint8 QRgbaFloat<F>::alpha8() const
192 Returns the alpha channel as an 8-bit.
196 \fn template<typename F> uint QRgbaFloat<F>::toArgb32() const
198 Returns the color as a 32-bit ARGB value.
204 \fn template<typename F> quint16 QRgbaFloat<F>::red16() const
206 Returns the red color component as a 16-bit integer.
210 \fn template<typename F> quint16 QRgbaFloat<F>::green16() const
212 Returns the green color component as a 16-bit integer.
216 \fn template<typename F> quint16 QRgbaFloat<F>::blue16() const
218 Returns the blue color component as a 16-bit integer.
222 \fn template<typename F> quint16 QRgbaFloat<F>::alpha16() const
224 Returns the alpha channel as a 16-bit integer.
228 \fn template<typename F> QRgbaFloat QRgbaFloat<F>::premultiplied() const
230 Returns the color with the alpha premultiplied.
232 \sa unpremultiplied()
236 \fn template<typename F> QRgbaFloat QRgbaFloat<F>::unpremultiplied() const
238 Returns the color with the alpha unpremultiplied.