diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-06-20 19:33:57 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-06-20 19:33:57 +0000 |
| commit | a39e3c37a508f9a389fc55270ae0336ad2f76f0e (patch) | |
| tree | 952db81c3238005e975f21845734444bba28ff40 /src/display/grayscale.cpp | |
| parent | Measure Tool: support measuring of text elements (without having to manually ... (diff) | |
| parent | Fix outline view (diff) | |
| download | inkscape-a39e3c37a508f9a389fc55270ae0336ad2f76f0e.tar.gz inkscape-a39e3c37a508f9a389fc55270ae0336ad2f76f0e.zip | |
Merge Cairo rendering branch
(bzr r10326)
Diffstat (limited to 'src/display/grayscale.cpp')
| -rw-r--r-- | src/display/grayscale.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/display/grayscale.cpp b/src/display/grayscale.cpp index 37f2b255c..745a08c1e 100644 --- a/src/display/grayscale.cpp +++ b/src/display/grayscale.cpp @@ -21,14 +21,22 @@ namespace Grayscale { +/* Original values from Johan: +const float red_factor = 0.3; +const float green_factor = 0.59; +const float blue_factor = 0.11; +*/ + +// Values below are from the SVG specification +const float red_factor = 0.2125; +const float green_factor = 0.7154; +const float blue_factor = 0.0721; + guint32 process(guint32 rgba) { return process(SP_RGBA32_R_U(rgba), SP_RGBA32_G_U(rgba), SP_RGBA32_B_U(rgba), SP_RGBA32_A_U(rgba)); } guint32 process(guchar r, guchar g, guchar b, guchar a) { - float red_factor = 0.3; - float green_factor = 0.59; - float blue_factor = 0.11; /** To reduce banding in gradients, this calculation is tweaked a bit * by outputing blue+1 or red+1 or both. The luminance is calculated |
