]> git.imager.perl.org - imager.git/blobdiff - convert.im
fix method index entry for add_file_magic()
[imager.git] / convert.im
index 3ab6d177634d5b5c4cec15cd45fb43c848c0e3ea..2d5a8a96a6890a57956112b547cae3d7e729c3b0 100644 (file)
@@ -17,6 +17,7 @@ converting from RGBA to greyscale and back.
 =cut
 */
 
+#define IMAGER_NO_CONTEXT
 #include "imager.h"
 
 struct chan_copy {
@@ -69,17 +70,18 @@ i_convert(i_img *src, const double *coeff, int outchan, int inchan) {
   int i, j;
   int ilimit;
   i_img *im = NULL;
+  dIMCTXim(src);
 
-  mm_log((1,"i_convert(im %p, src %p, coeff %p,outchan %d, inchan %d)\n",
+  im_log((aIMCTX,1,"i_convert(im %p, src %p, coeff %p,outchan %d, inchan %d)\n",
          im, src, coeff, outchan, inchan));
  
-  i_clear_error();
+  im_clear_error(aIMCTX);
 
   ilimit = inchan;
   if (ilimit > src->channels)
     ilimit = src->channels;
   if (outchan > MAXCHANNELS) {
-    i_push_error(0, "cannot have outchan > MAXCHANNELS");
+    im_push_error(aIMCTX, 0, "cannot have outchan > MAXCHANNELS");
     return 0;
   }
 
@@ -130,8 +132,8 @@ i_convert(i_img *src, const double *coeff, int outchan, int inchan) {
     i_color *colors;
     i_palidx *vals;
 
-    im = i_img_pal_new(src->xsize, src->ysize, outchan, 
-                      i_maxcolors(src));
+    im = im_img_pal_new(aIMCTX, src->xsize, src->ysize, outchan, 
+                       i_maxcolors(src));
 
     /* just translate the color table */
     count = i_colorcount(src);