Edited
Dear Everyone.
My code seems that making you confused.
My question is, is it best to compare at regular intervals to check that the entire screen is black?
I wonder there is another algorithm to check black-screen or there is not?
Another questions, what will be the accuracy of my idea(granularity is 10)?
SUPER Thanks!!
===========================================================================
I am a C language programmer.
I want check black screen algorithm
There is a screen.
The screen consists of a total of 1000 pixels. If the pixel is black, the pixel has a value of zero (0).
The probability that a pixel is black is unknown. This is because I don't know what screen will appear on the screen.
I want to check only a few pixels to confirm if the entire screen is black or not
I think I can get a rough idea of whether the entire screen is black or not. Choose one out of ten to see if it is black or not. Repeat the above.
char pixel[1000];
for (idx = 0; idx < 1000; idx++) {
if (idx % 10 ==0) {
if (pixel[idx] == black)
black_count++;
}
}
if (black_count > 0)
print("This screen black maybe");
I think there is no other way.
If you have any other comments, please answer them.
Thanks.
Dear pritaeas
You say that Possible duplicate of Best way to compare two int arrays of the same length?
But This question is in a different area.
I use only one array.
You are wrong.
Thanks.