Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Question on index for ofImage getColor

$
0
0

@mikechambers wrote:

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.

mike

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles