1 | /* |
---|
2 | * commin.h: common stuff |
---|
3 | * $Id: common.h 392 2005-01-03 23:26:29Z 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 | */ |
---|
11 | |
---|
12 | /* image structure */ |
---|
13 | struct image |
---|
14 | { |
---|
15 | int width, height, pitch, channels; |
---|
16 | unsigned char *pixels; |
---|
17 | void *priv; |
---|
18 | }; |
---|
19 | |
---|
20 | /* debug function */ |
---|
21 | void dprintf(const char *fmt, ...); |
---|
22 | |
---|
23 | /* available CAPTCHA decoders */ |
---|
24 | char *decode_phpbb(struct image *img); |
---|
25 | char *decode_slashdot(struct image *img); |
---|
26 | char *decode_test(struct image *img); |
---|
27 | |
---|
28 | /* image operations */ |
---|
29 | struct image *image_load(char *name); |
---|
30 | struct image *image_new(int width, int height); |
---|
31 | void image_free(struct image *img); |
---|
32 | void image_display(struct image *img); |
---|
33 | int getgray(struct image *img, int x, int y, int *g); |
---|
34 | int getpixel(struct image *img, int x, int y, int *r, int *g, int *b); |
---|
35 | int setpixel(struct image *img, int x, int y, int r, int g, int b); |
---|
36 | |
---|
37 | /* image filters */ |
---|
38 | void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b); |
---|
39 | struct image *filter_fill_holes(struct image *img); |
---|
40 | struct image *filter_detect_lines(struct image *img); |
---|
41 | struct image *filter_equalize(struct image *img, int threshold); |
---|
42 | struct image *filter_trick(struct image *img); |
---|
43 | struct image *filter_smooth(struct image *img); |
---|
44 | struct image *filter_median(struct image *img); |
---|
45 | struct image *filter_contrast(struct image *img); |
---|
46 | |
---|