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

#include <qdrawhelper_p.h>

Public Functions

quint8 alpha () const
 
Q_STATIC_INLINE_FUNCTION quint8 alpha (quint8 a)
 
qrgb555 byte_mul (quint8 a) const
 
Q_STATIC_INLINE_FUNCTION bool hasAlpha ()
 
Q_STATIC_INLINE_FUNCTION quint8 ialpha (quint8 a)
 
 operator quint16 () const
 
 operator quint32 () const
 
bool operator!= (const qrgb555 &v) const
 
qrgb555 operator+ (qrgb555 v) const
 
bool operator== (const qrgb555 &v) const
 
 qrgb555 (int v=0)
 
 qrgb555 (quint32p v)
 
 qrgb555 (quint32 v)
 
 qrgb555 (quint16 v)
 
 qrgb555 (const qargb8555 &v)
 
quint16 rawValue () const
 
qrgb555 truncedAlpha ()
 

Properties

quint16 data
 

Friends

class qargb8555
 
class qbgr555
 

Detailed Description

Definition at line 1011 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qrgb555() [1/5]

qrgb555::qrgb555 ( int  v = 0)
inline

Definition at line 1016 of file qdrawhelper_p.h.

1016 : data(v) {}
quint16 data

◆ qrgb555() [2/5]

qrgb555::qrgb555 ( quint32p  v)
inlineexplicit

Definition at line 1018 of file qdrawhelper_p.h.

Referenced by qrgb555().

1018 { *this = qrgb555(quint32(v)); }
qrgb555(int v=0)
unsigned int quint32
Definition: qglobal.h:938

◆ qrgb555() [3/5]

qrgb555::qrgb555 ( quint32  v)
inlineexplicit

Definition at line 1020 of file qdrawhelper_p.h.

1021  {
1022  const int r = qRed(v) << 7;
1023  const int g = qGreen(v) << 2;
1024  const int b = qBlue(v) >> 3;
1025 
1026  data = (r & 0x7c00) | (g & 0x03e0) | (b & 0x001f);
1027  }
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
Definition: qrgb.h:57
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
Definition: qrgb.h:63
quint16 data
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
Definition: qrgb.h:60

◆ qrgb555() [4/5]

qrgb555::qrgb555 ( quint16  v)
inlineexplicit

Definition at line 1029 of file qdrawhelper_p.h.

1030  {
1031  data = ((v >> 1) & (0x7c00 | 0x03e0)) |
1032  (v & 0x001f);
1033  }
quint16 data

◆ qrgb555() [5/5]

qrgb555::qrgb555 ( const qargb8555 v)
inlineexplicit

Definition at line 1078 of file qdrawhelper_p.h.

1079 {
1080  data = (v.data[2] << 8) | v.data[1];
1081 }
quint16 data
quint8 data[3]

Functions

◆ alpha() [1/2]

quint8 qrgb555::alpha ( ) const
inline

Definition at line 1061 of file qdrawhelper_p.h.

1061 { return 0xff; }

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qrgb555::alpha ( quint8  a)
inline

Definition at line 1063 of file qdrawhelper_p.h.

1063 { return (a + 1) >> 3; }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ byte_mul()

qrgb555 qrgb555::byte_mul ( quint8  a) const
inline

Definition at line 1090 of file qdrawhelper_p.h.

1091 {
1092  quint16 t = (((data & 0x3e0) * a) >> 5) & 0x03e0;
1093  t |= (((data & 0x7c1f) * a) >> 5) & 0x7c1f;
1094 
1095  qrgb555 result;
1096  result.data = t;
1097  return result;
1098 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned short quint16
Definition: qglobal.h:936
quint16 data

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qrgb555::hasAlpha ( )
inline

Definition at line 1014 of file qdrawhelper_p.h.

1014 { return false; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qrgb555::ialpha ( quint8  a)
inline

Definition at line 1064 of file qdrawhelper_p.h.

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

◆ operator quint16()

qrgb555::operator quint16 ( ) const
inline

Definition at line 1049 of file qdrawhelper_p.h.

1050  {
1051  const int r = ((data & 0x7c00) << 1) & 0xf800;
1052  const int g = (((data & 0x03e0) << 1) | ((data >> 4) & 0x0020)) & 0x07e0;
1053  const int b = (data & 0x001f);
1054 
1055  return r | g | b;
1056  }
quint16 data

◆ operator quint32()

qrgb555::operator quint32 ( ) const
inline

Definition at line 1037 of file qdrawhelper_p.h.

1038  {
1039  const int r = (data & 0x7c00);
1040  const int g = (data & 0x03e0);
1041  const int b = (data & 0x001f);
1042  const int tr = (r >> 7) | (r >> 12);
1043  const int tg = (g >> 2) | (g >> 7);
1044  const int tb = (b << 3) | (b >> 2);
1045 
1046  return qRgb(tr, tg, tb);
1047  }
quint16 data
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
Definition: qrgb.h:69

◆ operator!=()

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

Definition at line 1067 of file qdrawhelper_p.h.

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

◆ operator+()

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

Definition at line 1083 of file qdrawhelper_p.h.

1084 {
1085  qrgb555 t;
1086  t.data = data + v.data;
1087  return t;
1088 }
quint16 data

◆ operator==()

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

Definition at line 1066 of file qdrawhelper_p.h.

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

◆ rawValue()

quint16 qrgb555::rawValue ( ) const
inline

Definition at line 1069 of file qdrawhelper_p.h.

Referenced by interpolate_pixel().

1069 { return data; }
quint16 data

◆ truncedAlpha()

qrgb555 qrgb555::truncedAlpha ( )
inline

Definition at line 1062 of file qdrawhelper_p.h.

1062 { return *this; }

Friends and Related Functions

◆ qargb8555

friend class qargb8555
friend

Definition at line 1072 of file qdrawhelper_p.h.

◆ qbgr555

friend class qbgr555
friend

Definition at line 1073 of file qdrawhelper_p.h.

Properties

◆ data

quint16 qrgb555::data
private

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