summaryrefslogtreecommitdiff
path: root/main_simple_scanner.cpp
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-04-14 14:31:58 +0800
committerKeuin <[email protected]>2022-04-14 14:31:58 +0800
commit92a1095ca8b9cd13f233e26a5e1f70518663806e (patch)
treeb29bf86817fbe8beb5893d453397c3bbf9f82efb /main_simple_scanner.cpp
parent977490e2b3a181796348ab1853a87cde7c92f676 (diff)
Add gamma2 correction.
Diffstat (limited to 'main_simple_scanner.cpp')
-rw-r--r--main_simple_scanner.cpp6
1 files changed, 6 insertions, 0 deletions
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<T> *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<sphere>(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<T>::from_normalized(1.0, 0.0, 0.0),