I misunderstood the description of QImage::Format_RGBA8888, I figured it converted the color order to RGB regardless of if the arch is little or big endian.

I've not tested on a big endian machine but using ARGB32 produces the right order of colors.
This commit is contained in:
kevin 2019-06-24 11:22:22 -04:00
parent 07ba3830a3
commit c0657c13e5

View File

@ -136,7 +136,7 @@ void hgx11grab::_grabFrame()
return;
}
QImage qimg = *new QImage(reinterpret_cast<const uchar *>(_xImage_p->data), _destWidth_m, _destHeight_m, _xImage_p->bytes_per_line, QImage::Format_RGBA8888);
QImage qimg = *new QImage(reinterpret_cast<const uchar *>(_xImage_p->data), _destWidth_m, _destHeight_m, _xImage_p->bytes_per_line, QImage::Format_ARGB32);
qimg = qimg.convertToFormat(QImage::Format_RGB888);
imgdata_m.clear();
imgdata_m = QByteArray::fromRawData(reinterpret_cast<const char *>(qimg.bits()), qimg.byteCount());