forked from tTh/FloatImg
simplification
This commit is contained in:
parent
e10f26df53
commit
1c47b50954
25
essai.c
25
essai.c
|
@ -13,29 +13,6 @@
|
|||
|
||||
int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
int add(FloatImg *a, FloatImg *b)
|
||||
{
|
||||
int x, y;
|
||||
int offset;
|
||||
double tb;
|
||||
|
||||
fimg_timer_set(0);
|
||||
|
||||
for (x=0; x<a->width; x++) {
|
||||
for (y=0; y<a->height; y++) {
|
||||
offset = x + (y * a->width);
|
||||
a->R[offset] += b->R[offset];
|
||||
a->G[offset] += b->G[offset];
|
||||
a->B[offset] += b->B[offset];
|
||||
}
|
||||
}
|
||||
|
||||
tb = fimg_timer_get(0);
|
||||
fprintf(stderr, "%s = %f seconds\n", __func__, tb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
void fait_un_dessin(char *fname)
|
||||
{
|
||||
|
@ -107,7 +84,7 @@ fimg_create(&fimgB, W, H, 3);
|
|||
fimg_timer_set(0);
|
||||
fimg_drand48(&fimgB, 100.0);
|
||||
fimg_drand48(&fimgA, 100.0);
|
||||
add(&fimgA, &fimgB);
|
||||
fimg_add(&fimgA, &fimgB, &fimgA);
|
||||
tb = fimg_timer_get(0);
|
||||
fprintf(stderr, "%s = %f seconds\n", __func__, tb);
|
||||
foo = fimg_save_as_pnm(&fimgA, "drand48.pnm", 0);
|
||||
|
|
Loading…
Reference in New Issue