PDA

View Full Version : counting the no. of pixels within a bounded area



cs1dh
02-25-2004, 08:46 AM
I am struggling with counting the no. of pixels manually within a bounded area of a .bmp file.
What I came up with is load a .bmp file, go through each pixel, identify the colour of them, save in an array and increase a counter by spotting a particular colour.
I think glReadPixel, glStorePixel and other methods should be applied. That's what I've got so far.
Any Genius can point me to a correct and clear direction, I'd be appreciated.

fuxiulian
02-25-2004, 09:50 AM
Check out this link. I don't think this is supported in hardware on all platforms, though:
http://oss.sgi.com/projects/ogl-sample/registry/EXT/histogram.txt

cs1dh
02-25-2004, 03:38 PM
thanks mate