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

#include <qdrawhelper_p.h>

Public Functions

quint8 alpha () const
 
Q_STATIC_INLINE_FUNCTION quint8 alpha (quint8 a)
 
qrgb565 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
 
qrgb565 operator+ (qrgb565 v) const
 
bool operator== (const qrgb565 &v) const
 
 qrgb565 (int v=0)
 
 qrgb565 (quint32p v)
 
 qrgb565 (quint32 v)
 
 qrgb565 (const qargb8565 &v)
 
quint16 rawValue () const
 
qrgb565 truncedAlpha ()
 

Properties

quint16 data
 

Friends

class qargb8565
 

Detailed Description

Definition at line 785 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qrgb565() [1/4]

qrgb565::qrgb565 ( int  v = 0)
inline

Definition at line 790 of file qdrawhelper_p.h.

790 : data(v) {}
quint16 data

◆ qrgb565() [2/4]

qrgb565::qrgb565 ( quint32p  v)
inlineexplicit

Definition at line 905 of file qdrawhelper_p.h.

906 {
907  *this = qrgb565(quint32(v));
908 }
qrgb565(int v=0)
unsigned int quint32
Definition: qglobal.h:938

◆ qrgb565() [3/4]

qrgb565::qrgb565 ( quint32  v)
inlineexplicit

Definition at line 910 of file qdrawhelper_p.h.

911 {
912  const int r = qRed(v) << 8;
913  const int g = qGreen(v) << 3;
914  const int b = qBlue(v) >> 3;
915 
916  data = (r & 0xf800) | (g & 0x07e0)| (b & 0x001f);
917 }
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

◆ qrgb565() [4/4]

qrgb565::qrgb565 ( const qargb8565 v)
inlineexplicit

Definition at line 919 of file qdrawhelper_p.h.

920 {
921  data = (v.data[2] << 8) | v.data[1];
922 }
quint8 data[3]
quint16 data

Functions

◆ alpha() [1/2]

quint8 qrgb565::alpha ( ) const
inline

Definition at line 801 of file qdrawhelper_p.h.

801 { return 0xff; }

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qrgb565::alpha ( quint8  a)
inline

Definition at line 803 of file qdrawhelper_p.h.

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

◆ byte_mul()

qrgb565 qrgb565::byte_mul ( quint8  a) const
inline

Definition at line 947 of file qdrawhelper_p.h.

948 {
949  qrgb565 result;
950  result.data = ((((data & 0x07e0) >> 5) * a) & 0x07e0) |
951  ((((data & 0xf81f) * a) >> 5) & 0xf81f);
952  return result;
953 }
long ASN1_INTEGER_get ASN1_INTEGER * a
quint16 data

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qrgb565::hasAlpha ( )
inline

Definition at line 788 of file qdrawhelper_p.h.

788 { return false; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qrgb565::ialpha ( quint8  a)
inline

Definition at line 804 of file qdrawhelper_p.h.

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

◆ operator quint16()

qrgb565::operator quint16 ( ) const
inline

Definition at line 935 of file qdrawhelper_p.h.

936 {
937  return data;
938 }
quint16 data

◆ operator quint32()

qrgb565::operator quint32 ( ) const
inline

Definition at line 924 of file qdrawhelper_p.h.

925 {
926  const int r = (data & 0xf800);
927  const int g = (data & 0x07e0);
928  const int b = (data & 0x001f);
929  const int tr = (r >> 8) | (r >> 13);
930  const int tg = (g >> 3) | (g >> 9);
931  const int tb = (b << 3) | (b >> 2);
932  return qRgb(tr, tg, tb);
933 }
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
Definition: qrgb.h:69
quint16 data

◆ operator+()

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

Definition at line 940 of file qdrawhelper_p.h.

941 {
942  qrgb565 t;
943  t.data = data + v.data;
944  return t;
945 }
quint16 data

◆ operator==()

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

Definition at line 955 of file qdrawhelper_p.h.

956 {
957  return data == v.data;
958 }
quint16 data

◆ rawValue()

quint16 qrgb565::rawValue ( ) const
inline

Definition at line 809 of file qdrawhelper_p.h.

Referenced by interpolate_pixel().

809 { return data; }
quint16 data

◆ truncedAlpha()

qrgb565 qrgb565::truncedAlpha ( )
inline

Definition at line 802 of file qdrawhelper_p.h.

802 { return *this; }

Friends and Related Functions

◆ qargb8565

friend class qargb8565
friend

Definition at line 812 of file qdrawhelper_p.h.

Properties

◆ data

quint16 qrgb565::data
private

Definition at line 814 of file qdrawhelper_p.h.

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


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