X-Git-Url: http://git.imager.perl.org/imager.git/blobdiff_plain/55ebcc7b4c16a3195901de76670c3cc2d5317ec0..a84eb3aca96f4e587da92fe8f9fdcab9467adff2:/convert.im diff --git a/convert.im b/convert.im index b001f4bd..2d5a8a96 100644 --- a/convert.im +++ b/convert.im @@ -17,6 +17,7 @@ converting from RGBA to greyscale and back. =cut */ +#define IMAGER_NO_CONTEXT #include "imager.h" struct chan_copy { @@ -65,20 +66,22 @@ Now handles images with more than 8-bits/sample. i_img * i_convert(i_img *src, const double *coeff, int outchan, int inchan) { double work[MAXCHANNELS]; - int x, y; + i_img_dim x, y; int i, j; int ilimit; i_img *im = NULL; + dIMCTXim(src); - mm_log((1,"i_convert(src %p, coeff %p,outchan %d, inchan %d)\n",im,src, coeff,outchan, inchan)); + 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; } @@ -129,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); @@ -275,7 +278,7 @@ Perform a convert that only requires channel copies. =cut */ -i_img * +static i_img * convert_via_copy(i_img *im, i_img *src, struct chan_copy *info) { #code src->bits <= i_8_bits IM_COLOR *in_line = mymalloc(sizeof(IM_COLOR) * src->xsize);