a new function
This commit is contained in:
parent
0d93070774
commit
0651d8de7a
@ -122,6 +122,7 @@ int fimg_cos_010(FloatImg *s, FloatImg *d, double maxval);
|
||||
|
||||
|
||||
int fimg_mix_rgb_gray(FloatImg *img, float mix);
|
||||
int fimg_shift_to_zero(FloatImg *s, FloatImg *d, float coefs[6]);
|
||||
|
||||
|
||||
/* module funcs/geometry.c */
|
||||
|
@ -41,4 +41,26 @@ for (y=0; y<img->height; y++) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
int fimg_shift_to_zero(FloatImg *s, FloatImg *d, float coefs[6])
|
||||
{
|
||||
int sz, idx;
|
||||
|
||||
sz = s->width * s->height;
|
||||
|
||||
if (FIMG_TYPE_RGB != img->type) {
|
||||
fprintf(stderr, "%s bad type\n", __func__);
|
||||
return -6;
|
||||
}
|
||||
|
||||
for (idx=0; idx<sz; idx++) {
|
||||
d->R[idx] = s->R[idx] - coefs[0];
|
||||
d->G[idx] = s->G[idx] - coefs[2];
|
||||
d->B[idx] = s->B[idx] - coefs[4];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user