Save position of the first black pixel in a column
in
Programming Questions
•
5 months ago
Hey you all,
relating to an older post I've got an new question.
How to express following with code language:
The first black pixel of an column will be saved
and after that the programm should go on scanning
the next column, saving a pixel position again and
so on and so in.
Thanks for any help.
*edit*
Would dist() probably help? My idea is that it
calculates the distance between the very first pixel
and the first black pixel. But I also don't know what's
this in code language.
relating to an older post I've got an new question.
How to express following with code language:
The first black pixel of an column will be saved
and after that the programm should go on scanning
the next column, saving a pixel position again and
so on and so in.
Thanks for any help.
*edit*
Would dist() probably help? My idea is that it
calculates the distance between the very first pixel
and the first black pixel. But I also don't know what's
this in code language.
- for (int x = 0; x < source.width; x++) {
- for (int y = 0; y < source.height; y++ ) {
- int loc = x + y*source.width;
- int black = 0;
- int white = 255;
- if (brightness (destination.pixels[loc]) == black) {
- }
- // save the position of the first black pixel in this column
- // go to the next column
- }
- }
1