This example demonstrates gamma correction — a nonlinear operation used to encode and decode the luminance of each image pixel. See https://en.wikipedia.org/wiki/Gamma_correction for more information.

The example creates a fractal image in memory and performs gamma correction on it. The output of the example application is a BMP image with corrected luminance.

This example uses C++11 lambda expressions. Specifying a compiler option such as -std=c++11 or similar might be necessary in order to build the example. For more information, please refer to the documentation for the compiler you use.

System Requirements

For the most up-to-date system requirements, see the release notes.

Files
gamma_correction.cpp
Implementation of the gamma correction algorithm based on Parallel STL.
utils.cpp
Utility code (class image) to write an image to disk as a BMP file.
utils.h
Declaration of the image class.
Makefile
Makefile for building the example.
Directories
msvs
Contains a Microsoft* Visual Studio* IDE workspace for building and running the example (Windows* OS systems only).
xcode
Contains a Xcode* IDE workspace for building and running the example (macOS* systems only).
Build instructions

To use Parallel STL, set up the environment by calling the pstlvars script (if you use a command line) or set the %PSTLROOT% environment variable pointing to the <pstl_installdir> folder (in Microsoft* Visual Studio* IDE on Windows* OS).

Use the Makefile to build the example on the command line.

Use the msvs/gamma_correction.sln project file to build the example in the Microsoft* Visual Studio* IDE (Windows* systems only).

Usage
gamma_correction or gamma_correction.exe
Outputs the original fractal image image_1.bmp and the fractal image with corrected luminance image_1_gamma.bmp


Legal Information

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others.
© 2017, Intel Corporation