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

#include <qdrawhelper_p.h>

Public Functions

quint8 alpha () const
 
Q_STATIC_INLINE_FUNCTION quint8 alpha (quint8 a)
 
qargb4444 byte_mul (quint8 a) const
 
Q_STATIC_INLINE_FUNCTION bool hasAlpha ()
 
Q_STATIC_INLINE_FUNCTION quint8 ialpha (quint8 a)
 
 operator quint32 () const
 
 operator quint8 () const
 
qargb4444 operator+ (qargb4444 v) const
 
bool operator== (const qargb4444 &v) const
 
 qargb4444 ()
 
 qargb4444 (quint32 v)
 
 qargb4444 (quint32p v)
 
 qargb4444 (const qrgb444 &v)
 
quint16 rawValue () const
 
qargb4444 truncedAlpha ()
 

Properties

quint16 data
 

Friends

class qrgb444
 

Detailed Description

Definition at line 1596 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qargb4444() [1/4]

qargb4444::qargb4444 ( )
inline

Definition at line 1601 of file qdrawhelper_p.h.

1601 {}

◆ qargb4444() [2/4]

qargb4444::qargb4444 ( quint32  v)
inline

Definition at line 1602 of file qdrawhelper_p.h.

Referenced by qargb4444().

1602 { *this = qargb4444(quint32p(v)); }

◆ qargb4444() [3/4]

qargb4444::qargb4444 ( quint32p  v)
inlineexplicit

Definition at line 1658 of file qdrawhelper_p.h.

1659 {
1660  quint32 v = color;
1661  v &= 0xf0f0f0f0;
1662  const int a = qAlpha(v) << 8;
1663  const int r = qRed(v) << 4;
1664  const int g = qGreen(v);
1665  const int b = qBlue(v) >> 4;
1666 
1667  data = a | r | g | b;
1668 }
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
Definition: qrgb.h:66
quint16 data
long ASN1_INTEGER_get ASN1_INTEGER * a
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
Definition: qrgb.h:57
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
Definition: qrgb.h:63
unsigned int quint32
Definition: qglobal.h:938
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
Definition: qrgb.h:60

◆ qargb4444() [4/4]

qargb4444::qargb4444 ( const qrgb444 v)
inline

Definition at line 1670 of file qdrawhelper_p.h.

1671 {
1672  data = v.data | 0xf000;
1673 }
quint16 data
quint16 data

Functions

◆ alpha() [1/2]

quint8 qargb4444::alpha ( ) const
inline

Definition at line 1611 of file qdrawhelper_p.h.

1611 { return ((data & 0xf000) >> 8) | ((data & 0xf000) >> 12); }
quint16 data

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qargb4444::alpha ( quint8  a)
inline

Definition at line 1613 of file qdrawhelper_p.h.

1613 { return (a + 1) >> 4; }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ byte_mul()

qargb4444 qargb4444::byte_mul ( quint8  a) const
inline

Definition at line 1702 of file qdrawhelper_p.h.

1703 {
1704  quint16 t = (((data & 0xf0f0) * a) >> 4) & 0xf0f0;
1705  t |= (((data & 0x0f0f) * a) >> 4) & 0x0f0f;
1706 
1707  qargb4444 result;
1708  result.data = t;
1709  return result;
1710 }
quint16 data
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned short quint16
Definition: qglobal.h:936

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qargb4444::hasAlpha ( )
inline

Definition at line 1599 of file qdrawhelper_p.h.

1599 { return true; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qargb4444::ialpha ( quint8  a)
inline

Definition at line 1614 of file qdrawhelper_p.h.

1614 { return 0x10 - alpha(a); }
quint8 alpha() const
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ operator quint32()

qargb4444::operator quint32 ( ) const
inline

Definition at line 1675 of file qdrawhelper_p.h.

1676 {
1677  const int a = (data & 0xf000);
1678  const int r = (data & 0x0f00);
1679  const int g = (data & 0x00f0);
1680  const int b = (data & 0x000f);
1681  const int ta = (a >> 8) | (a >> 12);
1682  const int tr = (r >> 4) | (r >> 8);
1683  const int tg = g | (g >> 4);
1684  const int tb = (b << 4) | b;
1685 
1686  return qRgba(tr, tg, tb, ta);
1687 }
quint16 data
long ASN1_INTEGER_get ASN1_INTEGER * a
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
Definition: qrgb.h:72

◆ operator quint8()

qargb4444::operator quint8 ( ) const
inline

Definition at line 1689 of file qdrawhelper_p.h.

1690 {
1691  // hw: optimize!
1692  return qt_colorConvert<quint8, quint32>(operator quint32(), 0);
1693 }
unsigned int quint32
Definition: qglobal.h:938

◆ operator+()

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

Definition at line 1695 of file qdrawhelper_p.h.

1696 {
1697  qargb4444 t;
1698  t.data = data + v.data;
1699  return t;
1700 }
quint16 data

◆ operator==()

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

Definition at line 1617 of file qdrawhelper_p.h.

1617 { return data == v.data; }
quint16 data

◆ rawValue()

quint16 qargb4444::rawValue ( ) const
inline

Definition at line 1619 of file qdrawhelper_p.h.

1619 { return data; }
quint16 data

◆ truncedAlpha()

qargb4444 qargb4444::truncedAlpha ( )
inline

Definition at line 1612 of file qdrawhelper_p.h.

1612 { return *this; }

Friends and Related Functions

◆ qrgb444

friend class qrgb444
friend

Definition at line 1622 of file qdrawhelper_p.h.

Properties

◆ data

quint16 qargb4444::data
private

Definition at line 1623 of file qdrawhelper_p.h.

Referenced by byte_mul(), operator+(), operator==(), and qrgb444::qrgb444().


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