Question on index for ofImage getColor

I am using ofImage.getColor(x, y) to retrieve the color of a pixel from a loaded image. The image is 640 x 640.

If I access a pixel at 640, say 640, 73, I get a crash.

ofImage.getColor(640, 73);

If I subtract one from the request, things work.

So, my question is, if I have a 640, 640 image, should I be able to access the color at 640, 640 via ofImage? Or is the max index I can access 639

i.e. is this valid:

image.getColor(image.getWidth(), image.getHeight());

Basically, its not clear to me how its indexed.

Thanks for any insight.


it’s 0 based indexing so I would expect that to crash (or give abnormal results)

Thanks. That is what I figured. I am going to submit a tweak to the docs to make this clearer.