Fix T51308: Bright/Contrast Doesn't respect Pre-multiplied Alpha
[blender.git] / source / blender / nodes / composite / nodes / node_composite_brightness.c
index 62f23f417b2b1d01e2b6459c08c399e93862a3b5..26e4d3a52c98fec180d7a0d93726c86720baad56 100644 (file)
@@ -46,6 +46,10 @@ static bNodeSocketTemplate cmp_node_brightcontrast_out[] = {
        {       -1, 0, ""       }
 };
 
        {       -1, 0, ""       }
 };
 
+static void node_composit_init_brightcontrast(bNodeTree *UNUSED(ntree), bNode *node)
+{
+       node->custom1 = 1;
+}
 
 void register_node_type_cmp_brightcontrast(void)
 {
 
 void register_node_type_cmp_brightcontrast(void)
 {
@@ -53,6 +57,7 @@ void register_node_type_cmp_brightcontrast(void)
        
        cmp_node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, 0);
        node_type_socket_templates(&ntype, cmp_node_brightcontrast_in, cmp_node_brightcontrast_out);
        
        cmp_node_type_base(&ntype, CMP_NODE_BRIGHTCONTRAST, "Bright/Contrast", NODE_CLASS_OP_COLOR, 0);
        node_type_socket_templates(&ntype, cmp_node_brightcontrast_in, cmp_node_brightcontrast_out);
+       node_type_init(&ntype, node_composit_init_brightcontrast);
 
        nodeRegisterType(&ntype);
 }
 
        nodeRegisterType(&ntype);
 }