Ignore:
Timestamp:
Jan 4, 2005, 2:25:35 AM (18 years ago)
Author:
Sam Hocevar
Message:
  • filter_dup()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/filters.c

    r389 r398  
    5151    if(nextr == oldr && nextg == oldg && nextb == oldb)
    5252        filter_flood_fill(img, x, y - 1, r, g, b);
     53}
     54
     55struct image *filter_dup(struct image *img)
     56{
     57    struct image *dst;
     58    int x, y;
     59    int r, g, b;
     60
     61    dst = image_new(img->width, img->height);
     62
     63    for(y = 0; y < img->height; y++)
     64        for(x = 0; x < img->width; x++)
     65        {
     66            getpixel(img, x, y, &r, &g, &b);
     67            setpixel(dst, x, y, r, g, b);
     68        }
     69
     70    return dst;
    5371}
    5472
Note: See TracChangeset for help on using the changeset viewer.