(Image): end iterator is not correct
Summary
The end iterator of the image does not take into account the iterator format but compute the number of elements according of the image type.
In a few cases, we want to parse the image using another type, for performances or to avoid to cast the buffer.
Steps to reproduce
create an image with 'uint16' type and get default end iterator (image->end()) cast in char
. The iterator will point to the middle of the buffer and not the end.
Dev environment
- Commit: dev, related to !273 (merged)
What is the current bug behavior?
The end iterator is not correct.
What is the expected correct behavior?
The end iterator is at the buffer end.
Possible fixes
Use the iterator format to compute the number of element instead of the image type.