Browse Source

simplification

master
tth 3 years ago
parent
commit
1c47b50954
  1. 25
      essai.c

25
essai.c

@ -13,29 +13,6 @@ @@ -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); @@ -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…
Cancel
Save