Compare commits
No commits in common. "9517c8a10f1df1f1d054d020ae2bb7c897b308f2" and "2b62730f476c3e65fcfef3ab304968cce2f627cb" have entirely different histories.
9517c8a10f
...
2b62730f47
@ -63,13 +63,12 @@ if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type) {
|
||||
|
||||
nbpixels = a->width * a->height;
|
||||
|
||||
/* are we cache-friendly here ?
|
||||
* we need an accurate benchmarking... */
|
||||
|
||||
for (idx=0; idx<nbpixels; idx++) {
|
||||
b->R[idx] += a->R[idx];
|
||||
b->G[idx] += a->G[idx];
|
||||
b->B[idx] += a->B[idx];
|
||||
/* are we cache-friendly here ?
|
||||
* we need an accurate benchmarking... */
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -86,8 +85,8 @@ int idx, nbpixels;
|
||||
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
|
||||
#endif
|
||||
|
||||
if ( FIMG_TYPE_RGB != a->type ||
|
||||
FIMG_TYPE_RGB != b->type ||
|
||||
if (FIMG_TYPE_RGB != a->type ||
|
||||
FIMG_TYPE_RGB != b->type ||
|
||||
FIMG_TYPE_RGB != d->type) {
|
||||
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
|
||||
return -8;
|
||||
@ -176,15 +175,13 @@ if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type ||
|
||||
return -8;
|
||||
}
|
||||
|
||||
nbiter = a->width * a->height;
|
||||
nbiter = a->width * a->height * 3;
|
||||
|
||||
for (idx=0; idx<nbiter; idx++) {
|
||||
if (a->R[idx] > b->R[idx]) d->R[idx] = a->R[idx];
|
||||
else d->R[idx] = b->R[idx];
|
||||
if (a->G[idx] > b->G[idx]) d->G[idx] = a->G[idx];
|
||||
else d->G[idx] = b->G[idx];
|
||||
if (a->B[idx] > b->B[idx]) d->B[idx] = a->B[idx];
|
||||
else d->B[idx] = b->B[idx];
|
||||
if (a->R[idx] > b->R[idx])
|
||||
d->R[idx] = a->R[idx];
|
||||
else
|
||||
d->R[idx] = b->R[idx];
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -204,15 +201,13 @@ if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type ||
|
||||
return -8;
|
||||
}
|
||||
|
||||
nbiter = a->width * a->height ;
|
||||
nbiter = a->width * a->height * 3;
|
||||
|
||||
for (idx=0; idx<nbiter; idx++) {
|
||||
if (a->R[idx] < b->R[idx]) d->R[idx] = a->R[idx];
|
||||
else d->R[idx] = b->R[idx];
|
||||
if (a->G[idx] < b->G[idx]) d->G[idx] = a->G[idx];
|
||||
else d->G[idx] = b->G[idx];
|
||||
if (a->B[idx] < b->B[idx]) d->B[idx] = a->B[idx];
|
||||
else d->B[idx] = b->B[idx];
|
||||
if (a->R[idx] < b->R[idx])
|
||||
d->R[idx] = a->R[idx];
|
||||
else
|
||||
d->R[idx] = b->R[idx];
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -23,13 +23,7 @@ function essai_drand48
|
||||
./fimgstats -vv $TMPF
|
||||
}
|
||||
# -----------------------------------------------------
|
||||
function essai_cmixa
|
||||
{
|
||||
./mkfimg -v -t tpat0 $TMPF 800 600
|
||||
./fimgfx -v cmixa $TMPF bar.fimg
|
||||
}
|
||||
# -----------------------------------------------------
|
||||
|
||||
essai_cmixa
|
||||
essai_drand48
|
||||
|
||||
# -----------------------------------------------------
|
||||
|
@ -21,7 +21,7 @@ typedef struct {
|
||||
} Fx;
|
||||
|
||||
enum fxid { Fx_cos01=5, Fx_cos010, Fx_pow2, Fx_sqrt, Fx_gray0, Fx_halfsz0,
|
||||
Fx_rot90, Fx_cmixa,
|
||||
Fx_rot90,
|
||||
Fx_xper };
|
||||
|
||||
Fx fx_list[] = {
|
||||
@ -32,7 +32,6 @@ Fx fx_list[] = {
|
||||
{ "gray0", Fx_gray0, 0, 1 },
|
||||
{ "halfsz0", Fx_halfsz0, 0, 1 },
|
||||
{ "rot90", Fx_rot90, 0, 0 },
|
||||
{ "cmixa", Fx_cmixa, 0, 1 },
|
||||
{ "xper", Fx_xper, 0, 1 },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
@ -158,10 +157,6 @@ switch (action) {
|
||||
case Fx_rot90:
|
||||
foo = fimg_rotate_90(&src, &dest, 0); break;
|
||||
|
||||
case Fx_cmixa:
|
||||
fimg_copy_data(&src, &dest);
|
||||
foo = fimg_colors_mixer_a(&dest, 2.0); break;
|
||||
|
||||
case Fx_halfsz0:
|
||||
fprintf(stderr, "halfsize was not implemented\n");
|
||||
return -3;
|
||||
|
Loading…
Reference in New Issue
Block a user