The Qt class QImage
has two versions of its bits()
function that returns a pointer to the underlying image data. One is const, the other is not. Here is the documentation for the non-const version:
Returns a pointer to the first pixel data. This is equivalent to scanLine(0).
Note that QImage uses implicit data sharing. This function performs a deep copy of the shared pixel data, thus ensuring that this QImage is the only one using the current return value.
The return type is uchar*
.
Does this imply that I'm responsible for calling delete
on this pointer when I'm done with it to avoid a memory leak?