If this is an object you are yourself creating, it's up to you to define the semantics. As a suggestion though, getArea and getSize should be two different concepts.
Originally Posted by audinue
- getArea should return the geometric area of the image in whatever units you deem necessary. Could be pixels, centimeters, inches.
- getSize should return the physical size of the image as it is occupied in memory.
Assuming these semantics are defined, then it becomes trivial for the class user to understand that they can use getArea() to read the location of the last pixel of the image.
I tend to agree with the above... and I apologize for not understanding what you were looking for earlier. It was, in fact, the code after the edit that threw me off.
In my opinion, getSize would intuitively return the size of the object in memory and getArea would return the pixel height by the pixel width... That said... if you were to determine a pointer to the end of the image, then you would use getSize because getArea should not be factoring color depth (as each pixel would likely be more than 8-bit).
In other words, if you were to have a 24-bit bitmap with the size of 100px by 100px... then I would expect a function called getSize to return 240000b (excluding the image header, of course) and getArea to return 10000px. ... and as Mario said, getArea would more than likely allow a parameter to specify the type of value you want returned.