FloatImg/funcs/killrgb.c

43 lines
764 B
C

/*
* KILL RGB !
*
* nouveau TerreBlanque 4 octobre 2021
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include "../floatimg.h"
#include "tests.h"
/* --------------------------------------------------------------------- */
int fimg_killrgb_v(FloatImg *src, FloatImg *dst, int k)
{
int foo, line, col;
int ir, ig, ib;
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__,
src, dst, k);
fimg_clear(dst);
ir = ig = ib = 0;
for (line=0; line<src->height; line++) {
for (col=0; col<src->width; col+=3) {
dst->R[ir ] = src->R[ir]; ir++;
dst->G[ir+1] = src->G[ir]; ir++;
dst->B[ir+2] = src->B[ir]; ir++;
}
}
return 0;
}
/* --------------------------------------------------------------------- */