]> git.imager.perl.org - imager.git/blobdiff - imexttypes.h
update desired debian packages
[imager.git] / imexttypes.h
index 13553824ec747da3621ab18c2ac745fb58439f77..0d25c5ef67016f8c1fae1c582e9cfae432b8d8c7 100644 (file)
  readers.  Switching away from calling readcb etc to i_io_read() etc
  should fix your code.
 
+ Version 4 added i_psamp() and i_psampf() pointers to the i_img
+ structure.
+
+ Version 5 changed the return types of i_get_file_background() and
+ i_get_file_backgroundf() from void to int.
+
 */
-#define IMAGER_API_VERSION 3
+#define IMAGER_API_VERSION 5
 
 /*
  IMAGER_API_LEVEL is the level of the structure.  New function pointers
@@ -28,7 +34,7 @@
  will result in an increment of IMAGER_API_LEVEL.
 */
 
-#define IMAGER_API_LEVEL 7
+#define IMAGER_API_LEVEL 10
 
 typedef struct {
   int version;
@@ -42,10 +48,10 @@ typedef struct {
   void  (*f_myfree_file_line)(void *p, char*file, int line);
   void* (*f_myrealloc_file_line)(void *p, size_t newsize, char* file,int line);
 
-  i_img *(*f_i_img_8_new)(i_img_dim xsize, i_img_dim ysize, int channels);
-  i_img *(*f_i_img_16_new)(i_img_dim xsize, i_img_dim ysize, int channels);
-  i_img *(*f_i_img_double_new)(i_img_dim xsize, i_img_dim ysize, int channels);
-  i_img *(*f_i_img_pal_new)(i_img_dim xsize, i_img_dim ysize, int channels, int maxpal);
+  i_img *(*f_i_img_8_new)(i_img_dim xsize, i_img_dim ysize, int channels); /* SKIP */
+  i_img *(*f_i_img_16_new)(i_img_dim xsize, i_img_dim ysize, int channels);  /* SKIP */
+  i_img *(*f_i_img_double_new)(i_img_dim xsize, i_img_dim ysize, int channels); /* SKIP */
+  i_img *(*f_i_img_pal_new)(i_img_dim xsize, i_img_dim ysize, int channels, int maxpal); /* SKIP */
   void (*f_i_img_destroy)(i_img *im);
   i_img *(*f_i_sametype)(i_img *im, i_img_dim xsize, i_img_dim ysize);
   i_img *(*f_i_sametype_chans)(i_img *im, i_img_dim xsize, i_img_dim ysize, int channels);
@@ -96,10 +102,10 @@ typedef struct {
   void (*f_i_quant_transparent)(i_quantize *quant, i_palidx *indices, 
                                 i_img *img, i_palidx trans_index);
 
-  void (*f_i_clear_error)(void);
-  void (*f_i_push_error)(int code, char const *msg);
-  void (*f_i_push_errorf)(int code, char const *fmt, ...);
-  void (*f_i_push_errorvf)(int code, char const *fmt, va_list);
+  void (*f_i_clear_error)(void); /* SKIP */
+  void (*f_i_push_error)(int code, char const *msg); /* SKIP */
+  void (*f_i_push_errorf)(int code, char const *fmt, ...) I_FORMAT_ATTR(2,3);
+  void (*f_i_push_errorvf)(int code, char const *fmt, va_list); /* SKIP */
   
   void (*f_i_tags_new)(i_img_tags *tags);
   int (*f_i_tags_set)(i_img_tags *tags, char const *name, char const *data, 
@@ -146,9 +152,9 @@ typedef struct {
   int (*f_i_rubthru)(i_img *im, i_img *src, i_img_dim tx, i_img_dim ty, i_img_dim src_minx, i_img_dim src_miny, i_img_dim src_maxx, i_img_dim src_maxy);
 
   /* IMAGER_API_LEVEL 2 functions */
-  int (*f_i_set_image_file_limits)(i_img_dim width, i_img_dim height, size_t bytes);
-  int (*f_i_get_image_file_limits)(i_img_dim *width, i_img_dim *height, size_t *bytes);
-  int (*f_i_int_check_image_file_limits)(i_img_dim width, i_img_dim height, int channels, size_t sample_size);
+  int (*f_i_set_image_file_limits)(i_img_dim width, i_img_dim height, size_t bytes); /* SKIP */
+  int (*f_i_get_image_file_limits)(i_img_dim *width, i_img_dim *height, size_t *bytes); /* SKIP */
+  int (*f_i_int_check_image_file_limits)(i_img_dim width, i_img_dim height, int channels, size_t sample_size); /* SKIP */
   int (*f_i_flood_fill_border)(i_img *im, i_img_dim seedx, i_img_dim seedy, const i_color *dcol, const i_color *border);
   int (*f_i_flood_cfill_border)(i_img *im, i_img_dim seedx, i_img_dim seedy, i_fill_t *fill, const i_color *border);
 
@@ -159,11 +165,11 @@ typedef struct {
   i_img_dim (*f_i_img_get_width)(i_img *im);
   i_img_dim (*f_i_img_get_height)(i_img *im);
   void (*f_i_lhead)(const char *file, int line_number);
-  void (*f_i_loog)(int level, const char *msg, ...);
+  void (*f_i_loog)(int level, const char *msg, ...) I_FORMAT_ATTR(2,3);
 
   /* IMAGER_API_LEVEL 4 functions will be added here */
-  i_img *(*f_i_img_alloc)(void);
-  void (*f_i_img_init)(i_img *);
+  i_img *(*f_i_img_alloc)(void); /* SKIP */
+  void (*f_i_img_init)(i_img *); /* SKIP */
 
   /* IMAGER_API_LEVEL 5 functions will be added here */
   /* added i_psampf?_bits macros */
@@ -172,8 +178,8 @@ typedef struct {
                      int out_channels, i_color const * bg);
   int (*f_i_gsampf_bg)(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_fsample_t *samples,
                      int out_channels, i_fcolor const * bg);
-  void (*f_i_get_file_background)(i_img *im, i_color *bg);
-  void (*f_i_get_file_backgroundf)(i_img *im, i_fcolor *bg);
+  int (*f_i_get_file_background)(i_img *im, i_color *bg);
+  int (*f_i_get_file_backgroundf)(i_img *im, i_fcolor *bg);
   unsigned long (*f_i_utf8_advance)(char const **p, size_t *len);
   i_render *(*f_i_render_new)(i_img *im, i_img_dim width);
   void (*f_i_render_delete)(i_render *r);
@@ -204,15 +210,70 @@ typedef struct {
   int (*f_i_io_set_buffered)(io_glue *ig, int buffered);
   ssize_t (*f_i_io_gets)(io_glue *ig, char *, size_t, int);
 
-  i_io_glue_t *(*f_io_new_fd)(int fd);
-  i_io_glue_t *(*f_io_new_bufchain)(void);
-  i_io_glue_t *(*f_io_new_buffer)(const char *data, size_t len, i_io_closebufp_t closecb, void *closedata);
-  i_io_glue_t *(*f_io_new_cb)(void *p, i_io_readl_t readcb, i_io_writel_t writecb, i_io_seekl_t seekcb, i_io_closel_t closecb, i_io_destroyl_t destroycb);
+  i_io_glue_t *(*f_io_new_fd)(int fd); /* SKIP */
+  i_io_glue_t *(*f_io_new_bufchain)(void); /* SKIP */
+  i_io_glue_t *(*f_io_new_buffer)(const char *data, size_t len, i_io_closebufp_t closecb, void *closedata); /* SKIP */
+  i_io_glue_t *(*f_io_new_cb)(void *p, i_io_readl_t readcb, i_io_writel_t writecb, i_io_seekl_t seekcb, i_io_closel_t closecb, i_io_destroyl_t destroycb); /* SKIP */
   size_t (*f_io_slurp)(i_io_glue_t *ig, unsigned char **c);
   void (*f_io_glue_destroy)(i_io_glue_t *ig);
 
-  /* IMAGER_API_LEVEL 8 functions will be added here */
-  
+  /* IMAGER_API_LEVEL 8 */
+  i_img *(*f_im_img_8_new)(im_context_t ctx, i_img_dim xsize, i_img_dim ysize, int channels);
+  i_img *(*f_im_img_16_new)(im_context_t ctx, i_img_dim xsize, i_img_dim ysize, int channels);
+  i_img *(*f_im_img_double_new)(im_context_t ctx, i_img_dim xsize, i_img_dim ysize, int channels);
+  i_img *(*f_im_img_pal_new)(im_context_t ctx, i_img_dim xsize, i_img_dim ysize, int channels, int maxpal);
+
+  void (*f_im_clear_error)(im_context_t ctx);
+  void (*f_im_push_error)(im_context_t ctx, int code, char const *msg);
+  void (*f_im_push_errorvf)(im_context_t ctx, int code, char const *fmt, va_list);
+  void (*f_im_push_errorf)(im_context_t , int code, char const *fmt, ...) I_FORMAT_ATTR(3,4);
+
+  int (*f_im_set_image_file_limits)(im_context_t ctx, i_img_dim width, i_img_dim height, size_t bytes);
+  int (*f_im_get_image_file_limits)(im_context_t ctx, i_img_dim *width, i_img_dim *height, size_t *bytes);
+  int (*f_im_int_check_image_file_limits)(im_context_t ctx, i_img_dim width, i_img_dim height, int channels, size_t sample_size);
+
+  i_img *(*f_im_img_alloc)(im_context_t ctx);
+  void (*f_im_img_init)(im_context_t ctx, i_img *);
+
+  i_io_glue_t *(*f_im_io_new_fd)(im_context_t ctx, int fd);
+  i_io_glue_t *(*f_im_io_new_bufchain)(im_context_t ctx);
+  i_io_glue_t *(*f_im_io_new_buffer)(im_context_t ctx, const char *data, size_t len, i_io_closebufp_t closecb, void *closedata);
+  i_io_glue_t *(*f_im_io_new_cb)(im_context_t ctx, void *p, i_io_readl_t readcb, i_io_writel_t writecb, i_io_seekl_t seekcb, i_io_closel_t closecb, i_io_destroyl_t destroycb);
+
+  im_context_t (*f_im_get_context)(void);
+
+  void (*f_im_lhead)( im_context_t, const char *file, int line  );
+  void (*f_im_loog)(im_context_t, int level,const char *msg, ... ) I_FORMAT_ATTR(3,4);
+  void (*f_im_context_refinc)(im_context_t, const char *where);
+  void (*f_im_context_refdec)(im_context_t, const char *where);
+  i_errmsg *(*f_im_errors)(im_context_t);
+  i_mutex_t (*f_i_mutex_new)(void);
+  void (*f_i_mutex_destroy)(i_mutex_t m);
+  void (*f_i_mutex_lock)(i_mutex_t m);
+  void (*f_i_mutex_unlock)(i_mutex_t m);
+  im_slot_t (*f_im_context_slot_new)(im_slot_destroy_t);
+  int (*f_im_context_slot_set)(im_context_t, im_slot_t, void *);
+  void *(*f_im_context_slot_get)(im_context_t, im_slot_t);
+
+  /* IMAGER_API_LEVEL 9 */
+  int (*f_i_poly_poly_aa)(i_img *im, int count, const i_polygon_t *polys,
+                         i_poly_fill_mode_t mode, const i_color *val);
+  int (*f_i_poly_poly_aa_cfill)(i_img *im, int count, const i_polygon_t *polys,
+                               i_poly_fill_mode_t mode, i_fill_t *fill);
+  int (*f_i_poly_aa_m)(i_img *im, int l, const double *x, const double *y,
+                      i_poly_fill_mode_t mode, const i_color *val);
+  int (*f_i_poly_aa_cfill_m)(i_img *im, int l, const double *x, 
+                            const double *y, i_poly_fill_mode_t mode,
+                            i_fill_t *fill);
+
+  int (*f_i_img_alpha_channel)(i_img *im, int *channel);
+  i_color_model_t (*f_i_img_color_model)(i_img *im);
+  int (*f_i_img_color_channels)(i_img *im);
+
+  /* IMAGER_API_LEVEL 10 functions will be added here */
+  int (*f_im_decode_exif)(i_img *im, const unsigned char *data, size_t length);
+
+  /* IMAGER_API_LEVEL 11 functions will be added here */
 } im_ext_funcs;
 
 #define PERL_FUNCTION_TABLE_NAME "Imager::__ext_func_table"