From 1c47b509542f4d96ca350a8eb9be0fa3d3db1dce Mon Sep 17 00:00:00 2001 From: tth Date: Tue, 27 Aug 2019 16:21:40 +0200 Subject: [PATCH] simplification --- essai.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/essai.c b/essai.c index 22cfe75..2ba3e7c 100644 --- a/essai.c +++ b/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; xwidth; x++) { - for (y=0; yheight; 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);