From 92a1095ca8b9cd13f233e26a5e1f70518663806e Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 14 Apr 2022 14:31:58 +0800 Subject: Add gamma2 correction. --- main_simple_scanner.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main_simple_scanner.cpp') diff --git a/main_simple_scanner.cpp b/main_simple_scanner.cpp index 26518b1..91c036e 100644 --- a/main_simple_scanner.cpp +++ b/main_simple_scanner.cpp @@ -27,6 +27,7 @@ void generate_image(uint16_t image_width, uint16_t image_height, double viewport } else { std::cerr << "Antialiasing Samples: " << samples << std::endl; } + std::cerr << "Initializing context..." << std::endl; double r = 1.0 * image_width / image_height; viewport *vp; if (samples == 1) { @@ -40,10 +41,15 @@ void generate_image(uint16_t image_width, uint16_t image_height, double viewport 100)); // the earth world.add_object(std::make_shared(vec3d{0, 0, sphere_z}, sphere_r)); timer tm; + std::cerr << "Rendering..." << std::endl; tm.start_measure(); auto image = vp->render(world, vec3d::zero(), image_width, image_height); // camera position as the coordinate origin tm.stop_measure(); + std::cerr << "Applying gamma2..." << std::endl; + tm.start_measure(); + image = image.gamma2(); // gamma correction + tm.stop_measure(); if (!caption.empty()) { image.print(caption, pixel::from_normalized(1.0, 0.0, 0.0), -- cgit v1.2.3