Go to the source code of this file.
◆ qgl_byteSwapImage()
static void qgl_byteSwapImage |
( |
QImage & |
img, |
|
|
GLenum |
pixel_type |
|
) |
| |
|
inlinestatic |
Definition at line 49 of file qwaylandreadbackglxcontext.cpp.
Referenced by QWaylandReadbackGlxContext::swapBuffers().
51 const int width = img.
width();
52 const int height = img.
height();
55 || (pixel_type ==
GL_UNSIGNED_BYTE && QSysInfo::ByteOrder == QSysInfo::LittleEndian))
57 for (
int i = 0; i < height; ++i) {
59 for (
int x = 0; x < width; ++x)
60 p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
63 for (
int i = 0; i < height; ++i) {
65 for (
int x = 0; x < width; ++x)
66 p[x] = (p[x] << 8) | ((p[x] >> 24) & 0xff);
#define GL_UNSIGNED_INT_8_8_8_8_REV
int width() const
Returns the width of the image.
int height() const
Returns the height of the image.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.