1 #ifndef IMAGER_IMEXTTYPES_H_
2 #define IMAGER_IMEXTTYPES_H_
4 /* keep this file simple - apidocs.perl parses it. */
6 #include "imdatatypes.h"
9 IMAGER_API_VERSION is similar to the version number in the third and
10 fourth bytes of TIFF files - if it ever changes then the API has changed
11 too much for any application to remain compatible.
13 #define IMAGER_API_VERSION 1
16 IMAGER_API_LEVEL is the level of the structure. New function pointers
17 will always remain at the end (unless IMAGER_API_VERSION changes), and
18 will result in an increment of IMAGER_API_LEVEL.
21 #define IMAGER_API_LEVEL 6
27 /* IMAGER_API_LEVEL 1 functions */
28 void * (*f_mymalloc)(int size);
29 void (*f_myfree)(void *block);
30 void * (*f_myrealloc)(void *block, size_t newsize);
31 void* (*f_mymalloc_file_line)(size_t size, char* file, int line);
32 void (*f_myfree_file_line)(void *p, char*file, int line);
33 void* (*f_myrealloc_file_line)(void *p, size_t newsize, char* file,int line);
35 i_img *(*f_i_img_8_new)(int xsize, int ysize, int channels);
36 i_img *(*f_i_img_16_new)(int xsize, int ysize, int channels);
37 i_img *(*f_i_img_double_new)(int xsize, int ysize, int channels);
38 i_img *(*f_i_img_pal_new)(int xsize, int ysize, int channels, int maxpal);
39 void (*f_i_img_destroy)(i_img *im);
40 i_img *(*f_i_sametype)(i_img *im, int xsize, int ysize);
41 i_img *(*f_i_sametype_chans)(i_img *im, int xsize, int ysize, int channels);
42 void (*f_i_img_info)(i_img *im, int *info);
44 int (*f_i_ppix)(i_img *im, int x, int y, const i_color *val);
45 int (*f_i_gpix)(i_img *im, int x, int y, i_color *val);
46 int (*f_i_ppixf)(i_img *im, int x, int y, const i_fcolor *val);
47 int (*f_i_gpixf)(i_img *im, int x, int y, i_fcolor *val);
48 int (*f_i_plin)(i_img *im, int l, int r, int y, const i_color *vals);
49 int (*f_i_glin)(i_img *im, int l, int r, int y, i_color *vals);
50 int (*f_i_plinf)(i_img *im, int l, int r, int y, const i_fcolor *vals);
51 int (*f_i_glinf)(i_img *im, int l, int r, int y, i_fcolor *vals);
52 int (*f_i_gsamp)(i_img *im, int l, int r, int y, i_sample_t *samp,
53 const int *chans, int chan_count);
54 int (*f_i_gsampf)(i_img *im, int l, int r, int y, i_fsample_t *samp,
55 const int *chans, int chan_count);
56 int (*f_i_gpal)(i_img *im, int x, int r, int y, i_palidx *vals);
57 int (*f_i_ppal)(i_img *im, int x, int r, int y, const i_palidx *vals);
58 int (*f_i_addcolors)(i_img *im, const i_color *colors, int count);
59 int (*f_i_getcolors)(i_img *im, int i, i_color *, int count);
60 int (*f_i_colorcount)(i_img *im);
61 int (*f_i_maxcolors)(i_img *im);
62 int (*f_i_findcolor)(i_img *im, const i_color *color, i_palidx *entry);
63 int (*f_i_setcolors)(i_img *im, int index, const i_color *colors,
66 i_fill_t *(*f_i_new_fill_solid)(const i_color *c, int combine);
67 i_fill_t *(*f_i_new_fill_solidf)(const i_fcolor *c, int combine);
69 i_fill_t *(*f_i_new_fill_hatch)(const i_color *fg, const i_color *bg, int combine,
70 int hatch, const unsigned char *cust_hatch,
72 i_fill_t *(*f_i_new_fill_hatchf)(const i_fcolor *fg, const i_fcolor *bg, int combine,
73 int hatch, const unsigned char *cust_hatch,
75 i_fill_t *(*f_i_new_fill_image)(i_img *im, const double *matrix, int xoff,
76 int yoff, int combine);
77 i_fill_t *(*f_i_new_fill_fount)(double xa, double ya, double xb, double yb,
78 i_fountain_type type, i_fountain_repeat repeat,
79 int combine, int super_sample, double ssample_param,
80 int count, i_fountain_seg *segs);
82 void (*f_i_fill_destroy)(i_fill_t *fill);
84 void (*f_i_quant_makemap)(i_quantize *quant, i_img **imgs, int count);
85 i_palidx * (*f_i_quant_translate)(i_quantize *quant, i_img *img);
86 void (*f_i_quant_transparent)(i_quantize *quant, i_palidx *indices,
87 i_img *img, i_palidx trans_index);
89 void (*f_i_clear_error)(void);
90 void (*f_i_push_error)(int code, char const *msg);
91 void (*f_i_push_errorf)(int code, char const *fmt, ...);
92 void (*f_i_push_errorvf)(int code, char const *fmt, va_list);
94 void (*f_i_tags_new)(i_img_tags *tags);
95 int (*f_i_tags_set)(i_img_tags *tags, char const *name, char const *data,
97 int (*f_i_tags_setn)(i_img_tags *tags, char const *name, int idata);
98 void (*f_i_tags_destroy)(i_img_tags *tags);
99 int (*f_i_tags_find)(i_img_tags *tags, char const *name, int start,
101 int (*f_i_tags_findn)(i_img_tags *tags, int code, int start, int *entry);
102 int (*f_i_tags_delete)(i_img_tags *tags, int entry);
103 int (*f_i_tags_delbyname)(i_img_tags *tags, char const *name);
104 int (*f_i_tags_delbycode)(i_img_tags *tags, int code);
105 int (*f_i_tags_get_float)(i_img_tags *tags, char const *name, int code,
107 int (*f_i_tags_set_float)(i_img_tags *tags, char const *name, int code,
109 int (*f_i_tags_set_float2)(i_img_tags *tags, char const *name, int code,
110 double value, int places);
111 int (*f_i_tags_get_int)(i_img_tags *tags, char const *name, int code,
113 int (*f_i_tags_get_string)(i_img_tags *tags, char const *name, int code,
114 char *value, size_t value_size);
115 int (*f_i_tags_get_color)(i_img_tags *tags, char const *name, int code,
117 int (*f_i_tags_set_color)(i_img_tags *tags, char const *name, int code,
118 i_color const *value);
120 void (*f_i_box)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val);
121 void (*f_i_box_filled)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val);
122 void (*f_i_box_cfill)(i_img *im, int x1, int y1, int x2, int y2, i_fill_t *fill);
123 void (*f_i_line)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val, int endp);
124 void (*f_i_line_aa)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val, int endp);
125 void (*f_i_arc)(i_img *im, int x, int y, float rad, float d1, float d2, const i_color *val);
126 void (*f_i_arc_aa)(i_img *im, double x, double y, double rad, double d1, double d2, const i_color *val);
127 void (*f_i_arc_cfill)(i_img *im, int x, int y, float rad, float d1, float d2, i_fill_t *val);
128 void (*f_i_arc_aa_cfill)(i_img *im, double x, double y, double rad, double d1, double d2, i_fill_t *fill);
129 void (*f_i_circle_aa)(i_img *im, float x, float y, float rad, const i_color *val);
130 int (*f_i_flood_fill)(i_img *im, int seedx, int seedy, const i_color *dcol);
131 int (*f_i_flood_cfill)(i_img *im, int seedx, int seedy, i_fill_t *fill);
133 void (*f_i_copyto)(i_img *im, i_img *src, int x1, int y1, int x2, int y2, int tx, int ty);
134 void (*f_i_copyto_trans)(i_img *im, i_img *src, int x1, int y1, int x2, int y2, int tx, int ty, const i_color *trans);
135 i_img *(*f_i_copy)(i_img *im);
136 int (*f_i_rubthru)(i_img *im, i_img *src, int tx, int ty, int src_minx, int src_miny, int src_maxx, int src_maxy);
138 /* IMAGER_API_LEVEL 2 functions */
139 int (*f_i_set_image_file_limits)(int width, int height, int bytes);
140 int (*f_i_get_image_file_limits)(int *width, int *height, int *bytes);
141 int (*f_i_int_check_image_file_limits)(int width, int height, int channels, int sample_size);
142 int (*f_i_flood_fill_border)(i_img *im, int seedx, int seedy, const i_color *dcol, const i_color *border);
143 int (*f_i_flood_cfill_border)(i_img *im, int seedx, int seedy, i_fill_t *fill, const i_color *border);
145 /* IMAGER_API_LEVEL 3 functions */
146 void (*f_i_img_setmask)(i_img *im, int ch_mask);
147 int (*f_i_img_getmask)(i_img *im);
148 int (*f_i_img_getchannels)(i_img *im);
149 i_img_dim (*f_i_img_get_width)(i_img *im);
150 i_img_dim (*f_i_img_get_height)(i_img *im);
151 void (*f_i_lhead)(const char *file, int line_number);
152 void (*f_i_loog)(int level, const char *msg, ...);
154 /* IMAGER_API_LEVEL 4 functions will be added here */
155 i_img *(*f_i_img_alloc)(void);
156 void (*f_i_img_init)(i_img *);
158 /* IMAGER_API_LEVEL 5 functions will be added here */
159 /* added i_psampf?_bits macros */
160 int (*f_i_img_is_monochrome)(i_img *, int *zero_is_white);
161 int (*f_i_gsamp_bg)(i_img *im, int l, int r, int y, i_sample_t *samples,
162 int out_channels, i_color const * bg);
163 int (*f_i_gsampf_bg)(i_img *im, int l, int r, int y, i_fsample_t *samples,
164 int out_channels, i_fcolor const * bg);
165 void (*f_i_get_file_background)(i_img *im, i_color *bg);
166 void (*f_i_get_file_backgroundf)(i_img *im, i_fcolor *bg);
167 unsigned long (*f_i_utf8_advance)(char const **p, size_t *len);
168 i_render *(*f_i_render_new)(i_img *im, i_img_dim width);
169 void (*f_i_render_delete)(i_render *r);
170 void (*f_i_render_color)(i_render *r, i_img_dim x, i_img_dim y,
171 i_img_dim width, unsigned char const *src,
172 i_color const *color);
173 void (*f_i_render_fill)(i_render *r, i_img_dim x, i_img_dim y,
174 i_img_dim width, unsigned char const *src,
176 void (*f_i_render_line)(i_render *r, i_img_dim x, i_img_dim y,
177 i_img_dim width, const i_sample_t *src,
178 i_color *line, i_fill_combine_f combine);
179 void (*f_i_render_linef)(i_render *r, i_img_dim x, i_img_dim y,
180 i_img_dim width, const double *src,
181 i_fcolor *line, i_fill_combinef_f combine);
183 /* IMAGER_API_LEVEL 6 functions will be added here */
186 #define PERL_FUNCTION_TABLE_NAME "Imager::__ext_func_table"