Advertisement
LilChicha174

Untitled

Jun 5th, 2022
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. void white1(struct Png *image, int width_pixel) {
  2.     for (int y = 0; y < image->height; y++) {
  3.         png_byte *row = image->row_pointers[y];
  4.         for (int x = 0; x < image->width; x++) {
  5.             png_byte *ptr = &(row[x * width_pixel]);
  6.             if (ptr[0] == 255 && ptr[1] == 255 && ptr[2] == 255){
  7.                 paint_pixel_white(image, x+1, y, 3, 0, 0, 0);
  8.                 paint_pixel_white(image, x, y+1, 3, 0, 0, 0);
  9.                 paint_pixel_white(image, x+1, y-1, 3, 0, 0, 0);
  10.                 paint_pixel_white(image, x, y-1, 3, 0, 0, 0);
  11.                 paint_pixel_white(image, x-1, y, 3, 0, 0, 0);
  12.                 paint_pixel_white(image, x-1, y-1, 3, 0, 0, 0);
  13.                 paint_pixel_white(image, x-1, y+1, 3, 0, 0, 0);
  14.                 paint_pixel_white(image, x+1, y+1, 3, 0, 0, 0);
  15.             }
  16.  
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement