a new function
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user