clamp me hardly, say the pixel
This commit is contained in:
@@ -144,6 +144,31 @@ for (idx=0; idx<nbre; idx++) {
|
||||
if (fi->R[idx] < 0.0) count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* nouveau 29 fevrier 2020 */
|
||||
int fimg_clamp_negativ(FloatImg *fi)
|
||||
{
|
||||
int nbre, idx;
|
||||
int count;
|
||||
|
||||
if (fi->type != FIMG_TYPE_RGB) {
|
||||
fprintf(stderr, "%s : type %d invalide\n",
|
||||
__func__, fi->type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
nbre = fi->width * fi->height * fi->type;
|
||||
|
||||
count = 0;
|
||||
for (idx=0; idx<nbre; idx++) {
|
||||
if (fi->R[idx] < 0.0) {
|
||||
fi->R[idx] = 0.0;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user