diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-11-06 16:44:54 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-11-06 16:44:54 +0400 |
commit | b8f22a0565c7b4a1b0b1eb2e8fbdaa3ebbd1a99e (patch) | |
tree | 60a5c8878d2282590a28e55399f171d720bcc2b2 /source/blender/makesrna/intern/rna_nodetree.c | |
parent | b91e841f8fa1af0d378870c614880d1b06cc9143 (diff) |
Syncing methods for Color Balance node LGG and ASC-CDL modes. The settings for either mode are converted into equivalent settings of the other. This keeps the result of both modes roughly the same and
mimics the previous behavior when settings were shared by both modes (but not equivalent).
NOTE: Due to the use of additional sRGB conversion in the LGG mode the result is not entirely accurate, this should perhaps be fixed.
Settings for each mode are kept in their own color values nevertheless, this avoids potential problems with float precision.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 87136a6a07b..2b9c2bd4e9a 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2693,6 +2693,18 @@ static PointerRNA rna_NodeOutputFile_slot_file_get(CollectionPropertyIterator *i return ptr; } +static void rna_NodeColorBalance_update_lgg(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + ntreeCompositColorBalanceSyncFromLGG(ptr->id.data, ptr->data); + rna_Node_update(bmain, scene, ptr); +} + +static void rna_NodeColorBalance_update_cdl(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + ntreeCompositColorBalanceSyncFromCDL(ptr->id.data, ptr->data); + rna_Node_update(bmain, scene, ptr); +} + /* ******** Node Socket Types ******** */ static PointerRNA rna_NodeOutputFile_slot_layer_get(CollectionPropertyIterator *iter) @@ -5236,7 +5248,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_float_array_default(prop, default_1); RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Lift", "Correction for Shadows"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_lgg"); prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gamma"); @@ -5244,7 +5256,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_float_array_default(prop, default_1); RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Gamma", "Correction for Midtones"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_lgg"); prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gain"); @@ -5252,7 +5264,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_float_array_default(prop, default_1); RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Gain", "Correction for Highlights"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_lgg"); prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -5260,7 +5272,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, 0, 1, 0.1, 3); RNA_def_property_ui_text(prop, "Offset", "Correction for Shadows"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_cdl"); prop = RNA_def_property(srna, "power", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "power"); @@ -5269,7 +5281,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_range(prop, 0.f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Power", "Correction for Midtones"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_cdl"); prop = RNA_def_property(srna, "slope", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "slope"); @@ -5278,7 +5290,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_range(prop, 0.f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Slope", "Correction for Highlights"); - RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_cdl"); } static void def_cmp_huecorrect(StructRNA *srna) |