forked from tTh/FloatImg
cosmetic change
This commit is contained in:
parent
6dbfa41890
commit
6d13293ef2
@ -21,7 +21,7 @@ extern int verbosity; /* must be declared around main() */
|
|||||||
*/
|
*/
|
||||||
int fimg_add(FloatImg *a, FloatImg *b, FloatImg *d)
|
int fimg_add(FloatImg *a, FloatImg *b, FloatImg *d)
|
||||||
{
|
{
|
||||||
int idx, nbiter;
|
int idx, nbpixels;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
|
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
|
||||||
@ -32,9 +32,9 @@ if (3 != a->type || 3 != b->type || 3 != d->type) {
|
|||||||
return -8;
|
return -8;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbiter = a->width * a->height;
|
nbpixels = a->width * a->height;
|
||||||
|
|
||||||
for (idx=0; idx<nbiter; idx++) {
|
for (idx=0; idx<nbpixels; idx++) {
|
||||||
d->R[idx] = a->R[idx] + b->R[idx];
|
d->R[idx] = a->R[idx] + b->R[idx];
|
||||||
d->G[idx] = a->G[idx] + b->G[idx];
|
d->G[idx] = a->G[idx] + b->G[idx];
|
||||||
d->B[idx] = a->B[idx] + b->B[idx];
|
d->B[idx] = a->B[idx] + b->B[idx];
|
||||||
@ -48,7 +48,7 @@ return 0;
|
|||||||
*/
|
*/
|
||||||
int fimg_sub(FloatImg *a, FloatImg *b, FloatImg *d)
|
int fimg_sub(FloatImg *a, FloatImg *b, FloatImg *d)
|
||||||
{
|
{
|
||||||
int idx, nbiter;
|
int idx, nbpixels;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
|
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
|
||||||
@ -59,12 +59,12 @@ if (3 != a->type || 3 != b->type || 3 != d->type) {
|
|||||||
return -8;
|
return -8;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbiter = a->width * a->height;
|
nbpixels = a->width * a->height;
|
||||||
|
|
||||||
/* maybe we can speedup this loop for
|
/* maybe we can speedup this loop for
|
||||||
* avoiding the cache strashing ?
|
* avoiding the cache strashing ?
|
||||||
*/
|
*/
|
||||||
for (idx=0; idx<nbiter; idx++) {
|
for (idx=0; idx<nbpixels; idx++) {
|
||||||
d->R[idx] = fabs(a->R[idx] - b->R[idx]);
|
d->R[idx] = fabs(a->R[idx] - b->R[idx]);
|
||||||
d->G[idx] = fabs(a->G[idx] - b->G[idx]);
|
d->G[idx] = fabs(a->G[idx] - b->G[idx]);
|
||||||
d->B[idx] = fabs(a->B[idx] - b->B[idx]);
|
d->B[idx] = fabs(a->B[idx] - b->B[idx]);
|
||||||
@ -78,7 +78,7 @@ return 0;
|
|||||||
*/
|
*/
|
||||||
int fimg_mul(FloatImg *a, FloatImg *b, FloatImg *d)
|
int fimg_mul(FloatImg *a, FloatImg *b, FloatImg *d)
|
||||||
{
|
{
|
||||||
int idx, nbiter;
|
int idx, nbpixels;
|
||||||
|
|
||||||
#if DEBUG_LEVEL
|
#if DEBUG_LEVEL
|
||||||
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
|
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
|
||||||
@ -89,9 +89,9 @@ if (3 != a->type || 3 != b->type || 3 != d->type) {
|
|||||||
return -8;
|
return -8;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbiter = a->width * a->height;
|
nbpixels = a->width * a->height;
|
||||||
|
|
||||||
for (idx=0; idx<nbiter; idx++) {
|
for (idx=0; idx<nbpixels; idx++) {
|
||||||
d->R[idx] = a->R[idx] * b->R[idx];
|
d->R[idx] = a->R[idx] * b->R[idx];
|
||||||
d->G[idx] = a->G[idx] * b->G[idx];
|
d->G[idx] = a->G[idx] * b->G[idx];
|
||||||
d->B[idx] = a->B[idx] * b->B[idx];
|
d->B[idx] = a->B[idx] * b->B[idx];
|
||||||
|
Loading…
Reference in New Issue
Block a user