source: pwntcha/trunk/src/common.h

Last change on this file was 2318, checked in by Sam Hocevar, 14 years ago
  • Step 2 of the code reorganisation: move each font to its corresponding decoder's subdirectory.
  • Property svn:keywords set to Id
File size: 2.7 KB
2 * commin.h: common stuff
3 * $Id: common.h 2318 2008-04-26 08:41:43Z sam $
4 *
5 * Copyright: (c) 2004 Sam Hocevar <>
6 *  This program is free software. It comes without any warranty, to
7 *  the extent permitted by applicable law. You can redistribute it
8 *  and/or modify it under the terms of the Do What The Fuck You Want
9 *  To Public License, Version 2, as published by Sam Hocevar. See
10 * for more details.
11 */
13/* image structure */
14struct image
16    int width, height, pitch, channels;
17    unsigned char *pixels;
18    void *priv;
21/* font structure */
22struct font
24    struct image *img;
25    struct glyph
26    {
27        int xmin, xmax, ymin, ymax;
28        int count; /* Black pixel count */
29        char c;
30    } *glyphs;
31    int size;
34/* global variables */
35extern char *argv0;
36extern char *share;
38/* debug function */
39void pwnprint(const char *fmt, ...);
41/* available CAPTCHA decoders */
42char *decode_authimage(struct image *img);
43char *decode_clubic(struct image *img);
44char *decode_linuxfr(struct image *img);
45char *decode_livejournal(struct image *img);
46char *decode_paypal(struct image *img);
47char *decode_phpbb(struct image *img);
48char *decode_scode(struct image *img);
49char *decode_slashdot(struct image *img);
50char *decode_tickets(struct image *img);
51char *decode_ticketmaster(struct image *img);
52char *decode_vbulletin(struct image *img);
53char *decode_xanga(struct image *img);
54char *decode_test(struct image *img);
56/* image operations */
57struct image *image_load(const char *name);
58struct image *image_new(int width, int height);
59struct image *image_dup(struct image *img);
60void image_free(struct image *img);
61void image_save(struct image *img, const char *name);
62void image_swap(struct image *img1, struct image *img2);
63int getgray(struct image *img, int x, int y, int *g);
64int getpixel(struct image *img, int x, int y, int *r, int *g, int *b);
65int setpixel(struct image *img, int x, int y, int r, int g, int b);
67/* font operations */
68struct font *font_load_fixed(char const *, char const *, char const *);
69struct font *font_load_variable(char const *, char const *, char const *);
70void font_free(struct font *);
72/* image filters */
73void filter_flood_fill(struct image *img, int x, int y, int r, int g, int b);
74void filter_fill_holes(struct image *img);
75void filter_scale(struct image *img, float ratio);
76void filter_black_stuff(struct image *img);
77void filter_detect_lines(struct image *img);
78void filter_threshold(struct image *img, int threshold);
79void filter_trick(struct image *img);
80void filter_smooth(struct image *img);
81void filter_median(struct image *img);
82void filter_contrast(struct image *img);
83void filter_crop(struct image *img, int xmin, int ymin, int xmax, int ymax);
84int filter_count(struct image *img);
Note: See TracBrowser for help on using the repository browser.