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

#include <qdrawhelper_p.h>

Public Functions

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

Properties

quint8 data [3]
 

Friends

class qrgb565
 

Detailed Description

Definition at line 749 of file qdrawhelper_p.h.

Constructors and Destructors

◆ qargb8565() [1/5]

qargb8565::qargb8565 ( )
inline

Definition at line 754 of file qdrawhelper_p.h.

Referenced by qargb8565().

754 {}

◆ qargb8565() [2/5]

qargb8565::qargb8565 ( quint32  v)
inline

Definition at line 817 of file qdrawhelper_p.h.

818 {
819  *this = qargb8565(quint32p(v));
820 }

◆ qargb8565() [3/5]

qargb8565::qargb8565 ( quint32p  v)
inlineexplicit

Definition at line 822 of file qdrawhelper_p.h.

823 {
824  data[0] = qAlpha(v);
825  const int r = qRed(v);
826  const int g = qGreen(v);
827  const int b = qBlue(v);
828  data[1] = ((g << 3) & 0xe0) | (b >> 3);
829  data[2] = (r & 0xf8) | (g >> 5);
830 }
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

◆ qargb8565() [4/5]

qargb8565::qargb8565 ( const qargb8565 v)
inline

Definition at line 832 of file qdrawhelper_p.h.

833 {
834  data[0] = v.data[0];
835  data[1] = v.data[1];
836  data[2] = v.data[2];
837 }
quint8 data[3]

◆ qargb8565() [5/5]

qargb8565::qargb8565 ( const qrgb565 v)
inline

Definition at line 839 of file qdrawhelper_p.h.

840 {
841  data[0] = 0xff;
842  data[1] = v.data & 0xff;
843  data[2] = v.data >> 8;
844 }
quint8 data[3]
quint16 data

Functions

◆ alpha() [1/2]

quint8 qargb8565::alpha ( ) const
inline

Definition at line 763 of file qdrawhelper_p.h.

Referenced by Blend_ARGB24_on_RGB16_SourceAlpha::write(), and Blend_ARGB24_on_RGB16_SourceAndConstAlpha::write().

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

◆ alpha() [2/2]

Q_STATIC_INLINE_FUNCTION quint8 qargb8565::alpha ( quint8  a)
inline

Definition at line 769 of file qdrawhelper_p.h.

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

◆ byte_mul()

qargb8565 qargb8565::byte_mul ( quint8  a) const
inline

Definition at line 875 of file qdrawhelper_p.h.

Referenced by Blend_ARGB24_on_RGB16_SourceAndConstAlpha::write().

876 {
877  qargb8565 result;
878  result.data[0] = (data[0] * a) >> 5;
879 
880  const quint16 x = (data[2] << 8) | data[1];
881  const quint16 t = ((((x & 0x07e0) >> 5) * a) & 0x07e0) |
882  ((((x & 0xf81f) * a) >> 5) & 0xf81f);
883  result.data[1] = t & 0xff;
884  result.data[2] = t >> 8;
885  return result;
886 }
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned short quint16
Definition: qglobal.h:936
quint8 data[3]

◆ hasAlpha()

Q_STATIC_INLINE_FUNCTION bool qargb8565::hasAlpha ( )
inline

Definition at line 752 of file qdrawhelper_p.h.

752 { return true; }

◆ ialpha()

Q_STATIC_INLINE_FUNCTION quint8 qargb8565::ialpha ( quint8  a)
inline

Definition at line 770 of file qdrawhelper_p.h.

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

◆ operator quint16()

qargb8565::operator quint16 ( ) const
inline

Definition at line 859 of file qdrawhelper_p.h.

860 {
861  return (data[2] << 8) | data[1];
862 }
quint8 data[3]

◆ operator quint32()

qargb8565::operator quint32 ( ) const
inline

Definition at line 846 of file qdrawhelper_p.h.

847 {
848  const quint16 rgb = (data[2] << 8) | data[1];
849  const int a = data[0];
850  const int r = (rgb & 0xf800);
851  const int g = (rgb & 0x07e0);
852  const int b = (rgb & 0x001f);
853  const int tr = qMin(a, (r >> 8) | (r >> 13));
854  const int tg = qMin(a, (g >> 3) | (g >> 9));
855  const int tb = qMin(a, (b << 3) | (b >> 2));
856  return qRgba(tr, tg, tb, data[0]);
857 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
long ASN1_INTEGER_get ASN1_INTEGER * a
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+()

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

Definition at line 864 of file qdrawhelper_p.h.

865 {
866  qargb8565 t;
867  t.data[0] = data[0] + v.data[0];
868  const quint16 rgb = ((data[2] + v.data[2]) << 8)
869  + (data[1] + v.data[1]);
870  t.data[1] = rgb & 0xff;
871  t.data[2] = rgb >> 8;
872  return t;
873 }
unsigned short quint16
Definition: qglobal.h:936
#define rgb(r, g, b)
Definition: qcolor_p.cpp:130
quint8 data[3]

◆ operator==()

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

Definition at line 888 of file qdrawhelper_p.h.

889 {
890  return data[0] == v.data[0]
891  && data[1] == v.data[1]
892  && data[2] == v.data[2];
893 }
quint8 data[3]

◆ rawValue()

quint32 qargb8565::rawValue ( ) const
inline

Definition at line 895 of file qdrawhelper_p.h.

896 {
897  return (data[2] << 16) | (data[1] << 8) | data[0];
898 }
quint8 data[3]

◆ rawValue16()

quint16 qargb8565::rawValue16 ( ) const
inline

Definition at line 900 of file qdrawhelper_p.h.

Referenced by Blend_ARGB24_on_RGB16_SourceAlpha::write(), and Blend_ARGB24_on_RGB16_SourceAndConstAlpha::write().

901 {
902  return (data[2] << 8) | data[1];
903 }
quint8 data[3]

◆ truncedAlpha()

qargb8565 qargb8565::truncedAlpha ( )
inline

Definition at line 764 of file qdrawhelper_p.h.

764  {
765  data[0] &= 0xf8;
766  data[1] &= 0xdf;
767  return *this;
768  }
quint8 data[3]

Friends and Related Functions

◆ qrgb565

friend class qrgb565
friend

Definition at line 780 of file qdrawhelper_p.h.

Referenced by qrgb565::qrgb565().

Properties

◆ data

quint8 qargb8565::data[3]
private

Definition at line 782 of file qdrawhelper_p.h.

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


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