func 'fimg_mul_2' added

master
Tonton Th 3 years ago
parent 692735a57f
commit d3c52d6127
  1. 2
      funcs/fimg-tiff.c
  2. 26
      lib/operators.c

@ -14,6 +14,8 @@ int essai_ecrire_tiff(FloatImg *src, char *fname)
/* bon, tout cela semble bien tortueux ! */
fprintf(stderr, "%s %s to be implemented\n", __FILE__, __func__);
return 0;
}
/* --------------------------------------------------------------------- */

@ -98,6 +98,32 @@ for (idx=0; idx<nbpixels; idx++) {
}
return 0;
}
/* ---------------------------------------------------------------- */
/*
* B *= A may be faster than fimg_mul_3 ?
*/
int fimg_mul_2(FloatImg *a, FloatImg *b)
{
int idx, nbpixels;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %p )\n", __func__, a, b);
#endif
if (3 != a->type || 3 != b->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}
nbpixels = a->width * a->height;
for (idx=0; idx<nbpixels; idx++) {
b->R[idx] *= a->R[idx];
b->G[idx] *= a->G[idx];
b->B[idx] *= a->B[idx];
}
}
/* ---------------------------------------------------------------- */
/*

Loading…
Cancel
Save