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);
61 extern i_img *i_sametype_chans(i_img *im, int xsize, int ysize, int channels);
63 i_img *i_img_pal_new(int x, int y, int ch, int maxpal);
65 /* Image feature settings */
67 void i_img_setmask (i_img *im,int ch_mask);
68 int i_img_getmask (i_img *im);
69 int i_img_getchannels(i_img *im);
74 int i_ppix(i_img *im,int x,int y,i_color *val);
75 int i_gpix(i_img *im,int x,int y,i_color *val);
76 int i_ppixf(i_img *im,int x,int y,i_color *val);
77 int i_gpixf(i_img *im,int x,int y,i_color *val);
80 #define i_ppix(im, x, y, val) (((im)->i_f_ppix)((im), (x), (y), (val)))
81 #define i_gpix(im, x, y, val) (((im)->i_f_gpix)((im), (x), (y), (val)))
82 #define i_ppixf(im, x, y, val) (((im)->i_f_ppixf)((im), (x), (y), (val)))
83 #define i_gpixf(im, x, y, val) (((im)->i_f_gpixf)((im), (x), (y), (val)))
86 int i_ppix_d(i_img *im,int x,int y,i_color *val);
87 int i_gpix_d(i_img *im,int x,int y,i_color *val);
88 int i_plin_d(i_img *im,int l, int r, int y, i_color *val);
89 int i_glin_d(i_img *im,int l, int r, int y, i_color *val);
92 #define i_plin(im, l, r, y, val) (((im)->i_f_plin)(im, l, r, y, val))
93 #define i_glin(im, l, r, y, val) (((im)->i_f_glin)(im, l, r, y, val))
94 #define i_plinf(im, l, r, y, val) (((im)->i_f_plinf)(im, l, r, y, val))
95 #define i_glinf(im, l, r, y, val) (((im)->i_f_glinf)(im, l, r, y, val))
97 #define i_gsamp(im, l, r, y, samps, chans, count) \
98 (((im)->i_f_gsamp)((im), (l), (r), (y), (samps), (chans), (count)))
99 #define i_gsampf(im, l, r, y, samps, chans, count) \
100 (((im)->i_f_gsampf)((im), (l), (r), (y), (samps), (chans), (count)))
102 #define i_psamp(im, l, r, y, samps, chans, count) \
103 (((im)->i_f_gsamp)((im), (l), (r), (y), (samps), (chans), (count)))
104 #define i_psampf(im, l, r, y, samps, chans, count) \
105 (((im)->i_f_gsampf)((im), (l), (r), (y), (samps), (chans), (count)))
110 #define i_findcolor(im, color, entry) \
111 (((im)->i_f_findcolor) ? ((im)->i_f_findcolor)((im), (color), (entry)) : 0)
113 #define i_gpal(im, l, r, y, vals) \
114 (((im)->i_f_gpal) ? ((im)->i_f_gpal)((im), (l), (r), (y), (vals)) : 0)
115 #define i_ppal(im, l, r, y, vals) \
116 (((im)->i_f_ppal) ? ((im)->i_f_ppal)((im), (l), (r), (y), (vals)) : 0)
117 #define i_addcolors(im, colors, count) \
118 (((im)->i_f_addcolors) ? ((im)->i_f_addcolors)((im), (colors), (count)) : -1)
119 #define i_getcolors(im, index, color, count) \
120 (((im)->i_f_getcolors) ? \
121 ((im)->i_f_getcolors)((im), (index), (color), (count)) : 0)
122 #define i_setcolors(im, index, color, count) \
123 (((im)->i_f_setcolors) ? \
124 ((im)->i_f_setcolors)((im), (index), (color), (count)) : 0)
125 #define i_colorcount(im) \
126 (((im)->i_f_colorcount) ? ((im)->i_f_colorcount)(im) : -1)
127 #define i_maxcolors(im) \
128 (((im)->i_f_maxcolors) ? ((im)->i_f_maxcolors)(im) : -1)
129 #define i_findcolor(im, color, entry) \
130 (((im)->i_f_findcolor) ? ((im)->i_f_findcolor)((im), (color), (entry)) : 0)
132 #define i_img_virtual(im) ((im)->virtual)
133 #define i_img_type(im) ((im)->type)
134 #define i_img_bits(im) ((im)->bits)
139 typedef void (*i_fill_with_color_f)
140 (struct i_fill_tag *fill, int x, int y, int width, int channels,
142 typedef void (*i_fill_with_fcolor_f)
143 (struct i_fill_tag *fill, int x, int y, int width, int channels,
145 typedef void (*i_fill_destroy_f)(struct i_fill_tag *fill);
146 typedef void (*i_fill_combine_f)(i_color *out, i_color *in, int channels,
148 typedef void (*i_fill_combinef_f)(i_fcolor *out, i_fcolor *in, int channels,
152 typedef struct i_fill_tag
154 /* called for 8-bit/sample image (and maybe lower) */
155 /* this may be NULL, if so call fill_with_fcolor */
156 i_fill_with_color_f fill_with_color;
158 /* called for other sample sizes */
159 /* this must be non-NULL */
160 i_fill_with_fcolor_f fill_with_fcolor;
162 /* called if non-NULL to release any extra resources */
163 i_fill_destroy_f destroy;
165 /* if non-zero the caller will fill data with the original data
167 i_fill_combine_f combine;
168 i_fill_combinef_f combinef;
187 extern i_fill_t *i_new_fill_solidf(i_fcolor *c, int combine);
188 extern i_fill_t *i_new_fill_solid(i_color *c, int combine);
190 i_new_fill_hatch(i_color *fg, i_color *bg, int combine, int hatch,
191 unsigned char *cust_hatch, int dx, int dy);
193 i_new_fill_hatchf(i_fcolor *fg, i_fcolor *bg, int combine, int hatch,
194 unsigned char *cust_hatch, int dx, int dy);
196 i_new_fill_image(i_img *im, double *matrix, int xoff, int yoff, int combine);
197 extern void i_fill_destroy(i_fill_t *fill);
199 float i_gpix_pch(i_img *im,int x,int y,int ch);
201 /* functions for drawing primitives */
203 void i_box (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
204 void i_box_filled (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
205 void i_box_cfill(i_img *im, int x1, int y1, int x2, int y2, i_fill_t *fill);
206 void i_draw (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
207 void i_line_aa (i_img *im,int x1,int y1,int x2,int y2,i_color *val);
208 void i_arc (i_img *im,int x,int y,float rad,float d1,float d2,i_color *val);
209 void i_arc_cfill(i_img *im,int x,int y,float rad,float d1,float d2,i_fill_t *fill);
210 void i_circle_aa (i_img *im,float x, float y,float rad,i_color *val);
211 void i_copyto (i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty);
212 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);
213 void i_copy (i_img *im,i_img *src);
214 int i_rubthru (i_img *im,i_img *src,int tx,int ty);
216 undef_int i_flipxy (i_img *im, int direction);
217 extern i_img *i_rotate90(i_img *im, int degrees);
218 extern i_img *i_rotate_exact(i_img *im, double amount);
219 extern i_img *i_matrix_transform(i_img *im, int xsize, int ysize, double *matrix);
221 void i_bezier_multi(i_img *im,int l,double *x,double *y,i_color *val);
222 void i_poly_aa (i_img *im,int l,double *x,double *y,i_color *val);
223 void i_poly_aa_cfill(i_img *im,int l,double *x,double *y,i_fill_t *fill);
225 void i_flood_fill (i_img *im,int seedx,int seedy,i_color *dcol);
227 /* image processing functions */
229 void i_gaussian (i_img *im,float stdev);
230 void i_conv (i_img *im,float *coeff,int len);
231 void i_unsharp_mask(i_img *im, double stddev, double scale);
233 /* colour manipulation */
234 extern int i_convert(i_img *im, i_img *src, float *coeff, int outchan, int inchan);
235 extern void i_map(i_img *im, unsigned char (*maps)[256], unsigned int mask);
237 float i_img_diff (i_img *im1,i_img *im2);
241 undef_int i_init_fonts( int t1log );
246 undef_int i_init_t1( int t1log );
247 int i_t1_new( char *pfb, char *afm );
248 int i_t1_destroy( int font_id );
249 undef_int i_t1_cp( i_img *im, int xb, int yb, int channel, int fontnum, float points, char* str, int len, int align );
250 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 );
251 void i_t1_bbox( int fontnum, float point, char *str, int len, int cords[6] );
252 void i_t1_set_aa( int st );
253 void close_t1( void );
259 #include <freetype.h>
262 struct TT_Instancehandle_ {
263 TT_Instance instance;
264 TT_Instance_Metrics imetrics;
265 TT_Glyph_Metrics gmetrics[256];
266 TT_Glyph glyphs[256];
272 typedef struct TT_Instancehandle_ TT_Instancehandle;
274 struct TT_Fonthandle_ {
276 TT_Face_Properties properties;
277 TT_Instancehandle instanceh[TT_CHC];
281 typedef struct TT_Fonthandle_ TT_Fonthandle;
285 undef_int i_init_tt( void );
286 TT_Fonthandle* i_tt_new(char *fontname);
287 void i_tt_destroy( TT_Fonthandle *handle );
288 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);
289 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);
290 undef_int i_tt_bbox( TT_Fonthandle *handle, float points,char *txt,int len,int cords[6]);
293 #endif /* End of freetype headers */
297 typedef struct FT2_Fonthandle FT2_Fonthandle;
298 extern int i_ft2_init(void);
299 extern FT2_Fonthandle * i_ft2_new(char *name, int index);
300 extern void i_ft2_destroy(FT2_Fonthandle *handle);
301 extern int i_ft2_setdpi(FT2_Fonthandle *handle, int xdpi, int ydpi);
302 extern int i_ft2_getdpi(FT2_Fonthandle *handle, int *xdpi, int *ydpi);
303 extern int i_ft2_settransform(FT2_Fonthandle *handle, double *matrix);
304 extern int i_ft2_sethinting(FT2_Fonthandle *handle, int hinting);
305 extern int i_ft2_bbox(FT2_Fonthandle *handle, double cheight, double cwidth,
306 char *text, int len, int *bbox, int utf8);
307 extern int i_ft2_text(FT2_Fonthandle *handle, i_img *im, int tx, int ty,
308 i_color *cl, double cheight, double cwidth,
309 char *text, int len, int align, int aa, int vlayout,
311 extern int i_ft2_cp(FT2_Fonthandle *handle, i_img *im, int tx, int ty,
312 int channel, double cheight, double cwidth,
313 char *text, int len, int align, int aa, int vlayout,
315 extern int i_ft2_has_chars(FT2_Fonthandle *handle, char *text, int len,
316 int utf8, char *work);
322 extern int i_wf_bbox(char *face, int size, char *text, int length, int *bbox);
323 extern int i_wf_text(char *face, i_img *im, int tx, int ty, i_color *cl,
324 int size, char *text, int len, int align, int aa);
325 extern int i_wf_cp(char *face, i_img *im, int tx, int ty, int channel,
326 int size, char *text, int len, int align, int aa);
330 /* functions for reading and writing formats */
332 /* general reader callback
333 userdata - data the user passed into the reader
334 buffer - the buffer to fill with data
335 need - the amount of data needed
336 want - the amount of space we have to store data
337 fill buffer and return the number of bytes read, 0 for eof, -1 for error
340 typedef int (*i_read_callback_t)(char *userdata, char *buffer, int need,
343 /* i_gen_reader() translates the low-level requests from whatever library
344 into buffered requests.
345 but the called function can always bypass buffering by only ever
346 reading I<need> bytes.
348 #define CBBUFSIZ 4096
351 i_read_callback_t cb;
353 char buffer[CBBUFSIZ];
358 extern int i_gen_reader(i_gen_read_data *info, char *buffer, int need);
359 extern i_gen_read_data *i_gen_read_data_new(i_read_callback_t cb, char *userdata);
360 extern void i_free_gen_read_data(i_gen_read_data *);
362 /* general writer callback
363 userdata - the data the user passed into the writer
364 data - the data to write
365 data_size - the number of bytes to write
366 write the data, return non-zero on success, zero on failure.
368 typedef int (*i_write_callback_t)(char *userdata, char const *data, int size);
371 i_write_callback_t cb;
373 char buffer[CBBUFSIZ];
378 extern int i_gen_writer(i_gen_write_data *info, char const *data, int size);
379 extern i_gen_write_data *i_gen_write_data_new(i_write_callback_t cb, char *userdata, int maxlength);
380 extern int i_free_gen_write_data(i_gen_write_data *, int flush);
382 /* transparency handling for quantized output */
383 typedef enum i_transp_tag {
384 tr_none, /* ignore any alpha channel */
385 tr_threshold, /* threshold the transparency - uses tr_threshold */
386 tr_errdiff, /* error diffusion */
387 tr_ordered /* an ordered dither */
390 /* controls how we build the colour map */
391 typedef enum i_make_colors_tag {
392 mc_none, /* user supplied colour map only */
393 mc_web_map, /* Use the 216 colour web colour map */
394 mc_addi, /* Addi's algorithm */
395 mc_median_cut, /* median cut - similar to giflib, hopefully */
396 mc_mask = 0xFF /* (mask for generator) */
399 /* controls how we translate the colours */
400 typedef enum i_translate_tag {
401 pt_giflib, /* get gif lib to do it (ignores make_colours) */
402 pt_closest, /* just use the closest match within the hashbox */
403 pt_perturb, /* randomly perturb the data - uses perturb_size*/
404 pt_errdiff /* error diffusion dither - uses errdiff */
407 /* Which error diffusion map to use */
408 typedef enum i_errdiff_tag {
409 ed_floyd, /* floyd-steinberg */
410 ed_jarvis, /* Jarvis, Judice and Ninke */
411 ed_stucki, /* Stucki */
412 ed_custom, /* the map found in ed_map|width|height|orig */
413 ed_mask = 0xFF, /* mask to get the map */
414 ed_bidir = 0x100 /* change direction for each row */
417 /* which ordered dither map to use
418 currently only available for transparency
419 I don't know of a way to do ordered dither of an image against some
422 typedef enum i_ord_dith_tag
424 od_random, /* sort of random */
425 od_dot8, /* large dot */
429 od_slashline, /* / line dither */
430 od_backline, /* \ line dither */
431 od_tiny, /* small checkerbox */
432 od_custom /* custom 8x8 map */
435 typedef struct i_gif_pos_tag {
439 /* passed into i_writegif_gen() to control quantization */
440 typedef struct i_quantize_tag {
441 /* how to handle transparency */
443 /* the threshold at which to make pixels opaque */
445 i_errdiff tr_errdiff;
446 i_ord_dith tr_orddith;
447 unsigned char tr_custom[64];
449 /* how to make the colour map */
450 i_make_colors make_colors;
452 /* any existing colours
453 mc_existing is an existing colour table
454 mc_count is the number of existing colours
455 mc_size is the total size of the array that mc_existing points
456 at - this must be at least 256
462 /* how we translate the colours */
463 i_translate translate;
465 /* the error diffusion map to use if translate is mc_errdiff */
467 /* the following define the error diffusion values to use if
468 errdiff is ed_custom. ed_orig is the column on the top row that
469 represents the current
472 int ed_width, ed_height, ed_orig;
474 /* the amount of perturbation to use for translate is mc_perturb */
478 typedef struct i_gif_opts {
479 /* each image has a local color map */
482 /* images are interlaced */
485 /* time for which image is displayed
495 int user_input_count;
496 char *user_input_flags;
503 /* this is added to the color table when we make an image transparent */
506 /* image positions */
508 i_gif_pos *positions;
510 /* Netscape loop extension - number of loops */
513 /* should be eliminate unused colors? */
514 int eliminate_unused;
517 extern void quant_makemap(i_quantize *quant, i_img **imgs, int count);
518 extern i_palidx *quant_translate(i_quantize *quant, i_img *img);
519 extern void quant_transparent(i_quantize *quant, i_palidx *indices, i_img *img, i_palidx trans_index);
521 extern i_img *i_img_pal_new(int x, int y, int channels, int maxpal);
522 extern i_img *i_img_pal_new_low(i_img *im, int x, int y, int channels, int maxpal);
523 extern i_img *i_img_to_pal(i_img *src, i_quantize *quant);
524 extern i_img *i_img_to_rgb(i_img *src);
525 extern i_img *i_img_masked_new(i_img *targ, i_img *mask, int x, int y,
527 extern i_img *i_img_16_new(int x, int y, int ch);
528 extern i_img *i_img_16_new_low(i_img *im, int x, int y, int ch);
529 extern i_img *i_img_double_new(int x, int y, int ch);
530 extern i_img *i_img_double_new_low(i_img *im, int x, int y, int ch);
534 i_readjpeg_wiol(io_glue *ig, int length, char** iptc_itext, int *itlength);
535 undef_int i_writejpeg_wiol(i_img *im, io_glue *ig, int qfactor);
536 #endif /* HAVE_LIBJPEG */
539 i_img * i_readtiff_wiol(io_glue *ig, int length);
540 i_img ** i_readtiff_multi_wiol(io_glue *ig, int length, int *count);
541 undef_int i_writetiff_wiol(i_img *im, io_glue *ig);
542 undef_int i_writetiff_multi_wiol(io_glue *ig, i_img **imgs, int count);
543 undef_int i_writetiff_wiol_faxable(i_img *im, io_glue *ig, int fine);
544 undef_int i_writetiff_multi_wiol_faxable(io_glue *ig, i_img **imgs, int count, int fine);
546 #endif /* HAVE_LIBTIFF */
549 i_img *i_readpng_wiol(io_glue *ig, int length);
550 undef_int i_writepng_wiol(i_img *im, io_glue *ig);
551 #endif /* HAVE_LIBPNG */
554 i_img *i_readgif(int fd, int **colour_table, int *colours);
555 i_img *i_readgif_wiol(io_glue *ig, int **colour_table, int *colours);
556 i_img *i_readgif_scalar(char *data, int length, int **colour_table, int *colours);
557 i_img *i_readgif_callback(i_read_callback_t callback, char *userdata, int **colour_table, int *colours);
558 extern i_img **i_readgif_multi(int fd, int *count);
559 extern i_img **i_readgif_multi_scalar(char *data, int length, int *count);
560 extern i_img **i_readgif_multi_callback(i_read_callback_t callback, char *userdata, int *count);
561 extern i_img **i_readgif_multi_wiol(io_glue *ig, int *count);
562 undef_int i_writegif(i_img *im,int fd,int colors,int pixdev,int fixedlen,i_color fixed[]);
563 undef_int i_writegifmc(i_img *im,int fd,int colors);
564 undef_int i_writegifex(i_img *im,int fd);
565 undef_int i_writegif_gen(i_quantize *quant, int fd, i_img **imgs, int count);
566 undef_int i_writegif_callback(i_quantize *quant, i_write_callback_t cb, char *userdata, int maxbuffer, i_img **imgs, int count);
567 undef_int i_writegif_wiol(io_glue *ig, i_quantize *quant,
568 i_img **imgs, int count);
569 void i_qdist(i_img *im);
571 #endif /* HAVE_LIBGIF */
573 i_img * i_readraw_wiol(io_glue *ig, int x, int y, int datachannels, int storechannels, int intrl);
574 undef_int i_writeraw_wiol(i_img* im, io_glue *ig);
576 i_img * i_readpnm_wiol(io_glue *ig, int length);
577 undef_int i_writeppm_wiol(i_img *im, io_glue *ig);
579 extern int i_writebmp_wiol(i_img *im, io_glue *ig);
580 extern i_img *i_readbmp_wiol(io_glue *ig);
582 i_img * i_readtga_wiol(io_glue *ig, int length);
583 undef_int i_writetga_wiol(i_img *img, io_glue *ig, int wierdpack, int compress, char *idstring, size_t idlen);
585 i_img * i_readrgb_wiol(io_glue *ig, int length);
586 undef_int i_writergb_wiol(i_img *img, io_glue *ig, int wierdpack, int compress, char *idstring, size_t idlen);
588 i_img * i_scaleaxis(i_img *im, float Value, int Axis);
589 i_img * i_scale_nn(i_img *im, float scx, float scy);
590 i_img * i_haar(i_img *im);
591 int i_count_colors(i_img *im,int maxc);
593 i_img * i_transform(i_img *im, int *opx,int opxl,int *opy,int opyl,double parm[],int parmlen);
596 i_img * i_transform2(int width, int height, int channels,
597 struct rm_op *ops, int ops_count,
598 double *n_regs, int n_regs_count,
599 i_color *c_regs, int c_regs_count,
600 i_img **in_imgs, int in_imgs_count);
604 void i_contrast(i_img *im, float intensity);
605 void i_hardinvert(i_img *im);
606 void i_noise(i_img *im, float amount, unsigned char type);
607 void i_bumpmap(i_img *im,i_img *bump,int channel,int light_x,int light_y,int strength);
608 void i_bumpmap_complex(i_img *im, i_img *bump, int channel, int tx, int ty, float Lx, float Ly,
609 float Lz, float cd, float cs, float n, i_color *Ia, i_color *Il, i_color *Is);
610 void i_postlevels(i_img *im,int levels);
611 void i_mosaic(i_img *im,int size);
612 void i_watermark(i_img *im,i_img *wmark,int tx,int ty,int pixdiff);
613 void i_autolevels(i_img *im,float lsat,float usat,float skew);
614 void i_radnoise(i_img *im,int xo,int yo,float rscale,float ascale);
615 void i_turbnoise(i_img *im,float xo,float yo,float scale);
616 void i_gradgen(i_img *im, int num, int *xo, int *yo, i_color *ival, int dmeasure);
617 void i_nearest_color(i_img *im, int num, int *xo, int *yo, i_color *ival, int dmeasure);
618 i_img *i_diff_image(i_img *im, i_img *im2, int mindist);
626 } i_fountain_seg_type;
634 double start, middle, end;
636 i_fountain_seg_type type;
637 i_fountain_color color;
661 void i_fountain(i_img *im, double xa, double ya, double xb, double yb,
662 i_fountain_type type, i_fountain_repeat repeat,
663 int combine, int super_sample, double ssample_param,
664 int count, i_fountain_seg *segs);
666 i_new_fill_fount(double xa, double ya, double xb, double yb,
667 i_fountain_type type, i_fountain_repeat repeat,
668 int combine, int super_sample, double ssample_param,
669 int count, i_fountain_seg *segs);
671 /* Debug only functions */
673 void malloc_state( void );
675 /* this is sort of obsolete now */
678 undef_int (*i_has_format)(char *frmt);
679 i_color*(*ICL_set)(i_color *cl,unsigned char r,unsigned char g,unsigned char b,unsigned char a);
680 void (*ICL_info)(i_color *cl);
682 i_img*(*i_img_new)( void );
683 i_img*(*i_img_empty)(i_img *im,int x,int y);
684 i_img*(*i_img_empty_ch)(i_img *im,int x,int y,int ch);
685 void(*i_img_exorcise)(i_img *im);
687 void(*i_img_info)(i_img *im,int *info);
689 void(*i_img_setmask)(i_img *im,int ch_mask);
690 int (*i_img_getmask)(i_img *im);
693 int (*i_ppix)(i_img *im,int x,int y,i_color *val);
694 int (*i_gpix)(i_img *im,int x,int y,i_color *val);
696 void(*i_box)(i_img *im,int x1,int y1,int x2,int y2,i_color *val);
697 void(*i_draw)(i_img *im,int x1,int y1,int x2,int y2,i_color *val);
698 void(*i_arc)(i_img *im,int x,int y,float rad,float d1,float d2,i_color *val);
699 void(*i_copyto)(i_img *im,i_img *src,int x1,int y1,int x2,int y2,int tx,int ty);
700 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);
701 int(*i_rubthru)(i_img *im,i_img *src,int tx,int ty);
706 see error.c for documentation
707 the error information is currently global
714 typedef void (*i_error_cb)(int code, char const *msg);
715 typedef void (*i_failed_cb)(i_errmsg *msgs);
716 extern i_error_cb i_set_error_cb(i_error_cb);
717 extern i_failed_cb i_set_failed_cb(i_failed_cb);
718 extern void i_set_argv0(char const *);
719 extern int i_set_errors_fatal(int new_fatal);
720 extern i_errmsg *i_errors(void);
722 extern void i_push_error(int code, char const *msg);
723 extern void i_push_errorf(int code, char const *fmt, ...);
724 extern void i_push_errorvf(int code, char const *fmt, va_list);
725 extern void i_clear_error(void);
726 extern int i_failed(int code, char const *msg);
728 /* image tag processing */
729 extern void i_tags_new(i_img_tags *tags);
730 extern int i_tags_addn(i_img_tags *tags, char const *name, int code,
732 extern int i_tags_add(i_img_tags *tags, char const *name, int code,
733 char const *data, int size, int idata);
734 extern void i_tags_destroy(i_img_tags *tags);
735 extern int i_tags_find(i_img_tags *tags, char const *name, int start,
737 extern int i_tags_findn(i_img_tags *tags, int code, int start, int *entry);
738 extern int i_tags_delete(i_img_tags *tags, int entry);
739 extern int i_tags_delbyname(i_img_tags *tags, char const *name);
740 extern int i_tags_delbycode(i_img_tags *tags, int code);
741 extern int i_tags_get_float(i_img_tags *tags, char const *name, int code,
743 extern int i_tags_set_float(i_img_tags *tags, char const *name, int code,
745 extern int i_tags_get_int(i_img_tags *tags, char const *name, int code,
747 extern int i_tags_get_string(i_img_tags *tags, char const *name, int code,
748 char *value, size_t value_size);
749 extern int i_tags_get_color(i_img_tags *tags, char const *name, int code,
751 extern int i_tags_set_color(i_img_tags *tags, char const *name, int code,
752 i_color const *value);
753 extern void i_tags_print(i_img_tags *tags);