| 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 |
|
| 14 |
int width; |
| 15 |
int height; |
| 16 |
const unsigned char *file_data; |
| 17 |
|
| 18 |
struct image *next; |
| 19 |
int type; |
| 20 |
PIXELS_TYPE pixels; |
| 21 |
struct image_list *list; |
| 22 |
void (*synth_func)(struct image *); |
| 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 |
|
| 32 |
char *name; |
| 33 |
int across; |
| 34 |
int down; |
| 35 |
image *subimage[3]; |
| 36 |
|
| 37 |
struct image_list *next; |
| 38 |
synth_imagelist_function synth_func; |
| 39 |
int synth_flags; |
| 40 |
} image_list; |
| 41 |
|
| 42 |
|
| 43 |
extern image *display_image; |
| 44 |
|
| 45 |
#ifdef __cplusplus |
| 46 |
extern "C" { |
| 47 |
#if 0 |
| 48 |
} |
| 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 |
|
| 59 |
#define GI_NOT_BIGGER 0x01 |
| 60 |
|
| 61 |
#define GI_ANY_TYPE 0x02 |
| 62 |
|
| 63 |
#define PUT_INVERTED 0x01 |
| 64 |
#define PUT_ROTATED 0x02 |
| 65 |
|
| 66 |
|
| 67 |
void put_image (image *src, int x, int y, int w, int h, |
| 68 |
image *dest, int dx, int dy, int flags); |
| 69 |
|
| 70 |
void put_mask (image *src, int x, int y, int w, int h, |
| 71 |
image *dest, int dx, int dy, int flags); |
| 72 |
|
| 73 |
void put_subimage (image *src, int col, int row, |
| 74 |
image *dest, int dx, int dy, int flags); |
| 75 |
|
| 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 |