diff options
author | Matt Ebb <matt@mke3.net> | 2010-03-31 03:32:16 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-03-31 03:32:16 +0400 |
commit | 05c2906b769a3a56939bd870589dab637b73d63d (patch) | |
tree | b3de8d412091615f9ea823894b1b4ea0af0042f7 /source/blender/nodes/intern/CMP_nodes | |
parent | c9f81c87b88574fa803050040a6b8ddf398968aa (diff) |
Patch from Xavier Thomas:
YCbCr conversion function according to ITU-R BT.601/709 and JFIF
Clarifies color space usage in rgb->ycc conversion, doesn't change existing results.
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes')
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c index b1fe0a2897b..ca7c19cc778 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c @@ -45,7 +45,7 @@ static bNodeSocketType cmp_node_channel_matte_out[]={ static void do_normalized_rgba_to_ycca2(bNode *node, float *out, float *in) { /*normalize to the range 0.0 to 1.0) */ - rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); out[0]=(out[0])/255.0; out[1]=(out[1])/255.0; out[2]=(out[2])/255.0; @@ -58,7 +58,7 @@ static void do_normalized_ycca_to_rgba2(bNode *node, float *out, float *in) in[0]=in[0]*255.0; in[1]=in[1]*255.0; in[2]=in[2]*255.0; - ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); out[3]=in[3]; } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c index a8d7ff6b029..b081880b87b 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_chromaMatte.c @@ -45,7 +45,7 @@ static bNodeSocketType cmp_node_chroma_out[]={ static void do_rgba_to_ycca_normalized(bNode *node, float *out, float *in) { /*normalize to the range -1.0 to 1.0) */ - rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); out[0]=((out[0])-16)/255.0; out[1]=((out[1])-128)/255.0; out[2]=((out[2])-128)/255.0; @@ -58,7 +58,7 @@ static void do_ycca_to_rgba_normalized(bNode *node, float *out, float *in) in[0]=(in[0]*255.0)+16; in[1]=(in[1]*255.0)+128; in[2]=(in[2]*255.0)+128; - ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2]); + ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); out[3]=in[3]; } diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c index e42fafe58e5..7b3dfccab50 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_sepcombYCCA.c @@ -47,7 +47,7 @@ static void do_sepycca(bNode *node, float *out, float *in) { float y, cb, cr; - rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr); + rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT601); /*divided by 255 to normalize for viewing in */ out[0]= y/255.0; @@ -62,7 +62,7 @@ static void node_composit_exec_sepycca(void *data, bNode *node, bNodeStack **in, if(in[0]->data==NULL) { float y, cb, cr; - rgb_to_ycc(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &y, &cb, &cr); + rgb_to_ycc(in[0]->vec[0], in[0]->vec[1], in[0]->vec[2], &y, &cb, &cr, BLI_YCC_ITU_BT601); /*divided by 255 to normalize for viewing in */ out[0]->vec[0] = y/255.0; @@ -136,7 +136,7 @@ static void do_comb_ycca(bNode *node, float *out, float *in1, float *in2, float cb=in2[0]*255; cr=in3[0]*255; - ycc_to_rgb(y,cb,cr, &r, &g, &b); + ycc_to_rgb(y,cb,cr, &r, &g, &b, BLI_YCC_ITU_BT601); out[0] = r; out[1] = g; |