]> git.imager.perl.org - imager.git/blobdiff - imext.c
update limits.c with IMAGER_NO_CONTEXT
[imager.git] / imext.c
diff --git a/imext.c b/imext.c
index e6f0eee7c4fd3dd58af6811ee31dac4a166b7c8f..e2e1877027c3d4edaec2d96d3d8b02664d991789 100644 (file)
--- a/imext.c
+++ b/imext.c
@@ -2,6 +2,8 @@
 #include "imager.h"
 #include "imio.h"
 
+static im_context_t get_context(void);
+
 /*
  DON'T ADD CASTS TO THESE
 */
@@ -18,10 +20,10 @@ im_ext_funcs imager_function_table =
     myfree_file_line,
     myrealloc_file_line,
 
-    i_img_8_new,
-    i_img_16_new,
-    i_img_double_new,
-    i_img_pal_new,
+    im_img_8_new,
+    im_img_16_new,
+    im_img_double_new,
+    im_img_pal_new,
     i_img_destroy,
     i_sametype,
     i_sametype_chans,
@@ -58,10 +60,10 @@ im_ext_funcs imager_function_table =
     i_quant_translate,
     i_quant_transparent,
 
-    i_clear_error,
-    i_push_error,
+    im_clear_error,
+    im_push_error,
     i_push_errorf,
-    i_push_errorvf,
+    im_push_errorvf,
 
     i_tags_new,
     i_tags_set,
@@ -99,9 +101,9 @@ im_ext_funcs imager_function_table =
     i_rubthru,
 
     /* IMAGER_API_LEVEL 2 functions */
-    i_set_image_file_limits,
-    i_get_image_file_limits,
-    i_int_check_image_file_limits,
+    im_set_image_file_limits,
+    im_get_image_file_limits,
+    im_int_check_image_file_limits,
 
     i_flood_fill_border,
     i_flood_cfill_border,
@@ -116,8 +118,8 @@ im_ext_funcs imager_function_table =
     i_loog,
 
     /* IMAGER_API_LEVEL 4 functions */
-    i_img_alloc,
-    i_img_init,
+    im_img_alloc,
+    im_img_init,
 
     /* IMAGER_API_LEVEL 5 functions */
     i_img_is_monochrome,
@@ -145,12 +147,14 @@ im_ext_funcs imager_function_table =
     i_io_close,
     i_io_set_buffered,
     i_io_gets,
-    io_new_fd,
-    io_new_bufchain,
-    io_new_buffer,
-    io_new_cb,
+    im_io_new_fd,
+    im_io_new_bufchain,
+    im_io_new_buffer,
+    im_io_new_cb,
     io_slurp,
-    io_glue_destroy
+    io_glue_destroy,
+
+    get_context
   };
 
 /* in general these functions aren't called by Imager internally, but
@@ -352,6 +356,42 @@ i_img_dim
   return i_gsampf(im, l, r, y, samp, chans, chan_count);
 }
 
+/*
+=item i_gsamp_bits(im, left, right, y, samples, channels, channel_count, bits)
+=category Drawing
+
+Reads integer samples scaled to C<bits> bits of precision into the
+C<unsigned int> array C<samples>.
+
+Expect this to be slow unless C<< bits == im->bits >>.
+
+Returns the number of samples copied, or -1 on error.
+
+Not all image types implement this method.
+
+Pushes errors, but does not call C<i_clear_error()>.
+
+=cut
+*/
+
+/*
+=item i_psamp_bits(im, left, right, y, samples, channels, channel_count, bits)
+=category Drawing
+
+Writes integer samples scaled to C<bits> bits of precision from the
+C<unsigned int> array C<samples>.
+
+Expect this to be slow unless C<< bits == im->bits >>.
+
+Returns the number of samples copied, or -1 on error.
+
+Not all image types implement this method.
+
+Pushes errors, but does not call C<i_clear_error()>.
+
+=cut
+*/
+
 /*
 =item i_gpal(im, left, right, y, indexes)
 
@@ -514,3 +554,20 @@ int
   return i_setcolors(im, index, colors, count);
 }
 
+/*
+=item im_get_context()
+
+Retrieve the context object for the current thread.
+
+Inside Imager itself this is just a function pointer, which the
+Imager.xs BOOT handler initializes for use within perl.  If you're
+taking the Imager code and embedding it elsewhere you need to
+initialize the C<im_get_context> pointer at some point.
+
+=cut
+*/
+
+static im_context_t
+get_context(void) {
+  return im_get_context();
+}