23 #define PI 3.14159265358979323846
27 #define MAXINT 2147483647
30 #include "datatypes.h"
32 undef_int i_has_format(char *frmt);
34 /* constructors and destructors */
36 i_color *ICL_new_internal( unsigned char r,unsigned char g,unsigned char b,unsigned char a);
37 i_color *ICL_set_internal(i_color *cl,unsigned char r,unsigned char g,unsigned char b,unsigned char a);
38 void ICL_info (i_color *cl);
39 void ICL_DESTROY (i_color *cl);
40 void ICL_add (i_color *dst, i_color *src, int ch);
42 extern i_fcolor *i_fcolor_new(double r, double g, double b, double a);
43 extern void i_fcolor_destroy(i_fcolor *cl);
45 extern void i_rgb_to_hsvf(i_fcolor *color);
46 extern void i_hsv_to_rgbf(i_fcolor *color);
47 extern void i_rgb_to_hsv(i_color *color);
48 extern void i_hsv_to_rgb(i_color *color);
50 i_img *IIM_new(int x,int y,int ch);
51 void IIM_DESTROY(i_img *im);
52 i_img *i_img_new( void );
53 i_img *i_img_empty(i_img *im,int x,int y);
54 i_img *i_img_empty_ch(i_img *im,int x,int y,int ch);
55 void i_img_exorcise(i_img *im);
56 void i_img_destroy(i_img *im);
58 void i_img_info(i_img *im,int *info);
60 extern i_img *i_sametype(i_img *im, int xsize, int ysize);
62 i_img *i_img_pal_new(int x, int y, int ch, int maxpal);
64 /* Image feature settings */
66 void i_img_setmask (i_img *im,int ch_mask);
67 int i_img_getmask (i_img *im);
68 int i_img_getchannels(i_img *im);
73 int i_ppix(i_img *im,int x,int y,i_color *val);
74 int i_gpix(i_img *im,int x,int y,i_color *val);
75 int i_ppixf(i_img *im,int x,int y,i_color *val);
76 int i_gpixf(i_img *im,int x,int y,i_color *val);
79 #define i_ppix(im, x, y, val) (((im)->i_f_ppix)((im), (x), (y), (val)))
80 #define i_gpix(im, x, y, val) (((im)->i_f_gpix)((im), (x), (y), (val)))
81 #define i_ppixf(im, x, y, val) (((im)->i_f_ppixf)((im), (x), (y), (val)))
82 #define i_gpixf(im, x, y, val) (((im)->i_f_gpixf)((im), (x), (y), (val)))
85 int i_ppix_d(i_img *im,int x,int y,i_color *val);
86 int i_gpix_d(i_img *im,int x,int y,i_color *val);
87 int i_plin_d(i_img *im,int l, int r, int y, i_color *val);
88 int i_glin_d(i_img *im,int l, int r, int y, i_color *val);
91 #define i_plin(im, l, r, y, val) (((im)->i_f_plin)(im, l, r, y, val))
92 #define i_glin(im, l, r, y, val) (((im)->i_f_glin)(im, l, r, y, val))
93 #define i_plinf(im, l, r, y, val) (((im)->i_f_plinf)(im, l, r, y, val))
94 #define i_glinf(im, l, r, y, val) (((im)->i_f_glinf)(im, l, r, y, val))
96 #define i_gsamp(im, l, r, y, samps, chans, count) \
97 (((im)->i_f_gsamp)((im), (l), (r), (y), (samps), (chans), (count)))
98 #define i_gsampf(im, l, r, y, samps, chans, count) \
99 (((im)->i_f_gsampf)((im), (l), (r), (y), (samps), (chans), (count)))
101 #define i_psamp(im, l, r, y, samps, chans, count) \
102 (((im)->i_f_gsamp)((im), (l), (r), (y), (samps), (chans), (count)))
103 #define i_psampf(im, l, r, y, samps, chans, count) \
104 (((im)->i_f_gsampf)((im), (l), (r), (y), (samps), (chans), (count)))
109 #define i_findcolor(im, color, entry) \
110 (((im)->i_f_findcolor) ? ((im)->i_f_findcolor)((im), (color), (entry)) : 0)
112 #define i_gpal(im, l, r, y, vals) \
113 (((im)->i_f_gpal) ? ((im)->i_f_gpal)((im), (l), (r), (y), (vals)) : 0)
114 #define i_ppal(im, l, r, y, vals) \
115 (((im)->i_f_ppal) ? ((im)->i_f_ppal)((im), (l), (r), (y), (vals)) : 0)
116 #define i_addcolors(im, colors, count) \
117 (((im)->i_f_addcolors) ? ((im)->i_f_addcolors)((im), (colors), (count)) : -1)
118 #define i_getcolors(im, index, color, count) \
119 (((im)->i_f_getcolors) ? \
120 ((im)->i_f_getcolors)((im), (index), (color), (count)) : 0)
121 #define i_setcolors(im, index, color, count) \
122 (((im)->i_f_setcolors) ? \
123 ((im)->i_f_setcolors)((im), (index), (color), (count)) : 0)
124 #define i_colorcount(im) \
125 (((im)->i_f_colorcount) ? ((im)->i_f_colorcount)(im) : -1)
126 #define i_maxcolors(im) \
127 (((im)->i_f_maxcolors) ? ((im)->i_f_maxcolors)(im) : -1)
128 #define i_findcolor(im, color, entry) \
129 (((im)->i_f_findcolor) ? ((im)->i_f_findcolor)((im), (color), (entry)) : 0)
131 #define i_img_virtual(im) ((im)->virtual)
132 #define i_img_type(im) ((im)->type)
133 #define i_img_bits(im) ((im)->bits)
138 typedef void (*i_fill_with_color_f)
139 (struct i_fill_tag *fill, int x, int y, int width, int channels,
141 typedef void (*i_fill_with_fcolor_f)
142 (struct i_fill_tag *fill, int x, int y, int width, int channels,
144 typedef void (*i_fill_destroy_f)(struct i_fill_tag *fill);
145 typedef void (*i_fill_combine_f)(i_color *out, i_color *in, int channels,
147 typedef void (*i_fill_combinef_f)(i_fcolor *out, i_fcolor *in, int channels,
151 typedef struct i_fill_tag
153 /* called for 8-bit/sample image (and maybe lower) */
154 /* this may be NULL, if so call fill_with_fcolor */
155 i_fill_with_color_f fill_with_color;
157 /* called for other sample sizes */
158 /* this must be non-NULL */
159 i_fill_with_fcolor_f fill_with_fcolor;
161 /* called if non-NULL to release any extra resources */
162 i_fill_destroy_f destroy;
164 /* if non-zero the caller will fill data with the original data
166 i_fill_combine_f combine;
167 i_fill_combinef_f combinef;
186 extern i_fill_t *i_new_fill_solidf(i_fcolor *c, int combine);
187 extern i_fill_t *i_new_fill_solid(i_color *c, int combine);
189 i_new_fill_hatch(i_color *fg, i_color *bg, int combine, int hatch,
190 unsigned char *cust_hatch, int dx, int dy);
192 i_new_fill_hatchf(i_fcolor *fg, i_fcolor *bg, int combine, int hatch,
193 unsigned char *cust_hatch, int dx, int dy);
195 i_new_fill_image(i_img *im, double *matrix, int xoff, int yoff, int combine);
196 extern void i_fill_destroy(i_fill_t *fill);
198 float i_gpix_pch(i_img *im,int x,int y,int ch);
200 /* functions for drawing primitives */
202 void i_box (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
203 void i_box_filled (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
204 void i_box_cfill(i_img *im, int x1, int y1, int x2, int y2, i_fill_t *fill);
205 void i_draw (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
206 void i_line_aa (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
207 void i_arc (i_img *im,int x,int y,float rad,float d1,float d2,i_color *val);
208 void i_arc_cfill(i_img *im,int x,int y,float rad,float d1,float d2,i_fill_t *fill);
209 void i_circle_aa (i_img *im,float x, float y,float rad,i_color *val);
210 void i_copyto (i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty);
211 void i_copyto_trans(i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty,i_color *trans);
212 void i_copy (i_img *im,i_img *src);
213 int i_rubthru (i_img *im,i_img *src,int tx,int ty);
215 undef_int i_flipxy (i_img *im, int direction);
216 extern i_img *i_rotate90(i_img *im, int degrees);
217 extern i_img *i_rotate_exact(i_img *im, double amount);
218 extern i_img *i_matrix_transform(i_img *im, int xsize, int ysize, double *matrix);
220 void i_bezier_multi(i_img *im,int l,double *x,double *y,i_color *val);
221 void i_poly_aa (i_img *im,int l,double *x,double *y,i_color *val);
222 void i_poly_aa_cfill(i_img *im,int l,double *x,double *y,i_fill_t *fill);
224 void i_flood_fill (i_img *im,int seedx,int seedy,i_color *dcol);
226 /* image processing functions */
228 void i_gaussian (i_img *im,float stdev);
229 void i_conv (i_img *im,float *coeff,int len);
230 void i_unsharp_mask(i_img *im, double stddev, double scale);
232 /* colour manipulation */
233 extern int i_convert(i_img *im, i_img *src, float *coeff, int outchan, int inchan);
234 extern void i_map(i_img *im, unsigned char (*maps)[256], unsigned int mask);
236 float i_img_diff (i_img *im1,i_img *im2);
240 undef_int i_init_fonts( int t1log );
245 undef_int init_t1( int t1log );
246 int i_t1_new( char *pfb, char *afm );
247 int i_t1_destroy( int font_id );
248 undef_int i_t1_cp( i_img *im, int xb, int yb, int channel, int fontnum, float points, char* str, int len, int align );
249 undef_int i_t1_text( i_img *im, int xb, int yb, i_color *cl, int fontnum, float points, char* str, int len, int align );
250 void i_t1_bbox( int fontnum, float point, char *str, int len, int cords[6] );
251 void i_t1_set_aa( int st );
252 void close_t1( void );
258 #include <freetype.h>
261 struct TT_Instancehandle_ {
262 TT_Instance instance;
263 TT_Instance_Metrics imetrics;
264 TT_Glyph_Metrics gmetrics[256];
265 TT_Glyph glyphs[256];
271 typedef struct TT_Instancehandle_ TT_Instancehandle;
273 struct TT_Fonthandle_ {
275 TT_Face_Properties properties;
276 TT_Instancehandle instanceh[TT_CHC];
280 typedef struct TT_Fonthandle_ TT_Fonthandle;
284 undef_int init_tt( void );
285 TT_Fonthandle* i_tt_new(char *fontname);
286 void i_tt_destroy( TT_Fonthandle *handle );
287 undef_int i_tt_cp( TT_Fonthandle *handle,i_img *im,int xb,int yb,int channel,float points,char* txt,int len,int smooth);
288 undef_int i_tt_text( TT_Fonthandle *handle, i_img *im, int xb, int yb, i_color *cl, float points, char* txt, int len, int smooth);
289 undef_int i_tt_bbox( TT_Fonthandle *handle, float points,char *txt,int len,int cords[6]);
292 #endif /* End of freetype headers */
296 typedef struct FT2_Fonthandle FT2_Fonthandle;
297 extern int i_ft2_init(void);
298 extern FT2_Fonthandle * i_ft2_new(char *name, int index);
299 extern void i_ft2_destroy(FT2_Fonthandle *handle);
300 extern int i_ft2_setdpi(FT2_Fonthandle *handle, int xdpi, int ydpi);
301 extern int i_ft2_getdpi(FT2_Fonthandle *handle, int *xdpi, int *ydpi);
302 extern int i_ft2_settransform(FT2_Fonthandle *handle, double *matrix);
303 extern int i_ft2_sethinting(FT2_Fonthandle *handle, int hinting);
304 extern int i_ft2_bbox(FT2_Fonthandle *handle, double cheight, double cwidth,
305 char *text, int len, int *bbox, int utf8);
306 extern int i_ft2_text(FT2_Fonthandle *handle, i_img *im, int tx, int ty,
307 i_color *cl, double cheight, double cwidth,
308 char *text, int len, int align, int aa, int vlayout,
310 extern int i_ft2_cp(FT2_Fonthandle *handle, i_img *im, int tx, int ty,
311 int channel, double cheight, double cwidth,
312 char *text, int len, int align, int aa, int vlayout,
314 extern int i_ft2_has_chars(FT2_Fonthandle *handle, char *text, int len,
315 int utf8, char *work);
321 extern int i_wf_bbox(char *face, int size, char *text, int length, int *bbox);
322 extern int i_wf_text(char *face, i_img *im, int tx, int ty, i_color *cl,
323 int size, char *text, int len, int align, int aa);
324 extern int i_wf_cp(char *face, i_img *im, int tx, int ty, int channel,
325 int size, char *text, int len, int align, int aa);
329 /* functions for reading and writing formats */
331 /* general reader callback
332 userdata - data the user passed into the reader
333 buffer - the buffer to fill with data
334 need - the amount of data needed
335 want - the amount of space we have to store data
336 fill buffer and return the number of bytes read, 0 for eof, -1 for error
339 typedef int (*i_read_callback_t)(char *userdata, char *buffer, int need,
342 /* i_gen_reader() translates the low-level requests from whatever library
343 into buffered requests.
344 but the called function can always bypass buffering by only ever
345 reading I<need> bytes.
347 #define CBBUFSIZ 4096
350 i_read_callback_t cb;
352 char buffer[CBBUFSIZ];
357 extern int i_gen_reader(i_gen_read_data *info, char *buffer, int need);
358 extern i_gen_read_data *i_gen_read_data_new(i_read_callback_t cb, char *userdata);
359 extern void free_gen_read_data(i_gen_read_data *);
361 /* general writer callback
362 userdata - the data the user passed into the writer
363 data - the data to write
364 data_size - the number of bytes to write
365 write the data, return non-zero on success, zero on failure.
367 typedef int (*i_write_callback_t)(char *userdata, char const *data, int size);
370 i_write_callback_t cb;
372 char buffer[CBBUFSIZ];
377 extern int i_gen_writer(i_gen_write_data *info, char const *data, int size);
378 extern i_gen_write_data *i_gen_write_data_new(i_write_callback_t cb, char *userdata, int maxlength);
379 extern int free_gen_write_data(i_gen_write_data *, int flush);
381 /* transparency handling for quantized output */
382 typedef enum i_transp_tag {
383 tr_none, /* ignore any alpha channel */
384 tr_threshold, /* threshold the transparency - uses tr_threshold */
385 tr_errdiff, /* error diffusion */
386 tr_ordered /* an ordered dither */
389 /* controls how we build the colour map */
390 typedef enum i_make_colors_tag {
391 mc_none, /* user supplied colour map only */
392 mc_web_map, /* Use the 216 colour web colour map */
393 mc_addi, /* Addi's algorithm */
394 mc_median_cut, /* median cut - similar to giflib, hopefully */
395 mc_mask = 0xFF /* (mask for generator) */
398 /* controls how we translate the colours */
399 typedef enum i_translate_tag {
400 pt_giflib, /* get gif lib to do it (ignores make_colours) */
401 pt_closest, /* just use the closest match within the hashbox */
402 pt_perturb, /* randomly perturb the data - uses perturb_size*/
403 pt_errdiff /* error diffusion dither - uses errdiff */
406 /* Which error diffusion map to use */
407 typedef enum i_errdiff_tag {
408 ed_floyd, /* floyd-steinberg */
409 ed_jarvis, /* Jarvis, Judice and Ninke */
410 ed_stucki, /* Stucki */
411 ed_custom, /* the map found in ed_map|width|height|orig */
412 ed_mask = 0xFF, /* mask to get the map */
413 ed_bidir = 0x100 /* change direction for each row */
416 /* which ordered dither map to use
417 currently only available for transparency
418 I don't know of a way to do ordered dither of an image against some
421 typedef enum i_ord_dith_tag
423 od_random, /* sort of random */
424 od_dot8, /* large dot */
428 od_slashline, /* / line dither */
429 od_backline, /* \ line dither */
430 od_tiny, /* small checkerbox */
431 od_custom /* custom 8x8 map */
434 typedef struct i_gif_pos_tag {
438 /* passed into i_writegif_gen() to control quantization */
439 typedef struct i_quantize_tag {
440 /* how to handle transparency */
442 /* the threshold at which to make pixels opaque */
444 i_errdiff tr_errdiff;
445 i_ord_dith tr_orddith;
446 unsigned char tr_custom[64];
448 /* how to make the colour map */
449 i_make_colors make_colors;
451 /* any existing colours
452 mc_existing is an existing colour table
453 mc_count is the number of existing colours
454 mc_size is the total size of the array that mc_existing points
455 at - this must be at least 256
461 /* how we translate the colours */
462 i_translate translate;
464 /* the error diffusion map to use if translate is mc_errdiff */
466 /* the following define the error diffusion values to use if
467 errdiff is ed_custom. ed_orig is the column on the top row that
468 represents the current
471 int ed_width, ed_height, ed_orig;
473 /* the amount of perturbation to use for translate is mc_perturb */
477 typedef struct i_gif_opts {
478 /* each image has a local color map */
481 /* images are interlaced */
484 /* time for which image is displayed
494 int user_input_count;
495 char *user_input_flags;
502 /* this is added to the color table when we make an image transparent */
505 /* image positions */
507 i_gif_pos *positions;
509 /* Netscape loop extension - number of loops */
512 /* should be eliminate unused colors? */
513 int eliminate_unused;
516 extern void quant_makemap(i_quantize *quant, i_img **imgs, int count);
517 extern i_palidx *quant_translate(i_quantize *quant, i_img *img);
518 extern void quant_transparent(i_quantize *quant, i_palidx *indices, i_img *img, i_palidx trans_index);
520 extern i_img *i_img_pal_new(int x, int y, int channels, int maxpal);
521 extern i_img *i_img_pal_new_low(i_img *im, int x, int y, int channels, int maxpal);
522 extern i_img *i_img_to_pal(i_img *src, i_quantize *quant);
523 extern i_img *i_img_to_rgb(i_img *src);
524 extern i_img *i_img_masked_new(i_img *targ, i_img *mask, int x, int y,
526 extern i_img *i_img_16_new(int x, int y, int ch);
527 extern i_img *i_img_16_new_low(i_img *im, int x, int y, int ch);
528 extern i_img *i_img_double_new(int x, int y, int ch);
529 extern i_img *i_img_double_new_low(i_img *im, int x, int y, int ch);
533 i_readjpeg_wiol(io_glue *ig, int length, char** iptc_itext, int *itlength);
534 undef_int i_writejpeg_wiol(i_img *im, io_glue *ig, int qfactor);
535 #endif /* HAVE_LIBJPEG */
538 i_img * i_readtiff_wiol(io_glue *ig, int length);
539 i_img ** i_readtiff_multi_wiol(io_glue *ig, int length, int *count);
540 undef_int i_writetiff_wiol(i_img *im, io_glue *ig);
541 undef_int i_writetiff_multi_wiol(io_glue *ig, i_img **imgs, int count);
542 undef_int i_writetiff_wiol_faxable(i_img *im, io_glue *ig, int fine);
543 undef_int i_writetiff_multi_wiol_faxable(io_glue *ig, i_img **imgs, int count, int fine);
545 #endif /* HAVE_LIBTIFF */
548 i_img *i_readpng_wiol(io_glue *ig, int length);
549 undef_int i_writepng_wiol(i_img *im, io_glue *ig);
550 #endif /* HAVE_LIBPNG */
553 i_img *i_readgif(int fd, int **colour_table, int *colours);
554 i_img *i_readgif_wiol(io_glue *ig, int **colour_table, int *colours);
555 i_img *i_readgif_scalar(char *data, int length, int **colour_table, int *colours);
556 i_img *i_readgif_callback(i_read_callback_t callback, char *userdata, int **colour_table, int *colours);
557 extern i_img **i_readgif_multi(int fd, int *count);
558 extern i_img **i_readgif_multi_scalar(char *data, int length, int *count);
559 extern i_img **i_readgif_multi_callback(i_read_callback_t callback, char *userdata, int *count);
560 extern i_img **i_readgif_multi_wiol(io_glue *ig, int *count);
561 undef_int i_writegif(i_img *im,int fd,int colors,int pixdev,int fixedlen,i_color fixed[]);
562 undef_int i_writegifmc(i_img *im,int fd,int colors);
563 undef_int i_writegifex(i_img *im,int fd);
564 undef_int i_writegif_gen(i_quantize *quant, int fd, i_img **imgs, int count);
565 undef_int i_writegif_callback(i_quantize *quant, i_write_callback_t cb, char *userdata, int maxbuffer, i_img **imgs, int count);
566 undef_int i_writegif_wiol(io_glue *ig, i_quantize *quant,
567 i_img **imgs, int count);
568 void i_qdist(i_img *im);
570 #endif /* HAVE_LIBGIF */
572 i_img * i_readraw_wiol(io_glue *ig, int x, int y, int datachannels, int storechannels, int intrl);
573 undef_int i_writeraw_wiol(i_img* im, io_glue *ig);
575 i_img * i_readpnm_wiol(io_glue *ig, int length);
576 undef_int i_writeppm_wiol(i_img *im, io_glue *ig);
578 extern int i_writebmp_wiol(i_img *im, io_glue *ig);
579 extern i_img *i_readbmp_wiol(io_glue *ig);
581 i_img * i_readtga_wiol(io_glue *ig, int length);
582 undef_int i_writetga_wiol(i_img *img, io_glue *ig, int wierdpack, int compress, char *idstring, size_t idlen);
584 i_img * i_readrgb_wiol(io_glue *ig, int length);
585 undef_int i_writergb_wiol(i_img *img, io_glue *ig, int wierdpack, int compress, char *idstring, size_t idlen);
587 i_img * i_scaleaxis(i_img *im, float Value, int Axis);
588 i_img * i_scale_nn(i_img *im, float scx, float scy);
589 i_img * i_haar(i_img *im);
590 int i_count_colors(i_img *im,int maxc);
592 i_img * i_transform(i_img *im, int *opx,int opxl,int *opy,int opyl,double parm[],int parmlen);
595 i_img * i_transform2(int width, int height, int channels,
596 struct rm_op *ops, int ops_count,
597 double *n_regs, int n_regs_count,
598 i_color *c_regs, int c_regs_count,
599 i_img **in_imgs, int in_imgs_count);
603 void i_contrast(i_img *im, float intensity);
604 void i_hardinvert(i_img *im);
605 void i_noise(i_img *im, float amount, unsigned char type);
606 void i_bumpmap(i_img *im,i_img *bump,int channel,int light_x,int light_y,int strength);
607 void i_bumpmap_complex(i_img *im, i_img *bump, int channel, int tx, int ty, float Lx, float Ly,
608 float Lz, float cd, float cs, float n, i_color *Ia, i_color *Il, i_color *Is);
609 void i_postlevels(i_img *im,int levels);
610 void i_mosaic(i_img *im,int size);
611 void i_watermark(i_img *im,i_img *wmark,int tx,int ty,int pixdiff);
612 void i_autolevels(i_img *im,float lsat,float usat,float skew);
613 void i_radnoise(i_img *im,int xo,int yo,float rscale,float ascale);
614 void i_turbnoise(i_img *im,float xo,float yo,float scale);
615 void i_gradgen(i_img *im, int num, int *xo, int *yo, i_color *ival, int dmeasure);
616 void i_nearest_color(i_img *im, int num, int *xo, int *yo, i_color *ival, int dmeasure);
624 } i_fountain_seg_type;
632 double start, middle, end;
634 i_fountain_seg_type type;
635 i_fountain_color color;
659 void i_fountain(i_img *im, double xa, double ya, double xb, double yb,
660 i_fountain_type type, i_fountain_repeat repeat,
661 int combine, int super_sample, double ssample_param,
662 int count, i_fountain_seg *segs);
664 i_new_fill_fount(double xa, double ya, double xb, double yb,
665 i_fountain_type type, i_fountain_repeat repeat,
666 int combine, int super_sample, double ssample_param,
667 int count, i_fountain_seg *segs);
669 /* Debug only functions */
671 void malloc_state( void );
673 /* this is sort of obsolete now */
676 undef_int (*i_has_format)(char *frmt);
677 i_color*(*ICL_set)(i_color *cl,unsigned char r,unsigned char g,unsigned char b,unsigned char a);
678 void (*ICL_info)(i_color *cl);
680 i_img*(*i_img_new)( void );
681 i_img*(*i_img_empty)(i_img *im,int x,int y);
682 i_img*(*i_img_empty_ch)(i_img *im,int x,int y,int ch);
683 void(*i_img_exorcise)(i_img *im);
685 void(*i_img_info)(i_img *im,int *info);
687 void(*i_img_setmask)(i_img *im,int ch_mask);
688 int (*i_img_getmask)(i_img *im);
691 int (*i_ppix)(i_img *im,int x,int y,i_color *val);
692 int (*i_gpix)(i_img *im,int x,int y,i_color *val);
694 void(*i_box)(i_img *im,int x1,int y1,int x2,int y2,i_color *val);
695 void(*i_draw)(i_img *im,int x1,int y1,int x2,int y2,i_color *val);
696 void(*i_arc)(i_img *im,int x,int y,float rad,float d1,float d2,i_color *val);
697 void(*i_copyto)(i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty);
698 void(*i_copyto_trans)(i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty,i_color *trans);
699 int(*i_rubthru)(i_img *im,i_img *src,int tx,int ty);
704 see error.c for documentation
705 the error information is currently global
712 typedef void (*i_error_cb)(int code, char const *msg);
713 typedef void (*i_failed_cb)(i_errmsg *msgs);
714 extern i_error_cb i_set_error_cb(i_error_cb);
715 extern i_failed_cb i_set_failed_cb(i_failed_cb);
716 extern void i_set_argv0(char const *);
717 extern int i_set_errors_fatal(int new_fatal);
718 extern i_errmsg *i_errors(void);
720 extern void i_push_error(int code, char const *msg);
721 extern void i_push_errorf(int code, char const *fmt, ...);
722 extern void i_push_errorvf(int code, char const *fmt, va_list);
723 extern void i_clear_error(void);
724 extern int i_failed(int code, char const *msg);
726 /* image tag processing */
727 extern void i_tags_new(i_img_tags *tags);
728 extern int i_tags_addn(i_img_tags *tags, char const *name, int code,
730 extern int i_tags_add(i_img_tags *tags, char const *name, int code,
731 char const *data, int size, int idata);
732 extern void i_tags_destroy(i_img_tags *tags);
733 extern int i_tags_find(i_img_tags *tags, char const *name, int start,
735 extern int i_tags_findn(i_img_tags *tags, int code, int start, int *entry);
736 extern int i_tags_delete(i_img_tags *tags, int entry);
737 extern int i_tags_delbyname(i_img_tags *tags, char const *name);
738 extern int i_tags_delbycode(i_img_tags *tags, int code);
739 extern int i_tags_get_float(i_img_tags *tags, char const *name, int code,
741 extern int i_tags_set_float(i_img_tags *tags, char const *name, int code,
743 extern int i_tags_get_int(i_img_tags *tags, char const *name, int code,
745 extern int i_tags_get_string(i_img_tags *tags, char const *name, int code,
746 char *value, size_t value_size);
747 extern int i_tags_get_color(i_img_tags *tags, char const *name, int code,
749 extern int i_tags_set_color(i_img_tags *tags, char const *name, int code,
750 i_color const *value);
751 extern void i_tags_print(i_img_tags *tags);