Debian Codegraph @

lib/imagelib.h

raw symbols SCIP
1 #ifndef _IMAGELIB_H_
2 #define _IMAGELIB_H_
3
4 #ifdef _cards_h_
5 #error include imagelib.h before cards.h
6 #endif
7
8 #ifndef PIXELS_TYPE
9 #define PIXELS_TYPE void *
10 #endif
11
12 typedef struct image {
13 /* filled in by make-imglib */
14 int width;
15 int height;
16 const unsigned char *file_data;
17 /* available to program */
18 struct image *next;
19 int type;
20 PIXELS_TYPE pixels; /* platform and display specific format, like XImage or Pixmap */
21 struct image_list *list;
22 void (*synth_func)(struct image *); /* if set, is synthetic */
23 int synth_flags;
24 } image;
25
26 struct image_list;
27
28 typedef image *(*synth_imagelist_function)(struct image_list *list, int type, int width, int height);
29
30 typedef struct image_list {
31 /* filled in by make-imglib */
32 char *name;
33 int across;
34 int down;
35 image *subimage[3];
36 /* available to program */
37 struct image_list *next;
38 synth_imagelist_function synth_func; /* if set, is synthetic */
39 int synth_flags;
40 } image_list;
41
42 /* Put to this to display on the display's main window. */
43 extern image *display_image;
44
45 #ifdef __cplusplus
46 extern "C" {
47 #if 0
48 } /* To keep emacs from indenting all the below functions. */
49 #endif
50 #endif
51
52 extern image_list appimglib_imagelib[];
53 int register_imagelib(image_list *);
54
55 image *alloc_synth_image (image_list *list, int width, int height, int type);
56
57 image *get_image (char *name, int preferred_width, int preferred_height, int flags);
58 /* This means the preferred dimensions are absolute maximums. */
59 #define GI_NOT_BIGGER 0x01
60 /* This means that a close size match is more important than the right type. */
61 #define GI_ANY_TYPE 0x02
62
63 #define PUT_INVERTED 0x01
64 #define PUT_ROTATED 0x02
65 /* dx dy relative to where src's origin would have been, not relative
66 to the x, y point indicated here. */
67 void put_image (image *src, int x, int y, int w, int h,
68 image *dest, int dx, int dy, int flags);
69 /* Same, but copies mask (creating one if needed) */
70 void put_mask (image *src, int x, int y, int w, int h,
71 image *dest, int dx, int dy, int flags);
72 /* Similar, but always the whole subimage (based on across, down in image_list) */
73 void put_subimage (image *src, int col, int row,
74 image *dest, int dx, int dy, int flags);
75 /* For synthesizing images. */
76 void fill_image (image *dest, int x, int y, int w, int h,
77 int r, int g, int b);
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif