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

#include <qdrawhelper_p.h>

Public Functions

quint8 alpha () const
 
Q_STATIC_INLINE_FUNCTION quint8 alpha (quint8 a)
 
qrgb444 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
 
bool operator!= (const qrgb444 &v) const
 
qrgb444 operator+ (qrgb444 v) const
 
bool operator== (const qrgb444 &v) const
 
 qrgb444 ()
 
 qrgb444 (quint32 v)
 
 qrgb444 (qargb4444 v)
 
quint16 rawValue () const
 
qrgb444 truncedAlpha ()
 

Properties

quint16 data
 

Friends

class qargb4444
 

Detailed Description

Definition at line 1627 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qrgb444() [1/3]

qrgb444::qrgb444 ( )
inline

Definition at line 1632 of file qdrawhelper_p.h.

1632 {}

◆ qrgb444() [2/3]

qrgb444::qrgb444 ( quint32  v)
inline

Definition at line 1712 of file qdrawhelper_p.h.

1713 {
1714  v &= 0xf0f0f0f0;
1715  const int r = qRed(v) << 4;
1716  const int g = qGreen(v);
1717  const int b = qBlue(v) >> 4;
1718 
1719  data = r | g | b;
1720 }
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
Definition: qrgb.h:57
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
Definition: qrgb.h:63
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
Definition: qrgb.h:60
quint16 data

◆ qrgb444() [3/3]

qrgb444::qrgb444 ( qargb4444  v)
inlineexplicit

Definition at line 1722 of file qdrawhelper_p.h.

1723 {
1724  data = v.data & 0x0fff;
1725 }
quint16 data
quint16 data

Functions

◆ alpha() [1/2]

quint8 qrgb444::alpha ( ) const
inline

Definition at line 1640 of file qdrawhelper_p.h.

1640 { return 0xff; }

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qrgb444::alpha ( quint8  a)
inline

Definition at line 1642 of file qdrawhelper_p.h.

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

◆ byte_mul()

qrgb444 qrgb444::byte_mul ( quint8  a) const
inline

Definition at line 1752 of file qdrawhelper_p.h.

1753 {
1754  quint16 t = (((data & 0xf0f0) * a) >> 4) & 0xf0f0;
1755  t |= (((data & 0x0f0f) * a) >> 4) & 0x0f0f;
1756 
1757  qrgb444 result;
1758  result.data = t;
1759  return result;
1760 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned short quint16
Definition: qglobal.h:936
quint16 data

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qrgb444::hasAlpha ( )
inline

Definition at line 1630 of file qdrawhelper_p.h.

1630 { return false; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qrgb444::ialpha ( quint8  a)
inline

Definition at line 1643 of file qdrawhelper_p.h.

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

◆ operator quint32()

qrgb444::operator quint32 ( ) const
inline

Definition at line 1727 of file qdrawhelper_p.h.

1728 {
1729  const int r = (data & 0x0f00);
1730  const int g = (data & 0x00f0);
1731  const int b = (data & 0x000f);
1732  const int tr = (r >> 4) | (r >> 8);
1733  const int tg = g | (g >> 4);
1734  const int tb = (b << 4) | b;
1735 
1736  return qRgb(tr, tg, tb);
1737 }
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
Definition: qrgb.h:69
quint16 data

◆ operator quint8()

qrgb444::operator quint8 ( ) const
inline

Definition at line 1739 of file qdrawhelper_p.h.

1740 {
1741  // hw: optimize!
1742  return qt_colorConvert<quint8, quint32>(operator quint32(), 0);
1743 }
unsigned int quint32
Definition: qglobal.h:938

◆ operator!=()

bool qrgb444::operator!= ( const qrgb444 v) const
inline

Definition at line 1647 of file qdrawhelper_p.h.

1647 { return data != v.data; }
quint16 data

◆ operator+()

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

Definition at line 1745 of file qdrawhelper_p.h.

1746 {
1747  qrgb444 t;
1748  t.data = data + v.data;
1749  return t;
1750 }
quint16 data

◆ operator==()

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

Definition at line 1646 of file qdrawhelper_p.h.

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

◆ rawValue()

quint16 qrgb444::rawValue ( ) const
inline

Definition at line 1649 of file qdrawhelper_p.h.

Referenced by interpolate_pixel().

1649 { return data; }
quint16 data

◆ truncedAlpha()

qrgb444 qrgb444::truncedAlpha ( )
inline

Definition at line 1641 of file qdrawhelper_p.h.

1641 { return *this; }

Friends and Related Functions

◆ qargb4444

friend class qargb4444
friend

Definition at line 1652 of file qdrawhelper_p.h.

Properties

◆ data

quint16 qrgb444::data
private

Definition at line 1653 of file qdrawhelper_p.h.

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


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