71 if (screenMap->
depth < 8) {
128 const int r =
qRed(rgb);
129 const int g =
qGreen(rgb);
130 const int b =
qBlue(rgb);
131 const int red_shift = 16;
132 const int green_shift = 8;
133 const int red_mask = 0xff0000;
134 const int green_mask = 0x00ff00;
135 const int blue_mask = 0x0000ff;
136 const int tg = g << green_shift;
137 #ifdef QT_QWS_DEPTH_32_BGR 139 const int tb = b << red_shift;
140 return 0xff000000 | (r & blue_mask) | (tg & green_mask) | (tb & red_mask);
143 const int tr = r << red_shift;
144 return 0xff000000 | (b & blue_mask) | (tg & green_mask) | (tr & red_mask);
153 if (
d->mode == Direct) {
154 if (
d->depth == 16) {
157 const int red_shift = 16;
158 const int green_shift = 8;
159 const int red_mask = 0xff0000;
160 const int green_mask = 0x00ff00;
161 const int blue_mask = 0x0000ff;
162 #ifdef QT_QWS_DEPTH_32_BGR 164 return QColor((pixel & blue_mask),
165 (pixel & green_mask) >> green_shift,
166 (pixel & red_mask) >> red_shift);
169 return QColor((pixel & red_mask) >> red_shift,
170 (pixel & green_mask) >> green_shift,
171 (pixel & blue_mask));
Q_GUI_EXPORT QScreen * qt_screen
The QColor class provides colors based on RGB, HSV or CMYK values.
static QColormap instance(int screen=-1)
#define QT_END_NAMESPACE
This macro expands to.
static QWSDisplay * qwsDisplay()
The QAtomicInt class provides platform-independent atomic operations on integers. ...
ushort qt_convRgbTo16(const int r, const int g, const int b)
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
virtual int alloc(unsigned int, unsigned int, unsigned int)
Returns the index in the screen's palette which is the closest match to the given RGB value (red...
#define QT_BEGIN_NAMESPACE
This macro expands to.
PixelType pixelType() const
Returns the pixel storage format of the screen.
const QColor colorAt(uint pixel) const
QColormap & operator=(const QColormap &colormap)
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
uint pixel(const QColor &color) const
QRgb qt_conv16ToRgb(ushort c)
#define Q_ASSERT_X(cond, where, what)
int colorCount()
Returns the number of entries in the screen's color lookup table (i.
const QVector< QColor > colormap() const
QRgb * clut()
Returns a pointer to the screen's color lookup table (i.
void qAtomicAssign(T *&d, T *x)
This is a helper for the assignment operators of implicitly shared classes.
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
QColormap()
Constructs a new colormap.
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
static QColormapPrivate * screenMap