Commit 40af2040 authored by abmyii's avatar abmyii
Browse files

Add mirroring via Qt

parent 7bd314b8
......@@ -77,7 +77,7 @@ struct libevdev_uinput *uidev;
int maxx, maxy;
bool landscape = false;
bool mirror = false;
bool mirror = true;
float scale_factor;
int orientation;
......@@ -100,7 +100,11 @@ void read_pixels(int bpp, GLenum format, mir::geometry::Size const& size, void*
QImage image(width, height, QImage::Format_RGBA8888);
glReadPixels(0, 0, width, height, format, GL_UNSIGNED_BYTE, image.bits());
// https://forum.qt.io/topic/92641/converting-a-qimage-to-a-qbytearray-and-convert-it-back-into-an-image/8
// Mirror image (https://www.qtcentre.org/threads/19358-How-to-flip-QImage)
if (mirror)
image = image.mirrored(true, true);
// Copy image data to FB (https://forum.qt.io/topic/92641/converting-a-qimage-to-a-qbytearray-and-convert-it-back-into-an-image/8)
memcpy(fb, image.bits(), image.byteCount());
#ifdef DEBUG
unsigned int sum = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment