/* * commin.h: common stuff * $Id: common.h 419 2005-01-04 23:10:43Z sam $ * * Copyright: (c) 2004 Sam Hocevar * This program is free software; you can redistribute it and/or * modify it under the terms of the Do What The Fuck You Want To * Public License as published by Banlu Kemiyatorn. See * http://sam.zoy.org/projects/COPYING.WTFPL for more details. */ /* image structure */ struct image { int width, height, pitch, channels; unsigned char *pixels; void *priv; }; /* debug function */ void dprintf(const char *fmt, ...); /* available CAPTCHA decoders */ char *decode_linuxfr(struct image *img); char *decode_phpbb(struct image *img); char *decode_scode(struct image *img); char *decode_slashdot(struct image *img); char *decode_vbulletin(struct image *img); char *decode_test(struct image *img); /* image operations */ struct image *image_load(const char *name); struct image *image_new(int width, int height); void image_free(struct image *img); void image_save(struct image *img, const char *name); void image_display(struct image *img); int getgray(struct image *img, int x, int y, int *g); int getpixel(struct image *img, int x, int y, int *r, int *g, int *b); 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_black_stuff(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); struct image *filter_smooth(struct image *img); struct image *filter_median(struct image *img); struct image *filter_contrast(struct image *img); struct image *filter_crop(struct image *img, int xmin, int ymin, int xmax, int ymax); int filter_count(struct image *img);