Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void white1(struct Png *image, int width_pixel) {
- for (int y = 0; y < image->height; y++) {
- png_byte *row = image->row_pointers[y];
- for (int x = 0; x < image->width; x++) {
- png_byte *ptr = &(row[x * width_pixel]);
- if (ptr[0] == 255 && ptr[1] == 255 && ptr[2] == 255){
- paint_pixel_white(image, x+1, y, 3, 0, 0, 0);
- paint_pixel_white(image, x, y+1, 3, 0, 0, 0);
- paint_pixel_white(image, x+1, y-1, 3, 0, 0, 0);
- paint_pixel_white(image, x, y-1, 3, 0, 0, 0);
- paint_pixel_white(image, x-1, y, 3, 0, 0, 0);
- paint_pixel_white(image, x-1, y-1, 3, 0, 0, 0);
- paint_pixel_white(image, x-1, y+1, 3, 0, 0, 0);
- paint_pixel_white(image, x+1, y+1, 3, 0, 0, 0);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement