]> git.imager.perl.org - imager.git/blobdiff - imext.h
various minor documentation changes
[imager.git] / imext.h
diff --git a/imext.h b/imext.h
index 85a6e2491d2feae5a4a8e0e8426d574658c2dcb8..fd03832844d1fec0d73a391e80762398e21fbcf7 100644 (file)
--- a/imext.h
+++ b/imext.h
@@ -7,8 +7,20 @@ extern im_ext_funcs *imager_function_ext_table;
 
 #define DEFINE_IMAGER_CALLBACKS im_ext_funcs *imager_function_ext_table
 
+#ifndef IMAGER_MIN_API_LEVEL
+#define IMAGER_MIN_API_LEVEL IMAGER_API_LEVEL
+#endif
+
 #define PERL_INITIALIZE_IMAGER_CALLBACKS \
-  imager_function_ext_table = INT2PTR(im_ext_funcs *, SvIV(get_sv(PERL_FUNCTION_TABLE_NAME, 1)))
+  do {  \
+    imager_function_ext_table = INT2PTR(im_ext_funcs *, SvIV(get_sv(PERL_FUNCTION_TABLE_NAME, 1))); \
+    if (!imager_function_ext_table) \
+      croak("Imager API function table not found!"); \
+    if (imager_function_ext_table->version != IMAGER_API_VERSION) \
+      croak("Imager API version incorrect"); \
+    if (imager_function_ext_table->level < IMAGER_MIN_API_LEVEL) \
+      croak("API level %d below minimum of %d", imager_function_ext_table->level, IMAGER_MIN_API_LEVEL); \
+  } while (0)
 
 /* just for use here */
 #define im_extt imager_function_ext_table
@@ -161,6 +173,8 @@ extern im_ext_funcs *imager_function_ext_table;
 #define i_circle_aa(im, x, y, rad, val) ((im_extt->f_i_circle_aa)((im), (x), (y), (rad), (val)))
 #define i_flood_fill(im, seedx, seedy, dcol) ((im_extt->f_i_flood_fill)((im), (seedx), (seedy), (dcol)))
 #define i_flood_cfill(im, seedx, seedy, fill) ((im_extt->f_i_flood_cfill)((im), (seedx), (seedy), (fill)))
+#define i_flood_fill_border(im, seedx, seedy, dcol, border) ((im_extt->f_i_flood_fill_border)((im), (seedx), (seedy), (dcol), (border)))
+#define i_flood_cfill_border(im, seedx, seedy, fill, border) ((im_extt->f_i_flood_cfill_border)((im), (seedx), (seedy), (fill), (border)))
 
 #define i_copyto(im, src, x1, y1, x2, y2, tx, ty) \
   ((im_extt->f_i_copyto)((im), (src), (x1), (y1), (x2), (y2), (tx), (ty)))
@@ -170,4 +184,11 @@ extern im_ext_funcs *imager_function_ext_table;
 #define i_rubthru(im, src, tx, ty, src_minx, src_miny, src_maxx, src_maxy) \
   ((im_extt->f_i_rubthru)((im), (src), (tx), (ty), (src_minx), (src_miny), (src_maxx), (src_maxy)))
 
+#define i_set_image_file_limits(max_width, max_height, max_bytes) \
+  ((im_extt->f_i_set_image_file_limits)((max_width), (max_height), (max_bytes)))
+#define i_get_image_file_limits(max_width, max_height, max_bytes) \
+  ((im_extt->f_i_get_image_file_limits)((pmax_width), (pmax_height), (pmax_bytes)))
+#define i_int_check_image_file_limits(width, height, channels, sample_size) \
+  ((im_extt->f_i_int_check_image_file_limits)((width), (height), (channels), (sample_size)))
+
 #endif