LightsprintSDK 2021.08.08
|
#include <RRBuffer.h>
Public Member Functions | |
virtual void | fromLinear (RRReal &intensity) const =0 |
virtual void | fromLinear (RRVec3 &color) const =0 |
virtual void | toLinear (RRReal &intensity) const =0 |
virtual void | toLinear (RRVec3 &color) const =0 |
virtual RRVec3 | getLinear (const unsigned char color[3]) const =0 |
virtual | ~RRColorSpace () |
Public Member Functions inherited from rr::RRUniformlyAllocated | |
void * | operator new (std::size_t n) |
void * | operator new[] (std::size_t n) |
void | operator delete (void *p, std::size_t n) |
void | operator delete[] (void *p, std::size_t n) |
Static Public Member Functions | |
static RRColorSpace * | create_sRGB (RRReal power=0.45f) |
Interface for custom color space.
All data in Lightsprint SDK are flagged to be either in custom color space or in linear colors, where linear colors can be any fixed multiple of physically based units. This class, custom color space, implements conversion to linear colors and back.
If you work with the most common format, sRGB, use create_sRGB().
If your pipeline works with linear colors, just pass nullptr where API asks for color space.
For other color spaces, you can implement your own RRColorSpace. Please make sure that your implementation doesn't generate NaNs or INFs (especially for negative inputs). Custom color spaces are fully supported by realtime solvers, lightmap baking and pathtracer, but not yet by OpenGL renderer, it has sRGB conversion hardcoded in shaders.
|
inlinevirtual |
|
pure virtual |
Converts from linear intensity.
|
pure virtual |
Converts from linear color.
|
pure virtual |
Converts to linear intensity.
|
pure virtual |
Converts to linear color.
|
pure virtual |
Converts to linear color.
|
static |
Creates and returns sRGB color space - the most common screen colors.
Our implementation approximates sRGB curve by pow() function.
power | Exponent in formula. Use default value for typical screen colors or tweak it for different contrast. |