@SGaist said in QImage from raw array of RGBA32floats ?:
Hi,
ARGB32 is 4 bytes hence the 32. So in your case it would rather be ARGB128.
Argh this explains my confustion! Yep thats it thanks!
@wrosecrans said in QImage from raw array of RGBA32floats ?:
@Dariusz said in QImage from raw array of RGBA32floats ?:
Format_ARGB32
Yup, that's 32 total bits per pixel, not 32 bits per channel like the GL_RGBA32F notation in OpenGL. And even then, there are also 32 bits per channel integer pixel formats that still aren't floating point. So even if you do see a 32 bit per channel format, you can't assume it's floating point if it doesn't say it explicitly. (Admittedly those aren't especially common, but formats like OpenEXR support them, and you'll sometimes see them used for things like Object-ID channels in 3D renders)
Basically, every image handling API covers more or less the same basic functionality, but just different enough to make you want to rip your hair out when you try to use them together.
It's not even like nothing in Qt can deal with floating point. QOpenGLFrameBufferObject supports OpenGL format names: https://doc.qt.io/qt-5/qopenglframebufferobjectformat.html#internalTextureFormat and can be FP internally. Then if you try to get a QImage from an FBO using toImage https://doc.qt.io/qt-5/qopenglframebufferobject.html#toImage-1 it will know how to do the pixel format conversion to 8bpc. You just can't get the raw FP data in a QImage.
shrug. This stuff is always more work than you expect, mostly for no good reason.
Argh too sounds about right! Looks like I will either have to build my own image library for format/data handling or perhaps use freeImage as my base... are there any other libraries u could recommend perhaps?
I think I'll mark this issue as solved now as its Qt Limitation and me misunderstanding Qt format.
Thank you all for help.
Regards
Dariusz