]> git.imager.perl.org - imager.git/blobdiff - imexttypes.h
allow Imager to be loaded on Windows 98
[imager.git] / imexttypes.h
index 892985d81fc69eb77b1ad84aa10d9dbeb6d5e771..e607d4a3e790c38dc67df2e56d8451bc617902c6 100644 (file)
@@ -5,7 +5,26 @@
 
 #include "imdatatypes.h"
 
+/*
+ IMAGER_API_VERSION is similar to the version number in the third and
+ fourth bytes of TIFF files - if it ever changes then the API has changed
+ too much for any application to remain compatible.
+*/
+#define IMAGER_API_VERSION 1
+
+/*
+ IMAGER_API_LEVEL is the level of the structure.  New function pointers
+ will always remain at the end (unless IMAGER_API_VERSION changes), and
+ will result in an increment of IMAGER_API_LEVEL.
+*/
+
+#define IMAGER_API_LEVEL 3
+
 typedef struct {
+  int version;
+  int level;
+
+  /* IMAGER_API_LEVEL 1 functions */
   void * (*f_mymalloc)(int size);
   void (*f_myfree)(void *block);
   void * (*f_myrealloc)(void *block, size_t newsize);
@@ -115,6 +134,24 @@ typedef struct {
   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);
   i_img *(*f_i_copy)(i_img *im);
   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);
+
+  /* IMAGER_API_LEVEL 2 functions */
+  int (*f_i_set_image_file_limits)(int width, int height, int bytes);
+  int (*f_i_get_image_file_limits)(int *width, int *height, int *bytes);
+  int (*f_i_int_check_image_file_limits)(int width, int height, int channels, int sample_size);
+  int (*f_i_flood_fill_border)(i_img *im, int seedx, int seedy, const i_color *dcol, const i_color *border);
+  int (*f_i_flood_cfill_border)(i_img *im, int seedx, int seedy, i_fill_t *fill, const i_color *border);
+
+  /* IMAGER_API_LEVEL 3 functions */
+  void (*f_i_img_setmask)(i_img *im, int ch_mask);
+  int (*f_i_img_getmask)(i_img *im);
+  int (*f_i_img_getchannels)(i_img *im);
+  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, ...);
+
+  /* IMAGER_API_LEVEL 4 functions will be added here */
 } im_ext_funcs;
 
 #define PERL_FUNCTION_TABLE_NAME "Imager::__ext_func_table"