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

#include <qdrawhelper_p.h>

Public Functions

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

Properties

quint8 data [3]
 

Friends

class qrgb555
 

Detailed Description

Definition at line 981 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qargb8555() [1/5]

qargb8555::qargb8555 ( )
inline

Definition at line 986 of file qdrawhelper_p.h.

986 {}

◆ qargb8555() [2/5]

qargb8555::qargb8555 ( quint32  v)
inline

Definition at line 1121 of file qdrawhelper_p.h.

1122 {
1123  v = quint32p(v);
1124  data[0] = qAlpha(v);
1125  const int r = qRed(v);
1126  const int g = qGreen(v);
1127  const int b = qBlue(v);
1128  data[1] = ((g << 2) & 0xe0) | (b >> 3);
1129  data[2] = ((r >> 1) & 0x7c) | (g >> 6);
1130 
1131 }
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
Definition: qrgb.h:66
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
Definition: qrgb.h:57
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
Definition: qrgb.h:63
quint8 data[3]
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
Definition: qrgb.h:60

◆ qargb8555() [3/5]

qargb8555::qargb8555 ( quint32p  v)
inlineexplicit

Definition at line 1133 of file qdrawhelper_p.h.

1134 {
1135  data[0] = qAlpha(v);
1136  const int r = qRed(v);
1137  const int g = qGreen(v);
1138  const int b = qBlue(v);
1139  data[1] = ((g << 2) & 0xe0) | (b >> 3);
1140  data[2] = ((r >> 1) & 0x7c) | (g >> 6);
1141 }
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
Definition: qrgb.h:66
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
Definition: qrgb.h:57
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
Definition: qrgb.h:63
quint8 data[3]
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
Definition: qrgb.h:60

◆ qargb8555() [4/5]

qargb8555::qargb8555 ( const qargb8555 v)
inline

Definition at line 1143 of file qdrawhelper_p.h.

1144 {
1145  data[0] = v.data[0];
1146  data[1] = v.data[1];
1147  data[2] = v.data[2];
1148 }
quint8 data[3]

◆ qargb8555() [5/5]

qargb8555::qargb8555 ( const qrgb555 v)
inline

Definition at line 1150 of file qdrawhelper_p.h.

1151 {
1152  data[0] = 0xff;
1153  data[1] = v.data & 0xff;
1154  data[2] = v.data >> 8;
1155 }
quint16 data
quint8 data[3]

Functions

◆ alpha() [1/2]

quint8 qargb8555::alpha ( ) const
inline

Definition at line 994 of file qdrawhelper_p.h.

994 { return data[0]; }
quint8 data[3]

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qargb8555::alpha ( quint8  a)
inline

Definition at line 996 of file qdrawhelper_p.h.

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

◆ byte_mul()

qargb8555 qargb8555::byte_mul ( quint8  a) const
inline

Definition at line 1193 of file qdrawhelper_p.h.

1194 {
1195  qargb8555 result;
1196  result.data[0] = (data[0] * a) >> 5;
1197 
1198  const quint16 x = (data[2] << 8) | data[1];
1199  quint16 t = (((x & 0x3e0) * a) >> 5) & 0x03e0;
1200  t |= (((x & 0x7c1f) * a) >> 5) & 0x7c1f;
1201  result.data[1] = t & 0xff;
1202  result.data[2] = t >> 8;
1203  return result;
1204 
1205 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned short quint16
Definition: qglobal.h:936
quint8 data[3]

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qargb8555::hasAlpha ( )
inline

Definition at line 984 of file qdrawhelper_p.h.

984 { return true; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qargb8555::ialpha ( quint8  a)
inline

Definition at line 997 of file qdrawhelper_p.h.

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

◆ operator quint32()

qargb8555::operator quint32 ( ) const
inline

Definition at line 1157 of file qdrawhelper_p.h.

1158 {
1159  const quint16 rgb = (data[2] << 8) | data[1];
1160  const int r = (rgb & 0x7c00);
1161  const int g = (rgb & 0x03e0);
1162  const int b = (rgb & 0x001f);
1163  const int tr = (r >> 7) | (r >> 12);
1164  const int tg = (g >> 2) | (g >> 7);
1165  const int tb = (b << 3) | (b >> 2);
1166 
1167  return qRgba(tr, tg, tb, data[0]);
1168 }
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
Definition: qrgb.h:72
unsigned short quint16
Definition: qglobal.h:936
#define rgb(r, g, b)
Definition: qcolor_p.cpp:130
quint8 data[3]

◆ operator+()

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

Definition at line 1182 of file qdrawhelper_p.h.

1183 {
1184  qargb8555 t;
1185  t.data[0] = data[0] + v.data[0];
1186  const quint16 rgb = ((data[2] + v.data[2]) << 8)
1187  + (data[1] + v.data[1]);
1188  t.data[1] = rgb & 0xff;
1189  t.data[2] = rgb >> 8;
1190  return t;
1191 }
unsigned short quint16
Definition: qglobal.h:936
#define rgb(r, g, b)
Definition: qcolor_p.cpp:130
quint8 data[3]

◆ operator==()

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

Definition at line 1170 of file qdrawhelper_p.h.

1171 {
1172  return data[0] == v.data[0]
1173  && data[1] == v.data[1]
1174  && data[2] == v.data[2];
1175 }
quint8 data[3]

◆ rawValue()

quint32 qargb8555::rawValue ( ) const
inline

Definition at line 1177 of file qdrawhelper_p.h.

1178 {
1179  return (data[2] << 16) | (data[1] << 8) | data[0];
1180 }
quint8 data[3]

◆ truncedAlpha()

qargb8555 qargb8555::truncedAlpha ( )
inline

Definition at line 995 of file qdrawhelper_p.h.

995 { data[0] &= 0xf8; return *this; }
quint8 data[3]

Friends and Related Functions

◆ qrgb555

friend class qrgb555
friend

Definition at line 1007 of file qdrawhelper_p.h.

Properties

◆ data

quint8 qargb8555::data[3]
private

Definition at line 1008 of file qdrawhelper_p.h.

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


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