Reputation: 1344
I'm planning to store an QImage's pixel data in an array, then do some work with it in OpenCL.
What is the best approach to get all pixel data (colour code)?
Upvotes: 2
Views: 738
Reputation: 653
uchar * QImage::bits () gives the pointer to the first pixel data. You can create an OpenCL buffer with CL_MEM_USE_HOST_POINTER flag by passing pointer returned from bits.
Upvotes: 3
Reputation: 4330
Use the QImage::bits()
and QImage::byteCount()
methods to get a raw pointer to the image data and the size in bytes of the image data.
Upvotes: 1