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

#include <qdrawhelper_p.h>

Public Functions

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

Properties

quint8 data [3]
 

Friends

class qrgb666
 

Detailed Description

Definition at line 1209 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qargb6666() [1/5]

qargb6666::qargb6666 ( )
inline

Definition at line 1214 of file qdrawhelper_p.h.

1214 {}

◆ qargb6666() [2/5]

qargb6666::qargb6666 ( quint32  v)
inline

Definition at line 1215 of file qdrawhelper_p.h.

Referenced by qargb6666().

1215 { *this = qargb6666(quint32p(v)); }

◆ qargb6666() [3/5]

qargb6666::qargb6666 ( quint32p  v)
inlineexplicit

Definition at line 1330 of file qdrawhelper_p.h.

1331 {
1332  const quint8 b = qBlue(v) >> 2;
1333  const quint8 g = qGreen(v) >> 2;
1334  const quint8 r = qRed(v) >> 2;
1335  const quint8 a = qAlpha(v) >> 2;
1336  const uint p = (a << 18) | (r << 12) | (g << 6) | b;
1337  data[0] = qBlue(p);
1338  data[1] = qGreen(p);
1339  data[2] = qRed(p);
1340 }
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
Definition: qrgb.h:66
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned char quint8
Definition: qglobal.h:934
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
Definition: qrgb.h:57
unsigned int uint
Definition: qglobal.h:996
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

◆ qargb6666() [4/5]

qargb6666::qargb6666 ( const qargb6666 v)
inline

Definition at line 1342 of file qdrawhelper_p.h.

1343 {
1344  data[0] = v.data[0];
1345  data[1] = v.data[1];
1346  data[2] = v.data[2];
1347 }
quint8 data[3]

◆ qargb6666() [5/5]

qargb6666::qargb6666 ( const qrgb666 v)
inline

Definition at line 1349 of file qdrawhelper_p.h.

1350 {
1351  data[0] = v.data[0];
1352  data[1] = v.data[1];
1353  data[2] = (v.data[2] | 0xfc);
1354 }
quint8 data[3]
quint8 data[3]

Functions

◆ alpha() [1/2]

quint8 qargb6666::alpha ( ) const
inline

Definition at line 1377 of file qdrawhelper_p.h.

1378 {
1379  return (data[2] & 0xfc) | (data[2] >> 6);
1380 }
quint8 data[3]

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qargb6666::alpha ( quint8  a)
inline

Definition at line 1224 of file qdrawhelper_p.h.

1224 { return (a + 1) >> 2; }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ byte_mul()

qargb6666 qargb6666::byte_mul ( quint8  a) const
inline

Definition at line 1382 of file qdrawhelper_p.h.

1383 {
1384  const quint32 x = (data[2] << 16) | (data[1] << 8) | data[0];
1385  const quint32 t = ((((x & 0x03f03f) * a) >> 6) & 0x03f03f) |
1386  ((((x & 0xfc0fc0) * a) >> 6) & 0xfc0fc0);
1387 
1388  qargb6666 r;
1389  r.data[0] = t & 0xff;
1390  r.data[1] = (t >> 8) & 0xff;
1391  r.data[2] = (t >> 16) & 0xff;
1392  return r;
1393 }
long ASN1_INTEGER_get ASN1_INTEGER * a
quint8 data[3]
unsigned int quint32
Definition: qglobal.h:938

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qargb6666::hasAlpha ( )
inline

Definition at line 1212 of file qdrawhelper_p.h.

1212 { return true; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qargb6666::ialpha ( quint8  a)
inline

Definition at line 1225 of file qdrawhelper_p.h.

1225 { return (255 - a + 1) >> 2; }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ operator quint32()

qargb6666::operator quint32 ( ) const
inline

Definition at line 1356 of file qdrawhelper_p.h.

1357 {
1358  const quint8 r = (data[2] << 6) | ((data[1] & 0xf0) >> 2) | (data[2] & 0x3);
1359  const quint8 g = (data[1] << 4) | ((data[0] & 0xc0) >> 4) | ((data[1] & 0x0f) >> 2);
1360  const quint8 b = (data[0] << 2) | ((data[0] & 0x3f) >> 4);
1361  const quint8 a = (data[2] & 0xfc) | (data[2] >> 6);
1362  return qRgba(r, g, b, a);
1363 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned char quint8
Definition: qglobal.h:934
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
Definition: qrgb.h:72
quint8 data[3]

◆ operator+()

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

Definition at line 1365 of file qdrawhelper_p.h.

1366 {
1367  const quint32 x1 = (data[2] << 16) | (data[1] << 8) | data[0];
1368  const quint32 x2 = (v.data[2] << 16) | (v.data[1] << 8) | v.data[0];
1369  const quint32 t = x1 + x2;
1370  qargb6666 r;
1371  r.data[0] = t & 0xff;
1372  r.data[1] = (t >> 8) & 0xff;
1373  r.data[2] = (t >> 16) & 0xff;
1374  return r;
1375 }
quint8 data[3]
unsigned int quint32
Definition: qglobal.h:938

◆ operator==()

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

Definition at line 1395 of file qdrawhelper_p.h.

1396 {
1397  return data[0] == v.data[0]
1398  && data[1] == v.data[1]
1399  && data[2] == v.data[2];
1400 }
quint8 data[3]

◆ rawValue()

quint32 qargb6666::rawValue ( ) const
inline

Definition at line 1402 of file qdrawhelper_p.h.

1403 {
1404  return (data[2] << 16) | (data[1] << 8) | data[0];
1405 }
quint8 data[3]

◆ truncedAlpha()

qargb6666 qargb6666::truncedAlpha ( )
inline

Definition at line 1223 of file qdrawhelper_p.h.

1223 { return *this; }

Friends and Related Functions

◆ qrgb666

friend class qrgb666
friend

Definition at line 1234 of file qdrawhelper_p.h.

Properties

◆ data

quint8 qargb6666::data[3]
private

Definition at line 1235 of file qdrawhelper_p.h.

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


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