=cut
*/
+#define IMAGER_NO_CONTEXT
#include "imager.h"
struct chan_copy {
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;
}
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);
=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);