diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-06-19 10:00:24 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-06-19 10:00:24 +0000 |
| commit | 06dfaa02d7a80bcdff717d579a48f81643f53f31 (patch) | |
| tree | 49b8e67ad9051f1507b0959cac986383ab4001e2 /src/display/grayscale.cpp | |
| parent | Fix rendering of control points (diff) | |
| parent | fix bug 796451: Measure tools should support rotation constraint (diff) | |
| download | inkscape-06dfaa02d7a80bcdff717d579a48f81643f53f31.tar.gz inkscape-06dfaa02d7a80bcdff717d579a48f81643f53f31.zip | |
Merge from trunk
(bzr r9508.1.89)
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 |
