Hello!
I have a little program where the user can put various shapes with different colors on the screen.
Now I need to know how may pixels of the whole screen are completely black.
To to this I grab the whole screen into a Pixmap using GrabPixmap(0,0,640,480). Then I read pixel by pixel and if the pixel has the required rgb values I increment a counter variable.
Luckily I only need this when the user puts a new shape on the screen so the speed is not a very important issue.
However, I wondered if anyone of you has an better and much faster idea on how to get the numbers of black pixels on the screen.
I have a little program where the user can put various shapes with different colors on the screen.
Now I need to know how may pixels of the whole screen are completely black.
To to this I grab the whole screen into a Pixmap using GrabPixmap(0,0,640,480). Then I read pixel by pixel and if the pixel has the required rgb values I increment a counter variable.
Luckily I only need this when the user puts a new shape on the screen so the speed is not a very important issue.
However, I wondered if anyone of you has an better and much faster idea on how to get the numbers of black pixels on the screen.