diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-26 13:06:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-26 13:06:23 +0400 |
commit | ab0fa803cd68ffb6e8133b94ac3a781f97a33343 (patch) | |
tree | 6e8157e637c2b59cf507a5a638b5b36196f17b7b /source/blender/editors/interface | |
parent | 9c4380383cc1d4fcf9ea9e34c2163cb3d3353a3e (diff) |
image histogram/sample line couldn't show HDR colors. now allow zooming the view to see colors up to 10.0
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 17 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 3 |
2 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 1d88838ecc5..d8eb1b011bd 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -714,6 +714,8 @@ static void histogram_draw_one(float r, float g, float b, float alpha, } } +#define HISTOGRAM_TOT_GRID_LINES 4 + void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti) { Histogram *hist = (Histogram *)but->poin; @@ -749,9 +751,16 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol) glColor4f(1.f, 1.f, 1.f, 0.08f); /* draw grid lines here */ - for (i = 1; i < 4; i++) { - fdrawline(rect.xmin, rect.ymin + (i / 4.f) * h, rect.xmax, rect.ymin + (i / 4.f) * h); - fdrawline(rect.xmin + (i / 4.f) * w, rect.ymin, rect.xmin + (i / 4.f) * w, rect.ymax); + for (i = 1; i < (HISTOGRAM_TOT_GRID_LINES + 1); i++) { + const float fac = (float)i / (float)HISTOGRAM_TOT_GRID_LINES; + + /* so we can tell the 1.0 color point */ + if (i == HISTOGRAM_TOT_GRID_LINES) { + glColor4f(1.0f, 1.0f, 1.0f, 0.5f); + } + + fdrawline(rect.xmin, rect.ymin + fac * h, rect.xmax, rect.ymin + fac * h); + fdrawline(rect.xmin + fac * w, rect.ymin, rect.xmin + fac * w, rect.ymax); } if (hist->mode == HISTO_MODE_LUMA) { @@ -773,6 +782,8 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol) draw_scope_end(&rect, scissor); } +#undef HISTOGRAM_TOT_GRID_LINES + void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *recti) { Scopes *scopes = (Scopes *)but->poin; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 32aef5d3939..15202760315 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3872,7 +3872,8 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx const float yfac = minf(powf(hist->ymax, 2.0f), 1.0f) * 0.5f; hist->ymax += dy * yfac; - CLAMP(hist->ymax, 1.f, 100.f); + /* 0.1 allows us to see HDR colors up to 10 */ + CLAMP(hist->ymax, 0.1f, 100.f); } data->draglastx = mx; |