43 #include <QtGui/qtguiglobal.h>
44 #include <QtCore/qprocessordetection.h>
54 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
88 rgb64.rgba |= rgb64.rgba << 8;
99 return (rgba & alphaMask()) == alphaMask();
103 return (rgba & alphaMask()) == 0;
125 br = (br - ((br >> 8) &
Q_UINT64_C(0xffff0000ffff))) >> 8;
126 ag = (ag - ((ag >> 8) &
Q_UINT64_C(0xffff0000ffff)));
127 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
128 return ((br << 24) & 0xff000000)
129 | ((ag >> 24) & 0xff0000)
130 | ((br >> 24) & 0xff00)
131 | ((ag >> 8) & 0xff);
133 return ((ag >> 16) & 0xff000000)
134 | ((br << 16) & 0xff0000)
136 | ((br >> 32) & 0xff);
155 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
168 #if Q_PROCESSOR_WORDSIZE < 8
169 return unpremultiplied_32bit();
171 return unpremultiplied_64bit();
187 static constexpr Q_ALWAYS_INLINE
quint64 alphaMask() {
return Q_UINT64_C(0xffff) << AlphaShift; }
189 static constexpr Q_ALWAYS_INLINE
quint8 div_257_floor(
uint x) {
return quint8((
x - (
x >> 8)) >> 8); }
190 static constexpr Q_ALWAYS_INLINE
quint8 div_257(
quint16 x) {
return div_257_floor(
x + 128U); }
191 constexpr Q_ALWAYS_INLINE
QRgba64 unpremultiplied_32bit()
const
201 constexpr Q_ALWAYS_INLINE
QRgba64 unpremultiplied_64bit()
const
228 return c.premultiplied();
233 return c.unpremultiplied();
237 {
return rgb.red8(); }
240 {
return rgb.green8(); }
243 {
return rgb.blue8(); }
246 {
return rgb.alpha8(); }
QRgb qUnpremultiply(QRgb rgb)
QRgb qPremultiply(QRgb rgb)
constexpr static QRgba64 fromArgb32(uint rgb)
constexpr ushort toRgb16() const
constexpr quint16 red() const
constexpr quint8 blue8() const
constexpr quint16 alpha() const
constexpr QRgba64 unpremultiplied() const
constexpr quint16 green() const
constexpr static QRgba64 fromRgba64(quint64 c)
constexpr quint16 blue() const
void setAlpha(quint16 _alpha)
QRgba64 & operator=(quint64 _rgba) noexcept
constexpr uint toArgb32() const
constexpr quint8 red8() const
constexpr static QRgba64 fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
constexpr bool isOpaque() const
constexpr quint8 green8() const
constexpr quint8 alpha8() const
void setGreen(quint16 _green)
void setBlue(quint16 _blue)
void setRed(quint16 _red)
constexpr static QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
constexpr bool isTransparent() const
constexpr QRgba64 premultiplied() const
unsigned long long quint64
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLfloat GLfloat GLfloat alpha
constexpr QRgba64 qRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
Q_DECLARE_TYPEINFO(QRgba64, Q_PRIMITIVE_TYPE)