Skip to content

Instantly share code, notes, and snippets.

@jaqque
Created December 15, 2014 19:30
Show Gist options
  • Save jaqque/f787dc6e0dbb7280b6ff to your computer and use it in GitHub Desktop.
Save jaqque/f787dc6e0dbb7280b6ff to your computer and use it in GitHub Desktop.
"PNG" to Ordered Pairs
#include "image.h"
#include <stdio.h>
int main (void) {
int column;
int row;
char *data;
int pixel[4];
data=header_data;
for (row=0; row<height; row++) {
for (column=0; column<width; column++) {
HEADER_PIXEL(data,pixel);
if (pixel[0]==0) {
printf ("(%d,-%d)\n", column, row);
}
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment