#include "qwaylandreadbackeglcontext.h"
#include "../../../eglconvenience/qeglconvenience.h"
#include <QtOpenGL/QGLContext>
#include <QtOpenGL/private/qglextensions_p.h>
#include "qwaylandshmsurface.h"
#include <QtCore/QDebug>
Go to the source code of this file.
◆ qgl_byteSwapImage()
static void qgl_byteSwapImage |
( |
QImage & |
img, |
|
|
GLenum |
pixel_type |
|
) |
| |
|
inlinestatic |
Definition at line 53 of file qwaylandreadbackeglcontext.cpp.
Referenced by QWaylandReadbackEglContext::swapBuffers().
55 const int width = img.
width();
56 const int height = img.
height();
59 || (pixel_type ==
GL_UNSIGNED_BYTE && QSysInfo::ByteOrder == QSysInfo::LittleEndian))
61 for (
int i = 0; i < height; ++i) {
63 for (
int x = 0; x < width; ++x)
64 p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
67 for (
int i = 0; i < height; ++i) {
69 for (
int x = 0; x < width; ++x)
70 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.