image histogram/sample line couldn't show HDR colors. now allow zooming the view to see colors up to 10.0

This commit is contained in:
2012-07-26 09:06:23 +00:00
parent 9c4380383c
commit ab0fa803cd
4 changed files with 24 additions and 5 deletions

View File

@@ -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;