Color: Combine/Separate YCbCrA node default to rec. 709
authorAaron Carlisle <carlisle.b3d@gmail.com>
Wed, 9 May 2018 02:24:58 +0000 (22:24 -0400)
committerAaron Carlisle <carlisle.b3d@gmail.com>
Wed, 9 May 2018 02:24:58 +0000 (22:24 -0400)
This commit is part of T54798

Differential Revision: https://developer.blender.org/D3183

source/blender/compositor/operations/COM_ConvertOperation.cpp
source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c

index 327015c11393a5c9438f2db077348ec7f1b2715e..8e79931d6f0393b35db62588d64a2d8c17120802 100644 (file)
@@ -164,15 +164,15 @@ ConvertRGBToYCCOperation::ConvertRGBToYCCOperation() : ConvertBaseOperation()
 void ConvertRGBToYCCOperation::setMode(int mode)
 {
        switch (mode) {
 void ConvertRGBToYCCOperation::setMode(int mode)
 {
        switch (mode) {
-               case 1:
-                       this->m_mode = BLI_YCC_ITU_BT709;
+               case 0:
+                       this->m_mode = BLI_YCC_ITU_BT601;
                        break;
                case 2:
                        this->m_mode = BLI_YCC_JFIF_0_255;
                        break;
                        break;
                case 2:
                        this->m_mode = BLI_YCC_JFIF_0_255;
                        break;
-               case 0:
+               case 1:
                default:
                default:
-                       this->m_mode = BLI_YCC_ITU_BT601;
+                       this->m_mode = BLI_YCC_ITU_BT709;
                        break;
        }
 }
                        break;
        }
 }
@@ -202,15 +202,15 @@ ConvertYCCToRGBOperation::ConvertYCCToRGBOperation() : ConvertBaseOperation()
 void ConvertYCCToRGBOperation::setMode(int mode)
 {
        switch (mode) {
 void ConvertYCCToRGBOperation::setMode(int mode)
 {
        switch (mode) {
-               case 1:
-                       this->m_mode = BLI_YCC_ITU_BT709;
+               case 0:
+                       this->m_mode = BLI_YCC_ITU_BT601;
                        break;
                case 2:
                        this->m_mode = BLI_YCC_JFIF_0_255;
                        break;
                        break;
                case 2:
                        this->m_mode = BLI_YCC_JFIF_0_255;
                        break;
-               case 0:
+               case 1:
                default:
                default:
-                       this->m_mode = BLI_YCC_ITU_BT601;
+                       this->m_mode = BLI_YCC_ITU_BT709;
                        break;
        }
 }
                        break;
        }
 }
index d712f921ba31f8d9f89995f4915e44dfaac824bd..27b1fff321ea97f23e97950239cdd04814689491 100644 (file)
@@ -46,6 +46,10 @@ static bNodeSocketTemplate cmp_node_sepycca_out[] = {
        {  -1, 0, ""   }
 };
 
        {  -1, 0, ""   }
 };
 
+static void node_composit_init_mode_sepycca(bNodeTree *UNUSED(ntree), bNode *node)
+{
+       node->custom1 = 1; /* BLI_YCC_ITU_BT709 */
+}
 
 void register_node_type_cmp_sepycca(void)
 {
 
 void register_node_type_cmp_sepycca(void)
 {
@@ -53,6 +57,7 @@ void register_node_type_cmp_sepycca(void)
 
        cmp_node_type_base(&ntype, CMP_NODE_SEPYCCA, "Separate YCbCrA", NODE_CLASS_CONVERTOR, 0);
        node_type_socket_templates(&ntype, cmp_node_sepycca_in, cmp_node_sepycca_out);
 
        cmp_node_type_base(&ntype, CMP_NODE_SEPYCCA, "Separate YCbCrA", NODE_CLASS_CONVERTOR, 0);
        node_type_socket_templates(&ntype, cmp_node_sepycca_in, cmp_node_sepycca_out);
+       node_type_init(&ntype, node_composit_init_mode_sepycca);
 
        nodeRegisterType(&ntype);
 }
 
        nodeRegisterType(&ntype);
 }
@@ -72,12 +77,18 @@ static bNodeSocketTemplate cmp_node_combycca_out[] = {
        {       -1, 0, ""       }
 };
 
        {       -1, 0, ""       }
 };
 
+static void node_composit_init_mode_combycca(bNodeTree *UNUSED(ntree), bNode *node)
+{
+       node->custom1 = 1; /* BLI_YCC_ITU_BT709 */
+}
+
 void register_node_type_cmp_combycca(void)
 {
        static bNodeType ntype;
 
        cmp_node_type_base(&ntype, CMP_NODE_COMBYCCA, "Combine YCbCrA", NODE_CLASS_CONVERTOR, 0);
        node_type_socket_templates(&ntype, cmp_node_combycca_in, cmp_node_combycca_out);
 void register_node_type_cmp_combycca(void)
 {
        static bNodeType ntype;
 
        cmp_node_type_base(&ntype, CMP_NODE_COMBYCCA, "Combine YCbCrA", NODE_CLASS_CONVERTOR, 0);
        node_type_socket_templates(&ntype, cmp_node_combycca_in, cmp_node_combycca_out);
+       node_type_init(&ntype, node_composit_init_mode_combycca);
 
        nodeRegisterType(&ntype);
 }
 
        nodeRegisterType(&ntype);
 }