diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-27 03:22:29 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-27 03:22:29 +0300 |
commit | 0bb36e9ced06b04b961300b21211f456c7035bcf (patch) | |
tree | 9e38b0b5e9b84a22a7a03c5cad4139106168685c /source/blender/editors/interface/interface_widgets.c | |
parent | ebafb7e484fa45aed0f4be75cfb5d570d7d43f81 (diff) |
Fixes to Color Balance node:
* The Lift/Gamma/Gain formula previously was incorrect, fixed this and
removed conversions - now the RNA values are the same as what goes into
the formula.
* Because of this, added the ability for the Value slider to map to a wider range
than 0.0-1.0. The black/white gradient remains the same, in this case just
indicating darker/brighter rather than absolute colour values. Also added ability
for color wheels to be locked at full brightness (useful for this case, where the
color value itself is dark).
* Added an alternate formula - offset/power/slope (asc-cdl). This fits the standard
Color Decision List formula, here for compatibility with other systems, though
default Lift/Gamma/Gain is easier to use and gives nicer results.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index d9e8f6f55d2..aeea7d4a354 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1577,6 +1577,11 @@ void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, rcti *rect) rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); copy_v3_v3(hsvo, hsv); + /* exception: if 'lock' is set (stored in but->a2), + * lock the value of the color wheel to 1. + * Useful for color correction tools where you're only interested in hue. */ + if (but->a2) hsv[2] = 1.f; + hsv_to_rgb(0.f, 0.f, hsv[2], colcent, colcent+1, colcent+2); glShadeModel(GL_SMOOTH); @@ -1793,7 +1798,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect) uiWidgetBase wtb; float rad= 0.5f*(rect->xmax - rect->xmin); float x, y; - float rgb[3], hsv[3], v; + float rgb[3], hsv[3], v, range; int color_profile = but->block->color_profile; if (but->rnaprop) { @@ -1808,6 +1813,10 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect) if (color_profile) v = linearrgb_to_srgb(v); + + /* map v from property range to [0,1] */ + range = but->softmax - but->softmin; + v = (v - but->softmin)/range; widget_init(&wtb); |