Qt 4.8
Classes | Macros | Functions | Variables
qcolormap_qpa.cpp File Reference
#include "qcolormap.h"
#include "qcolor.h"
#include "qpaintdevice.h"
#include "private/qapplication_p.h"
#include "private/qgraphicssystem_p.h"

Go to the source code of this file.

Classes

class  QColormapPrivate
 

Macros

#define QT_QWS_DEPTH16_RGB   565
 

Functions

QRgb qt_conv16ToRgb (ushort c)
 
ushort qt_convRgbTo16 (QRgb c)
 

Variables

static const int qt_bbits = (QT_QWS_DEPTH16_RGB%10)
 
static const int qt_blue_mask = (1<<qt_bbits)-1
 
static const int qt_blue_rounding_shift = qt_bbits - qt_neg_blue_shift
 
static const int qt_gbits = (QT_QWS_DEPTH16_RGB/10%10)
 
static const int qt_green_mask = (1<<(qt_gbits+qt_bbits))-(1<<qt_bbits)
 
static const int qt_green_rounding_shift = qt_green_shift + qt_gbits
 
static const int qt_green_shift = qt_bbits-(8-qt_gbits)
 
static const int qt_neg_blue_shift = 8-qt_bbits
 
static const int qt_rbits = (QT_QWS_DEPTH16_RGB/100)
 
static const int qt_red_mask = (1<<(qt_rbits+qt_gbits+qt_bbits))-(1<<(qt_gbits+qt_bbits))
 
static const int qt_red_rounding_shift = qt_red_shift + qt_rbits
 
static const int qt_red_shift = qt_bbits+qt_gbits-(8-qt_rbits)
 
static QColormapPrivatescreenMap = 0
 

Macro Definition Documentation

◆ QT_QWS_DEPTH16_RGB

#define QT_QWS_DEPTH16_RGB   565

Definition at line 122 of file qcolormap_qpa.cpp.

Function Documentation

◆ qt_conv16ToRgb()

QRgb qt_conv16ToRgb ( ushort  c)
inline

Definition at line 147 of file qcolormap_qpa.cpp.

148 {
149  const int r=(c & qt_red_mask);
150  const int g=(c & qt_green_mask);
151  const int b=(c & qt_blue_mask);
152  const int tr = r >> qt_red_shift | r >> qt_red_rounding_shift;
153  const int tg = g >> qt_green_shift | g >> qt_green_rounding_shift;
154  const int tb = b << qt_neg_blue_shift | b >> qt_blue_rounding_shift;
155 
156  return qRgb(tr,tg,tb);
157 }
static const int qt_green_rounding_shift
unsigned char c[8]
Definition: qnumeric_p.h:62
static const int qt_green_mask
static const int qt_blue_mask
static const int qt_green_shift
static const int qt_red_rounding_shift
static const int qt_red_shift
static const int qt_red_mask
QRgb qRgb(int r, int g, int b)
Returns the ARGB quadruplet (255, {r}, {g}, {b}).
Definition: qrgb.h:69
static const int qt_blue_rounding_shift

◆ qt_convRgbTo16()

ushort qt_convRgbTo16 ( QRgb  c)
inline

Definition at line 138 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb().

139 {
140  const int tr = qRed(c) << qt_red_shift;
141  const int tg = qGreen(c) << qt_green_shift;
142  const int tb = qBlue(c) >> qt_neg_blue_shift;
143 
144  return (tb & qt_blue_mask) | (tg & qt_green_mask) | (tr & qt_red_mask);
145 }
unsigned char c[8]
Definition: qnumeric_p.h:62
static const int qt_neg_blue_shift
static const int qt_green_mask
int qRed(QRgb rgb)
Returns the red component of the ARGB quadruplet rgb.
Definition: qrgb.h:57
static const int qt_blue_mask
static const int qt_green_shift
static const int qt_red_shift
static const int qt_red_mask
int qGreen(QRgb rgb)
Returns the green component of the ARGB quadruplet rgb.
Definition: qrgb.h:60
int qBlue(QRgb rgb)
Returns the blue component of the ARGB quadruplet rgb.
Definition: qrgb.h:63

Variable Documentation

◆ qt_bbits

const int qt_bbits = (QT_QWS_DEPTH16_RGB%10)
static

Definition at line 126 of file qcolormap_qpa.cpp.

◆ qt_blue_mask

const int qt_blue_mask = (1<<qt_bbits)-1
static

Definition at line 130 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_blue_rounding_shift

const int qt_blue_rounding_shift = qt_bbits - qt_neg_blue_shift
static

Definition at line 136 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_gbits

const int qt_gbits = (QT_QWS_DEPTH16_RGB/10%10)
static

Definition at line 125 of file qcolormap_qpa.cpp.

◆ qt_green_mask

const int qt_green_mask = (1<<(qt_gbits+qt_bbits))-(1<<qt_bbits)
static

Definition at line 131 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_green_rounding_shift

const int qt_green_rounding_shift = qt_green_shift + qt_gbits
static

Definition at line 135 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_green_shift

const int qt_green_shift = qt_bbits-(8-qt_gbits)
static

Definition at line 128 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_neg_blue_shift

const int qt_neg_blue_shift = 8-qt_bbits
static

Definition at line 129 of file qcolormap_qpa.cpp.

Referenced by qt_convRgbTo16().

◆ qt_rbits

const int qt_rbits = (QT_QWS_DEPTH16_RGB/100)
static

Definition at line 124 of file qcolormap_qpa.cpp.

◆ qt_red_mask

const int qt_red_mask = (1<<(qt_rbits+qt_gbits+qt_bbits))-(1<<(qt_gbits+qt_bbits))
static

Definition at line 132 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ qt_red_rounding_shift

const int qt_red_rounding_shift = qt_red_shift + qt_rbits
static

Definition at line 134 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb().

◆ qt_red_shift

const int qt_red_shift = qt_bbits+qt_gbits-(8-qt_rbits)
static

Definition at line 127 of file qcolormap_qpa.cpp.

Referenced by qt_conv16ToRgb(), and qt_convRgbTo16().

◆ screenMap

QColormapPrivate* screenMap = 0
static

Definition at line 64 of file qcolormap_qpa.cpp.