diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2013-01-29 14:23:22 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2013-01-29 14:23:22 +0000 |
| commit | 7900b2459ca0a6f6e11a367443046582c4852752 (patch) | |
| tree | 5326fff6c6b1457f22d56b4f50dceac3c9744f28 /src/display/cairo-utils.cpp | |
| parent | Path::OutlineJoin. remove redundant nodes which are causing glitches (Bug 820... (diff) | |
| download | inkscape-7900b2459ca0a6f6e11a367443046582c4852752.tar.gz inkscape-7900b2459ca0a6f6e11a367443046582c4852752.zip | |
Filter color values always defined as sRGB (or ICC).
(bzr r12070)
Diffstat (limited to 'src/display/cairo-utils.cpp')
| -rw-r--r-- | src/display/cairo-utils.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp index 9655fc194..831b37899 100644 --- a/src/display/cairo-utils.cpp +++ b/src/display/cairo-utils.cpp @@ -597,6 +597,15 @@ void ink_cairo_surface_average_color_premul(cairo_surface_t *surface, double &r, a = CLAMP(a, 0.0, 1.0); } +void srgb_to_linear( double* c ) { + + if( *c < 0.04045 ) { + *c /= 12.92; + } else { + *c = pow( (*c+0.055)/1.055, 2.4 ); + } +} + void srgb_to_linear( guint32* c, guint32 a ) { *c = unpremul_alpha( *c, a ); |
