]> git.imager.perl.org - imager.git/blob - imexttypes.h
put the prototypes line in the right place
[imager.git] / imexttypes.h
1 #ifndef IMAGER_IMEXTTYPES_H_
2 #define IMAGER_IMEXTTYPES_H_
3
4 /* keep this file simple - apidocs.perl parses it. */
5
6 #include "imdatatypes.h"
7
8 typedef struct {
9   void * (*f_mymalloc)(int size);
10   void (*f_myfree)(void *block);
11   void * (*f_myrealloc)(void *block, size_t newsize);
12   void* (*f_mymalloc_file_line)(size_t size, char* file, int line);
13   void  (*f_myfree_file_line)(void *p, char*file, int line);
14   void* (*f_myrealloc_file_line)(void *p, size_t newsize, char* file,int line);
15
16   i_img *(*f_i_img_8_new)(int xsize, int ysize, int channels);
17   i_img *(*f_i_img_16_new)(int xsize, int ysize, int channels);
18   i_img *(*f_i_img_double_new)(int xsize, int ysize, int channels);
19   i_img *(*f_i_img_pal_new)(int xsize, int ysize, int channels, int maxpal);
20   void (*f_i_img_destroy)(i_img *im);
21   i_img *(*f_i_sametype)(i_img *im, int xsize, int ysize);
22   i_img *(*f_i_sametype_chans)(i_img *im, int xsize, int ysize, int channels);
23   void (*f_i_img_info)(i_img *im, int *info);
24
25   int (*f_i_ppix)(i_img *im, int x, int y, const i_color *val);
26   int (*f_i_gpix)(i_img *im, int x, int y, i_color *val);
27   int (*f_i_ppixf)(i_img *im, int x, int y, const i_fcolor *val);
28   int (*f_i_gpixf)(i_img *im, int x, int y, i_fcolor *val);
29   int (*f_i_plin)(i_img *im, int l, int r, int y, const i_color *vals);
30   int (*f_i_glin)(i_img *im, int l, int r, int y, i_color *vals);
31   int (*f_i_plinf)(i_img *im, int l, int r, int y, const i_fcolor *vals);
32   int (*f_i_glinf)(i_img *im, int l, int r, int y, i_fcolor *vals);
33   int (*f_i_gsamp)(i_img *im, int l, int r, int y, i_sample_t *samp, 
34                    const int *chans, int chan_count);
35   int (*f_i_gsampf)(i_img *im, int l, int r, int y, i_fsample_t *samp, 
36                    const int *chans, int chan_count);
37   int (*f_i_gpal)(i_img *im, int x, int r, int y, i_palidx *vals);
38   int (*f_i_ppal)(i_img *im, int x, int r, int y, const i_palidx *vals);
39   int (*f_i_addcolors)(i_img *im, const i_color *colors, int count);
40   int (*f_i_getcolors)(i_img *im, int i, i_color *, int count);
41   int (*f_i_colorcount)(i_img *im);
42   int (*f_i_maxcolors)(i_img *im);
43   int (*f_i_findcolor)(i_img *im, const i_color *color, i_palidx *entry);
44   int (*f_i_setcolors)(i_img *im, int index, const i_color *colors, 
45                        int count);
46
47   i_fill_t *(*f_i_new_fill_solid)(const i_color *c, int combine);
48   i_fill_t *(*f_i_new_fill_solidf)(const i_fcolor *c, int combine);
49
50   i_fill_t *(*f_i_new_fill_hatch)(const i_color *fg, const i_color *bg, int combine, 
51                                   int hatch, const unsigned char *cust_hatch, 
52                                   int dx, int dy);
53   i_fill_t *(*f_i_new_fill_hatchf)(const i_fcolor *fg, const i_fcolor *bg, int combine, 
54                                   int hatch, const unsigned char *cust_hatch, 
55                                   int dx, int dy);
56   i_fill_t *(*f_i_new_fill_image)(i_img *im, const double *matrix, int xoff, 
57                                 int yoff, int combine);
58   i_fill_t *(*f_i_new_fill_fount)(double xa, double ya, double xb, double yb, 
59                  i_fountain_type type, i_fountain_repeat repeat, 
60                  int combine, int super_sample, double ssample_param, 
61                  int count, i_fountain_seg *segs);  
62
63   void (*f_i_fill_destroy)(i_fill_t *fill);
64
65   void (*f_i_quant_makemap)(i_quantize *quant, i_img **imgs, int count);
66   i_palidx * (*f_i_quant_translate)(i_quantize *quant, i_img *img);
67   void (*f_i_quant_transparent)(i_quantize *quant, i_palidx *indices, 
68                                 i_img *img, i_palidx trans_index);
69
70   void (*f_i_clear_error)(void);
71   void (*f_i_push_error)(int code, char const *msg);
72   void (*f_i_push_errorf)(int code, char const *fmt, ...);
73   void (*f_i_push_errorvf)(int code, char const *fmt, va_list);
74   
75   void (*f_i_tags_new)(i_img_tags *tags);
76   int (*f_i_tags_set)(i_img_tags *tags, char const *name, char const *data, 
77                       int size);
78   int (*f_i_tags_setn)(i_img_tags *tags, char const *name, int idata);
79   void (*f_i_tags_destroy)(i_img_tags *tags);
80   int (*f_i_tags_find)(i_img_tags *tags, char const *name, int start, 
81                        int *entry);
82   int (*f_i_tags_findn)(i_img_tags *tags, int code, int start, int *entry);
83   int (*f_i_tags_delete)(i_img_tags *tags, int entry);
84   int (*f_i_tags_delbyname)(i_img_tags *tags, char const *name);
85   int (*f_i_tags_delbycode)(i_img_tags *tags, int code);
86   int (*f_i_tags_get_float)(i_img_tags *tags, char const *name, int code, 
87                             double *value);
88   int (*f_i_tags_set_float)(i_img_tags *tags, char const *name, int code, 
89                             double value);
90   int (*f_i_tags_set_float2)(i_img_tags *tags, char const *name, int code,
91                              double value, int places);
92   int (*f_i_tags_get_int)(i_img_tags *tags, char const *name, int code, 
93                           int *value);
94   int (*f_i_tags_get_string)(i_img_tags *tags, char const *name, int code,
95                              char *value, size_t value_size);
96   int (*f_i_tags_get_color)(i_img_tags *tags, char const *name, int code,
97                             i_color *value);
98   int (*f_i_tags_set_color)(i_img_tags *tags, char const *name, int code,
99                             i_color const *value);
100
101   void (*f_i_box)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val);
102   void (*f_i_box_filled)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val);
103   void (*f_i_box_cfill)(i_img *im, int x1, int y1, int x2, int y2, i_fill_t *fill);
104   void (*f_i_line)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val, int endp);
105   void (*f_i_line_aa)(i_img *im, int x1, int y1, int x2, int y2, const i_color *val, int endp);
106   void (*f_i_arc)(i_img *im, int x, int y, float rad, float d1, float d2, const i_color *val);
107   void (*f_i_arc_aa)(i_img *im, double x, double y, double rad, double d1, double d2, const i_color *val);
108   void (*f_i_arc_cfill)(i_img *im, int x, int y, float rad, float d1, float d2, i_fill_t *val);
109   void (*f_i_arc_aa_cfill)(i_img *im, double x, double y, double rad, double d1, double d2, i_fill_t *fill);
110   void (*f_i_circle_aa)(i_img *im, float x, float y, float rad, const i_color *val);
111   int (*f_i_flood_fill)(i_img *im, int seedx, int seedy, const i_color *dcol);
112   int (*f_i_flood_cfill)(i_img *im, int seedx, int seedy, i_fill_t *fill);
113
114   void (*f_i_copyto)(i_img *im, i_img *src, int x1, int y1, int x2, int y2, int tx, int ty);
115   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);
116   i_img *(*f_i_copy)(i_img *im);
117   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);
118 } im_ext_funcs;
119
120 #define PERL_FUNCTION_TABLE_NAME "Imager::__ext_func_table"
121
122 #endif