#include #include #include #include #include #include "../floatimg.h" int verbosity; /* ---------------------------------------------------------------- */ static int gray_interpolate(FloatImg *s1, FloatImg *s2, FloatImg *d, float coef) { return -1; } /* ---------------------------------------------------------------- */ int fimg_interpolate(FloatImg *s1, FloatImg *s2, FloatImg *d, float coef) { int picsize, idx; if (FIMG_TYPE_RGB != s1->type) { fprintf(stderr, "%s : bad src 1 type %d on %p\n", __func__, s1->type, s1); return -8; } if (FIMG_TYPE_RGB != s2->type) { fprintf(stderr, "%s : bad src 2 type %d on %p\n", __func__, s2->type, s2); return -8; } if (FIMG_TYPE_RGB != d->type) { fprintf(stderr, "%s : bad dst type %d on %p\n", __func__, d->type, d); return -9; } picsize = d->width * d->height * 3; for (idx=0; idxR[idx] = (coef * s1->R[idx]) + ((1.0-coef) * s2->R[idx]); } return 0; } /* ---------------------------------------------------------------- */