QImage, ARGB and RGBA, alpha channel is never first in raw bits
Unsolved
General and Desktop
-
I have an image that I am setting it's pixels to
QColor(200, 201, 203, 155)
(R:200,G:201,B:203,A:155).When using
Format_RGBA8888
, the raw bits are ordered in RGBA, which is expected.However, when using
Format_ARGB32
, the raw bits are ordered in BGRA, which is seemingly incorrect. I expected ARGB.What format should I used to get the alpha channel represented as the first byte of each pixel (32bit)?
-
The result you are having is just dictated by the endianness of your system. You can see it in https://code.woboq.org/qt5/qtbase/src/gui/image/qimage.cpp.html#2374