added a second killcolors function
This commit is contained in:
26
funcs/sfx0.c
26
funcs/sfx0.c
@@ -22,15 +22,33 @@ if (FIMG_TYPE_RGB != fimg->type) {
|
||||
}
|
||||
|
||||
nbpix = fimg->width * fimg->height;
|
||||
|
||||
for (foo=0; foo<nbpix; foo++) {
|
||||
|
||||
if (fimg->R[foo] > fimg->G[foo])
|
||||
fimg->B[foo] = fimg->R[foo];
|
||||
else
|
||||
fimg->B[foo] = fimg->G[foo];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
int fimg_killcolors_b(FloatImg *fimg, float fval)
|
||||
{
|
||||
int nbpix, foo;
|
||||
|
||||
if (FIMG_TYPE_RGB != fimg->type) {
|
||||
fprintf(stderr, "%s: bad src type %d on %p\n", __func__,
|
||||
fimg->type, fimg);
|
||||
return -8;
|
||||
}
|
||||
|
||||
nbpix = fimg->width * fimg->height;
|
||||
for (foo=0; foo<nbpix; foo++) {
|
||||
if (fimg->R[foo] > fimg->B[foo])
|
||||
fimg->G[foo] = fimg->R[foo];
|
||||
else
|
||||
fimg->G[foo] = fimg->B[foo];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user