if (j + width * i >= width * height * byte_per_pixel) {
printf("Error: Out of bounds\n");
return;
}
unsigned char* pixel_offset = data + (j + width * i) * byte_per_pixel;
unsigned char y = pixel_offset[0];
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.