Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct img_t {
- char *pixels;
- int width;
- int height;
- };
- int img_invert(struct img_t *img)
- {
- for(int i = 0; i < img->width; i++)
- {
- for(int j = 0; j < img->height; j++)
- {
- char tmp = img->pixels[i*j];
- img->pixels[i*j] = 255 - tmp;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement