45 #include "private/qapplication_p.h" 46 #include "private/qgraphicssystem_p.h" 74 if (screenMap->
depth < 8) {
121 #ifndef QT_QWS_DEPTH16_RGB 122 #define QT_QWS_DEPTH16_RGB 565 156 return qRgb(tr,tg,tb);
169 const int r =
qRed(rgb);
170 const int g =
qGreen(rgb);
171 const int b =
qBlue(rgb);
172 const int red_shift = 16;
173 const int green_shift = 8;
174 const int red_mask = 0xff0000;
175 const int green_mask = 0x00ff00;
176 const int blue_mask = 0x0000ff;
177 const int tg = g << green_shift;
178 #ifdef QT_QWS_DEPTH_32_BGR 180 const int tb = b << red_shift;
181 return 0xff000000 | (r & blue_mask) | (tg & green_mask) | (tb & red_mask);
184 const int tr = r << red_shift;
185 return 0xff000000 | (b & blue_mask) | (tg & green_mask) | (tr & red_mask);
196 if (
d->mode == Direct) {
197 if (
d->depth == 16) {
200 const int red_shift = 16;
201 const int green_shift = 8;
202 const int red_mask = 0xff0000;
203 const int green_mask = 0x00ff00;
204 const int blue_mask = 0x0000ff;
205 #ifdef QT_QWS_DEPTH_32_BGR 207 return QColor((pixel & blue_mask),
208 (pixel & green_mask) >> green_shift,
209 (pixel & red_mask) >> red_shift);
212 return QColor((pixel & red_mask) >> red_shift,
213 (pixel & green_mask) >> green_shift,
214 (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)
static const int qt_green_rounding_shift
#define QT_END_NAMESPACE
This macro expands to.
The QAtomicInt class provides platform-independent atomic operations on integers. ...
QRgb qt_conv16ToRgb(ushort c)
static const int qt_neg_blue_shift
static const int qt_green_mask
static const int qt_blue_mask
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
static QColormapPrivate * screenMap
QT_DEPRECATED int numCols()
#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
static const int qt_green_shift
static const int qt_red_rounding_shift
ushort qt_convRgbTo16(QRgb c)
const T & at(int i) const
Returns the item at index position i in the list.
static const int qt_rbits
QColormap & operator=(const QColormap &colormap)
static const int qt_red_shift
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
static const int qt_red_mask
uint pixel(const QColor &color) const
#define QT_QWS_DEPTH16_RGB
#define Q_ASSERT_X(cond, where, what)
const QVector< QColor > colormap() const
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
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 const int qt_bbits
static const int qt_blue_rounding_shift
static const int qt_gbits
The QList class is a template class that provides lists.