Hello all,
i'm reading the docs from QImage (i'm using Qt 4.6 OpenSource), and it's said that pixel() and setPixel() are consumant (Which is obvious on big pictures), that's why i've been using direct pixel access with bits().
However, i'd like to get an answer to a question i'm having. i'm using bits() in two different contexts. The first one is to read an image and the second one is to write to an image (Because i'm applying a convolution matrix filter to the images, i need the input to be a different set of pixels than the output, since the convolution matrix needs access to the original until it's done).
So, i've been reading that calling the bits() method makes a deep copy of the image data, whatever the use will be... But isn't there a way to get access to those pixels without making a copy, e.g. by returning a const pointer instead of a copy?
Alternatively, isn't there a "pixel()" function which would be inline and using internally a pointer to a function based on image format / depth instead of the nasty switch i'm seeing?
Thanks,
Pierre.
Bookmarks