From 990618b35f17a61cf8cae1b73ab2154ed1f897dd Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 5 May 2020 17:41:31 +0200 Subject: Nice animation in mandel.cu/main() --- mandel.cu | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mandel.cu b/mandel.cu index 386f962..6d34802 100644 --- a/mandel.cu +++ b/mandel.cu @@ -232,12 +232,16 @@ int main() { uint8_t *img = new uint8_t[3 * 1920 * 1080]; - for (int i = 0; i <= 141; i++) { + for (int i = 0; i <= 5 * 141; i++) { mandel_render(img, ctx, &par, 1); char fname[64]; - sprintf(fname, "outdir/out%03d.bmp", i); - bmp_rgb_encode_file(fname, img, 1920, 1080); - par.imgw *= 0.8; + sprintf(fname, "outdir/out%03d.png", i); + int64_t t1 = gettimestamp(); + assert(lodepng::encode(fname, img, 1920, 1080, LCT_RGB) == 0); + // bmp_rgb_encode_file(fname, img, 1920, 1080); + int64_t t2 = gettimestamp(); + cout << "file writing: " << (t2 - t1) / 1000000.0 << " sec" << endl; + par.imgw *= pow(0.8, 1.0 / 5.0); } mandel_free(ctx); -- cgit v1.2.3