From a586541d74a3ba9a7c841efa0f06f1da9977ed53 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 12 Jul 2010 16:20:51 +0000 Subject: [PATCH] tweak to color balance after talking with colin and testing other software, lift for values above 1.0 was too intense. Use: 1 + ((lift-1) * (lift-1)) so 2.0 is still a full lift but 1.x isnt so strong. Changed color picker to give more precission, we were having to edit the buttons to see what the numbers were. --- source/blender/blenkernel/intern/sequencer.c | 5 +++++ source/blender/editors/interface/interface_regions.c | 6 +++--- .../blender/nodes/intern/CMP_nodes/CMP_colorbalance.c | 10 +++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index fd3e56a418c..1ab4e75ee06 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1509,6 +1509,11 @@ static StripColorBalance calc_cb(StripColorBalance * cb_) if(cb.flag & SEQ_COLOR_BALANCE_INVERSE_LIFT) { for (c = 0; c < 3; c++) { + /* tweak to give more subtle results + * values above 1.0 are scaled */ + if(cb.lift[c] > 1.0f) + cb.lift[c] = pow(cb.lift[c] - 1.0f, 2.0f) + 1.0f; + cb.lift[c] = 2.0f - cb.lift[c]; } } diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index fb00d4f968e..a2a7f4bf77a 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1832,11 +1832,11 @@ static void uiBlockPicker(uiBlock *block, float *rgb, PointerRNA *ptr, PropertyR /* RGB values */ uiBlockBeginAlign(block); - bt= uiDefButR(block, NUMSLI, 0, "R ", 0, -60, butwidth, UI_UNIT_Y, ptr, propname, 0, 0.0, 0.0, 0, 0, ""); + bt= uiDefButR(block, NUMSLI, 0, "R ", 0, -60, butwidth, UI_UNIT_Y, ptr, propname, 0, 0.0, 0.0, 0, 3, ""); uiButSetFunc(bt, do_picker_rna_cb, bt, NULL); - bt= uiDefButR(block, NUMSLI, 0, "G ", 0, -80, butwidth, UI_UNIT_Y, ptr, propname, 1, 0.0, 0.0, 0, 0, ""); + bt= uiDefButR(block, NUMSLI, 0, "G ", 0, -80, butwidth, UI_UNIT_Y, ptr, propname, 1, 0.0, 0.0, 0, 3, ""); uiButSetFunc(bt, do_picker_rna_cb, bt, NULL); - bt= uiDefButR(block, NUMSLI, 0, "B ", 0, -100, butwidth, UI_UNIT_Y, ptr, propname, 2, 0.0, 0.0, 0, 0, ""); + bt= uiDefButR(block, NUMSLI, 0, "B ", 0, -100, butwidth, UI_UNIT_Y, ptr, propname, 2, 0.0, 0.0, 0, 3, ""); uiButSetFunc(bt, do_picker_rna_cb, bt, NULL); // could use uiItemFullR(col, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER, "", 0); diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c index cd614b12794..efd49172f95 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorbalance.c @@ -124,8 +124,16 @@ static void node_composit_exec_colorbalance(void *data, bNode *node, bNodeStack { NodeColorBalance *n= (NodeColorBalance *)node->storage; int c; + + copy_v3_v3(n->lift_lgg, n->lift); + for (c = 0; c < 3; c++) { - n->lift_lgg[c] = 2.0f - n->lift[c]; + /* tweak to give more subtle results + * values above 1.0 are scaled */ + if(n->lift_lgg[c] > 1.0f) + n->lift_lgg[c] = pow(n->lift_lgg[c] - 1.0f, 2.0f) + 1.0f; + + n->lift_lgg[c] = 2.0f - n->lift_lgg[c]; } }