[382] | 1 | /* |
---|
| 2 | * commin.h: common stuff |
---|
| 3 | * $Id: common.h 419 2005-01-04 23:10:43Z sam $ |
---|
| 4 | * |
---|
| 5 | * Copyright: (c) 2004 Sam Hocevar <sam@zoy.org> |
---|
| 6 | * This program is free software; you can redistribute it and/or |
---|
| 7 | * modify it under the terms of the Do What The Fuck You Want To |
---|
| 8 | * Public License as published by Banlu Kemiyatorn. See |
---|
| 9 | * http://sam.zoy.org/projects/COPYING.WTFPL for more details. |
---|
| 10 | */ |
---|
[381] | 11 | |
---|
| 12 | /* image structure */ |
---|
| 13 | struct image |
---|
| 14 | { |
---|
| 15 | int width, height, pitch, channels; |
---|
| 16 | unsigned char *pixels; |
---|
| 17 | void *priv; |
---|
| 18 | }; |
---|
| 19 | |
---|
[392] | 20 | /* debug function */ |
---|
| 21 | void dprintf(const char *fmt, ...); |
---|
| 22 | |
---|
[381] | 23 | /* available CAPTCHA decoders */ |
---|
[419] | 24 | char *decode_linuxfr(struct image *img); |
---|
[389] | 25 | char *decode_phpbb(struct image *img); |
---|
[398] | 26 | char *decode_scode(struct image *img); |
---|
[389] | 27 | char *decode_slashdot(struct image *img); |
---|
[414] | 28 | char *decode_vbulletin(struct image *img); |
---|
[389] | 29 | char *decode_test(struct image *img); |
---|
[381] | 30 | |
---|
| 31 | /* image operations */ |
---|
[413] | 32 | struct image *image_load(const char *name); |
---|
[389] | 33 | struct image *image_new(int width, int height); |
---|
| 34 | void image_free(struct image *img); |
---|
[413] | 35 | void image_save(struct image *img, const char *name); |
---|
[389] | 36 | void image_display(struct image *img); |
---|
[381] | 37 | int getgray(struct image *img, int x, int y, int *g); |
---|
| 38 | int getpixel(struct image *img, int x, int y, int *r, int *g, int *b); |
---|
| 39 | int setpixel(struct image *img, int x, int y, int r, int g, int b); |
---|
| 40 | |
---|
[385] | 41 | /* image filters */ |
---|
[387] | 42 | void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b); |
---|
| 43 | struct image *filter_fill_holes(struct image *img); |
---|
[398] | 44 | struct image *filter_dup(struct image *img); |
---|
[413] | 45 | struct image *filter_black_stuff(struct image *img); |
---|
[387] | 46 | struct image *filter_detect_lines(struct image *img); |
---|
[389] | 47 | struct image *filter_equalize(struct image *img, int threshold); |
---|
[387] | 48 | struct image *filter_trick(struct image *img); |
---|
| 49 | struct image *filter_smooth(struct image *img); |
---|
| 50 | struct image *filter_median(struct image *img); |
---|
[389] | 51 | struct image *filter_contrast(struct image *img); |
---|
[413] | 52 | struct image *filter_crop(struct image *img, |
---|
| 53 | int xmin, int ymin, int xmax, int ymax); |
---|
[402] | 54 | int filter_count(struct image *img); |
---|
[385] | 55 | |
---|