[SOLVED] QImage using pointer to valarray ?
-
Hello,
I'm new to this Forum. In the context of loading and visualising scientific images in FITS files, as quick as possible, I am using valarray, used by the CCFITSIO library. The latter reads raw scientific images in these objects. From the QImage doc, and this specific overload :
- QImage(uchar * data, int width, int height, Format format)
I understand that QImage could take a pointer to some data in a buffer.
Is there any way to get a pointer to, say, valarray<float> myValArray ? And give it to QImage, without making any intermediate copies ?
At the moment, the compiler (VS2013) does not allow me to use
&myValArray[0] in QImage. I assume this comes from my misunderstanding of either QImage and valArray objects.Thanks for your help.
-
Hi and welcome to devnet,
QImage doesn't support float AFAIK. You should rather write a QImageReader subclass that decodes your image data in something supported by QImage
-
It can be something else as long as there's a reader that can translate it in a format QImage understands.
QImage is the base image class, what can be done is to use OpenCV to convert your image data into something QImage can handle