summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-05-05 17:41:31 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-05-05 17:41:31 +0200
commit990618b35f17a61cf8cae1b73ab2154ed1f897dd (patch)
tree7017cbe075602f0f164073705a420cbb3a6b3001
parentc4d58222e0c396585ae19301796097fde4d3f19d (diff)
Nice animation in mandel.cu/main()
-rw-r--r--mandel.cu12
1 files 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);