diff --git a/src/common.h b/src/common.h index 87ec8a7..5c8e0d1 100644 --- a/src/common.h +++ b/src/common.h @@ -22,6 +22,7 @@ void dprintf(const char *fmt, ...); /* available CAPTCHA decoders */ char *decode_phpbb(struct image *img); +char *decode_scode(struct image *img); char *decode_slashdot(struct image *img); char *decode_test(struct image *img); @@ -37,6 +38,7 @@ int setpixel(struct image *img, int x, int y, int r, int g, int b); /* image filters */ void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b); struct image *filter_fill_holes(struct image *img); +struct image *filter_dup(struct image *img); struct image *filter_detect_lines(struct image *img); struct image *filter_equalize(struct image *img, int threshold); struct image *filter_trick(struct image *img); diff --git a/src/filters.c b/src/filters.c index 44501d3..126ad05 100644 --- a/src/filters.c +++ b/src/filters.c @@ -52,6 +52,24 @@ void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b) filter_flood_fill(img, x, y - 1, r, g, b); } +struct image *filter_dup(struct image *img) +{ + struct image *dst; + int x, y; + int r, g, b; + + dst = image_new(img->width, img->height); + + for(y = 0; y < img->height; y++) + for(x = 0; x < img->width; x++) + { + getpixel(img, x, y, &r, &g, &b); + setpixel(dst, x, y, r, g, b); + } + + return dst; +} + struct image *filter_fill_holes(struct image *img) { struct image *dst;