Qt 4.8
Public Functions | Properties | List of all members
qrgb888 Class Reference

#include <qdrawhelper_p.h>

Public Functions

quint8 alpha () const
 
Q_STATIC_INLINE_FUNCTION quint8 alpha (quint8 a)
 
qrgb888 byte_mul (quint8 a) const
 
Q_STATIC_INLINE_FUNCTION bool hasAlpha ()
 
Q_STATIC_INLINE_FUNCTION quint8 ialpha (quint8 a)
 
 operator quint32 () const
 
qrgb888 operator+ (qrgb888 v) const
 
bool operator== (qrgb888 v) const
 
 qrgb888 ()
 
 qrgb888 (quint32 v)
 
quint32 rawValue () const
 
qrgb888 truncedAlpha ()
 

Properties

uchar data [3]
 

Detailed Description

Definition at line 1407 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qrgb888() [1/2]

qrgb888::qrgb888 ( )
inline

Definition at line 1412 of file qdrawhelper_p.h.

1412 {}

◆ qrgb888() [2/2]

qrgb888::qrgb888 ( quint32  v)
inline

Definition at line 1433 of file qdrawhelper_p.h.

1434 {
1435  data[0] = qRed(v);
1436  data[1] = qGreen(v);
1437  data[2] = qBlue(v);
1438 }
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
Definition: qrgb.h:57
uchar data[3]
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
Definition: qrgb.h:63
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
Definition: qrgb.h:60

Functions

◆ alpha() [1/2]

quint8 qrgb888::alpha ( ) const
inline

Definition at line 1417 of file qdrawhelper_p.h.

1417 { return 0xff; }

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qrgb888::alpha ( quint8  a)
inline

Definition at line 1419 of file qdrawhelper_p.h.

1419 { return a; }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ byte_mul()

qrgb888 qrgb888::byte_mul ( quint8  a) const
inline

Definition at line 1454 of file qdrawhelper_p.h.

1455 {
1456  quint32 x(*this);
1457 
1458  quint32 t = (x & 0xff00ff) * a;
1459  t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8;
1460  t &= 0xff00ff;
1461 
1462  x = ((x >> 8) & 0xff00ff) * a;
1463  x = (x + ((x >> 8) & 0xff00ff) + 0x800080);
1464  x &= 0xff00ff00;
1465  x |= t;
1466  return qrgb888(x);
1467 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned int quint32
Definition: qglobal.h:938

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qrgb888::hasAlpha ( )
inline

Definition at line 1410 of file qdrawhelper_p.h.

1410 { return false; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qrgb888::ialpha ( quint8  a)
inline

Definition at line 1420 of file qdrawhelper_p.h.

1420 { return 255 - a; }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ operator quint32()

qrgb888::operator quint32 ( ) const
inline

Definition at line 1440 of file qdrawhelper_p.h.

1441 {
1442  return qRgb(data[0], data[1], data[2]);
1443 }
uchar data[3]
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
Definition: qrgb.h:69

◆ operator+()

qrgb888 qrgb888::operator+ ( qrgb888  v) const
inline

Definition at line 1445 of file qdrawhelper_p.h.

1446 {
1447  qrgb888 t = *this;
1448  t.data[0] += v.data[0];
1449  t.data[1] += v.data[1];
1450  t.data[2] += v.data[2];
1451  return t;
1452 }
uchar data[3]

◆ operator==()

bool qrgb888::operator== ( qrgb888  v) const
inline

Definition at line 1469 of file qdrawhelper_p.h.

1470 {
1471  return (data[0] == v.data[0] &&
1472  data[1] == v.data[1] &&
1473  data[2] == v.data[2]);
1474 }
uchar data[3]

◆ rawValue()

quint32 qrgb888::rawValue ( ) const
inline

Definition at line 1476 of file qdrawhelper_p.h.

1477 {
1478  return (data[2] << 16) | (data[1] << 8) | data[0];
1479 }
uchar data[3]

◆ truncedAlpha()

qrgb888 qrgb888::truncedAlpha ( )
inline

Definition at line 1418 of file qdrawhelper_p.h.

1418 { return *this; }

Properties

◆ data

uchar qrgb888::data[3]
private

Definition at line 1429 of file qdrawhelper_p.h.

Referenced by operator+(), and operator==().


The documentation for this class was generated from the following file: