[gimp/wip/pippin: 63/66] app: make curves tool pick in linear



commit c14d77f7b75175b731ce7d18040a8e9c9e14e385
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed Dec 14 21:39:40 2016 +0100

    app: make curves tool pick in linear

 app/tools/gimpcurvestool.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c
index 2703a36..e976726 100644
--- a/app/tools/gimpcurvestool.c
+++ b/app/tools/gimpcurvestool.c
@@ -380,20 +380,23 @@ gimp_curves_tool_color_picked (GimpColorTool      *color_tool,
   GimpFilterTool   *filter_tool = GIMP_FILTER_TOOL (color_tool);
   GimpCurvesConfig *config      = GIMP_CURVES_CONFIG (filter_tool->config);
   GimpDrawable     *drawable;
+  float rgba[4];
+
+  gimp_rgba_get_pixel (color, babl_format ("RGBA float"), rgba);
 
   drawable = GIMP_FILTER_TOOL (tool)->drawable;
 
-  tool->picked_color[GIMP_HISTOGRAM_RED]   = color->r;
-  tool->picked_color[GIMP_HISTOGRAM_GREEN] = color->g;
-  tool->picked_color[GIMP_HISTOGRAM_BLUE]  = color->b;
+  tool->picked_color[GIMP_HISTOGRAM_RED]   = rgba[0];
+  tool->picked_color[GIMP_HISTOGRAM_GREEN] = rgba[1];
+  tool->picked_color[GIMP_HISTOGRAM_BLUE]  = rgba[2];
 
   if (gimp_drawable_has_alpha (drawable))
-    tool->picked_color[GIMP_HISTOGRAM_ALPHA] = color->a;
+    tool->picked_color[GIMP_HISTOGRAM_ALPHA] = rgba[3];
   else
     tool->picked_color[GIMP_HISTOGRAM_ALPHA] = -1;
 
-  tool->picked_color[GIMP_HISTOGRAM_VALUE] = MAX (MAX (color->r, color->g),
-                                                  color->b);
+  tool->picked_color[GIMP_HISTOGRAM_VALUE] = MAX (MAX (rgba[0], rgba[1]),
+                                                  rgba[2]);
 
   gimp_curve_view_set_xpos (GIMP_CURVE_VIEW (tool->graph),
                             tool->picked_color[config->channel]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]