Sfoglia il codice sorgente

* filter_dup()

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@398 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 20 anni fa
parent
commit
ceaceb2652
2 ha cambiato i file con 20 aggiunte e 0 eliminazioni
  1. +2
    -0
      src/common.h
  2. +18
    -0
      src/filters.c

+ 2
- 0
src/common.h Vedi File

@@ -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);


+ 18
- 0
src/filters.c Vedi File

@@ -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;


Caricamento…
Annulla
Salva