From dd38dce7f0ae604396d1e96bc49500369fdedf29 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Tue, 17 Mar 2015 15:20:33 +0100 Subject: Part 2 of D1082 by Troy Sobotka, remove our functions that do luma calculations and use the OCIO one instead. --- source/blender/nodes/shader/nodes/node_shader_valToRgb.c | 3 ++- source/blender/nodes/texture/nodes/node_texture_valToRgb.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c index fa5d9b43ee7..72942cce9c5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_valToRgb.c +++ b/source/blender/nodes/shader/nodes/node_shader_valToRgb.c @@ -31,6 +31,7 @@ #include "node_shader_util.h" +#include "IMB_colormanagement.h" /* **************** VALTORGB ******************** */ static bNodeSocketTemplate sh_node_valtorgb_in[] = { @@ -106,7 +107,7 @@ static void node_shader_exec_rgbtobw(void *UNUSED(data), int UNUSED(thread), bNo float col[3]; nodestack_get_vec(col, SOCK_VECTOR, in[0]); - out[0]->vec[0] = rgb_to_bw(col); + out[0]->vec[0] = IMB_colormanagement_get_luminance(col); } static int gpu_shader_rgbtobw(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) diff --git a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c index 7f8adab2da5..a49d82d27a9 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToRgb.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToRgb.c @@ -32,6 +32,7 @@ #include "node_texture_util.h" #include "NOD_texture.h" +#include "IMB_colormanagement.h" /* **************** VALTORGB ******************** */ static bNodeSocketTemplate valtorgb_in[] = { @@ -91,7 +92,7 @@ static void rgbtobw_valuefn(float *out, TexParams *p, bNode *UNUSED(node), bNode { float cin[4]; tex_input_rgba(cin, in[0], p, thread); - *out = rgb_to_bw(cin); + *out = IMB_colormanagement_get_luminance(cin); } static void rgbtobw_exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out) -- cgit v1.2.3