Changeset 398 for pwntcha


Ignore:
Timestamp:
Jan 4, 2005, 2:25:35 AM (18 years ago)
Author:
Sam Hocevar
Message:
  • filter_dup()
Location:
pwntcha/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/common.h

    r392 r398  
    2323/* available CAPTCHA decoders */
    2424char *decode_phpbb(struct image *img);
     25char *decode_scode(struct image *img);
    2526char *decode_slashdot(struct image *img);
    2627char *decode_test(struct image *img);
     
    3839void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b);
    3940struct image *filter_fill_holes(struct image *img);
     41struct image *filter_dup(struct image *img);
    4042struct image *filter_detect_lines(struct image *img);
    4143struct image *filter_equalize(struct image *img, int threshold);
  • 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.