A function that I am trying to conform to requires three 1-Dimensional arrays of type double[19200]. The following arrays are RGB arrays such that:
double r[19200]; // r
double g[19200]; // g
double b[19200]; // b
So far, I can extract pixel information from a QImage and populate the above arrays.
The problem is with testing. I don’t know how to do the inverse: given the three 1-Dimensional arrays how do I create a new QImage from this data?
I would like to verify that I am indeed getting the correct values. (Things like column vs. row major order is giving me doubts). As a result, I am trying to construct an image a QImage from these three 1-D Dimensional arrays.
I don’t really understand why you’re having a problem if you managed to do it one way. The process is essentially the same:
Where
convertToRGBis the inverse transform of what you to to convert and RGB value to your float values, supposing the image has dimensionw*h. If you discover this is the wrong row-major/column major variant, just inverse it.Since you gave no info about how you do the color space conversion, and we don’t know if it’s row-major or column-major either, can’t help you much more than that.