From aeda1a16f3e40b01da9afd573f1811a5212bdf34 Mon Sep 17 00:00:00 2001 From: Stefan Werner Date: Thu, 20 Apr 2017 22:41:26 +0200 Subject: D2607: Switch eye dropper to use linear color space internally This switches the internal color representation of the eye dropper from display space to linear. Any time a linear color is requested and the color is picked from a linear object, the result is now precise to the bit as the color gets patched through directly. Color space conversion now only happens when a color is picked from non-linear display space objects or when the color is requested to be returned in non-linear space. In addition, this patch changes the DifferenceMatte node to interpret a tolerance of 0.0 to accept colors that are identical bit by bit, as apposed to simply refusing all colors. --- source/blender/editors/space_node/node_view.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_node') diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index 80934e7d0a0..9c73af12e3f 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -417,13 +417,11 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) } } -/* Returns color in the display space, matching ED_space_image_color_sample(). +/* Returns color in linear space, matching ED_space_image_color_sample(). * And here we've got recursion in the comments tips... */ -bool ED_space_node_color_sample(Scene *scene, SpaceNode *snode, ARegion *ar, int mval[2], float r_col[3]) +bool ED_space_node_color_sample(SpaceNode *snode, ARegion *ar, int mval[2], float r_col[3]) { - const char *display_device = scene->display_settings.display_device; - struct ColorManagedDisplay *display = IMB_colormanagement_display_get_named(display_device); void *lock; Image *ima; ImBuf *ibuf; @@ -471,10 +469,6 @@ bool ED_space_node_color_sample(Scene *scene, SpaceNode *snode, ARegion *ar, int } } - if (ret) { - IMB_colormanagement_scene_linear_to_display_v3(r_col, display); - } - BKE_image_release_ibuf(ima, ibuf, lock); return ret; -- cgit v1.2.3