source: pwntcha/trunk/src/common.h @ 2315

Last change on this file since 2315 was 2315, checked in by Sam Hocevar, 13 years ago
  • Update build system and licensing terms to 2008 standards.
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1/*
2 * commin.h: common stuff
3 * $Id: common.h 2315 2008-04-26 07:25:03Z sam $
4 *
5 * Copyright: (c) 2004 Sam Hocevar <sam@zoy.org>
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 *  http://sam.zoy.org/wtfpl/COPYING for more details.
11 */
12
13/* image structure */
14struct image
15{
16    int width, height, pitch, channels;
17    unsigned char *pixels;
18    void *priv;
19};
20
21/* font structure */
22struct font
23{
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;
32};
33
34/* global variables */
35extern char *argv0;
36extern char *share;
37
38/* debug function */
39void pwnprint(const char *fmt, ...);
40
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);
55
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);
66
67/* font operations */
68struct font *font_load_fixed(char *file, char *chars);
69struct font *font_load_variable(char *file, char *chars);
70void font_free(struct font *font);
71
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);
85
Note: See TracBrowser for help on using the repository browser.