11-10-2002, 04:29 PM
I would like to count the pixels that are on the screen of a given color lets say represented by variables r g and b
I think the way I should do this is something like the following, but I can't seem to be able to finish
buff=(unsigned char *) calloc(1,w*h*3)
glReadPixels(0,0,w,h,GL_RGB,GL_UNSIGNED_BYTE,buff)
is that right?
what do I do now with buff to get each pixel information out of it?
Thanks
Joan
I think the way I should do this is something like the following, but I can't seem to be able to finish
buff=(unsigned char *) calloc(1,w*h*3)
glReadPixels(0,0,w,h,GL_RGB,GL_UNSIGNED_BYTE,buff)
is that right?
what do I do now with buff to get each pixel information out of it?
Thanks
Joan