which colour is returned from the getter when outside of the actual image?
Access outside bounds will be undefined behavior, like before.
Also, do we assume that the image is rotated and then 'moved' to fit into the top-left co-ordinate (0, 0) after rotation?
If the image rotates, its dimensions will change, there's no need to fit/align/move something.
Do you mean optimization or did you just use that word?
The optimization would obviously be the copies we can avoid as long as we don't need them. Imagine that a user wants to rotate by 90° and then flip horizontally. Without lazy evaluation, there are two copies required, with lazy evaluation at most one -- possibly none.
Because lazy indices are not optimized at all, due to high cache misses.
Good point. However I'm not sure if
setPixel/getPixel is mainly used in iteration; it's a random access interface. And even now, you can easily have bad cache access patterns, because as a user you don't know whether you should iterate row-major or column-major.
If iteration proves to be an often-needed feature, it would still be possible to provide a dedicated iterator interface, which would walk efficiently in memory. But don't forget that it's always possible to "evaluate" the image and rewrite it in memory, so that the index transform becomes again the identity.
Maybe we should ask ourselves, how
sf::Image is usually used... I think it's:
1. as a container to convert between different image classes
2. to perform "global" pixel operations, like color-mask, pre-alpha multiplying, flip, rotate
3. to set single pixels, e.g. for UI or tileset composition