[gimp/wip/pippin: 4/7] app: make curves tool pick in linear
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/pippin: 4/7] app: make curves tool pick in linear
- Date: Wed, 8 Mar 2017 17:16:46 +0000 (UTC)
commit 3e04d869350c1a80a27b9a65c39f2152836bdefb
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]