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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user