FloatImg4PythonBinding/funcs/killrgb.c

46 lines
827 B
C
Raw Normal View History

2021-10-05 00:35:56 +02:00
/*
* 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;
2021-10-10 09:46:27 +02:00
int ir;
2021-10-05 00:35:56 +02:00
2021-10-10 09:46:27 +02:00
#if DEBUG_LEVEL
2021-10-05 00:35:56 +02:00
fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__,
2021-10-10 09:46:27 +02:00
src, dst, k);
#endif
2021-10-05 00:35:56 +02:00
fimg_clear(dst);
2021-10-10 09:46:27 +02:00
ir = 0;
2021-10-05 00:35:56 +02:00
for (line=0; line<src->height; line++) {
2021-10-10 09:46:27 +02:00
// fprintf(stderr, "%s line %d\n", __func__, line);
for (col=0; col<(src->width-3); col+=3) {
2021-10-05 00:35:56 +02:00
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;
}
/* --------------------------------------------------------------------- */