Fix T39228 Gamma/lift/gain are burned out in the circular color pickers

and value/lightness slider stops midway.

Issue here is manyfold:

Color wheel does not support properties with different soft min/max
values than 1.0 (which after experimenting a little I left as is), and
also color management is completely destroying the mapping between the
value slider and the RNA property value range. To solve this I have
disabled color management by setting the property to gamma corrected
(only in RNA, Sequence editor coders please check!), otherwise it will
just become a big mess of tracking where color comes from and what kind
of color transforms it needs in different color pickers (if property has
non normalized range etc). HSL is not really meant to represent colors
outside a normalized space so I have disabled setting lightness above
1.0 in this model.

This will work, however it is hacking a color picker to do something
other than what it is supposed to do: pick a color from the screen
accurately. Which means normalized values always. The non normalized
colors picked for lift/gain/gamma through the pickers do not correspond
to any accurate colors; they are rather a user friendly way to 'sort of'
choose a color and a gamma with an indication of maximum value.

I think that lift/gamma/gain nodes need a dedicated widget for this
(besides it is quite clear that some options are written for that use
case) -or- a separate gamma multiplier for the picked color (which
should itself be in a normalized space)
This commit is contained in:
2014-03-18 01:08:24 +02:00
parent 7da2175271
commit 06de5be90e
5 changed files with 26 additions and 18 deletions

View File

@@ -4369,8 +4369,10 @@ static bool ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data,
case UI_GRAD_V:
hsv[2] = x;
break;
case UI_GRAD_V_ALT:
case UI_GRAD_L_ALT:
hsv[2] = y;
break;
case UI_GRAD_V_ALT:
/* vertical 'value' strip */
/* exception only for value strip - use the range set in but->min/max */
@@ -4393,7 +4395,7 @@ static bool ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data,
ui_block_to_scene_linear_v3(but->block, rgb);
/* clamp because with color conversion we can exceed range [#34295] */
if (ELEM((int)but->a1, UI_GRAD_V_ALT, UI_GRAD_L_ALT)) {
if (but->a1 == UI_GRAD_V_ALT) {
clamp_axis_max_v3(rgb, but->softmax);
}
@@ -4662,7 +4664,7 @@ static bool ui_numedit_but_HSVCIRCLE(uiBut *but, uiHandleButtonData *data,
ui_hsvcircle_vals_from_pos(hsv, hsv + 1, &rect, mx_fl, my_fl);
if (but->flag & UI_BUT_COLOR_CUBIC)
if ((but->flag & UI_BUT_COLOR_CUBIC) && (U.color_picker_type == USER_CP_CIRCLE_HSV))
hsv[1] = 1.0f - sqrt3f(1.0f - hsv[1]);
if (snap != SNAP_OFF) {