Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2013-04-02 21:12:21 +0400
committerTon Roosendaal <ton@blender.org>2013-04-02 21:12:21 +0400
commit726dedafbc6d9b4a12ccf1a715f16459d7e7b1ef (patch)
tree6c2bac61dc5d1bec0b8286fa1c7a97782e6e1b28 /source/blender/editors/space_sequencer
parentdc685bc1c3702c580dc29c1e5132d3e7bc4601e0 (diff)
More Histogram fixes:
Sequencer histogram was calculating still badly, now it uses a per-color component counter to calculate the levels (instead of counter for all)
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_scopes.c37
2 files changed, 23 insertions, 16 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 536832a2ff8..141af5d5ba4 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -896,7 +896,7 @@ static ImBuf *sequencer_make_scope(Scene *scene, ImBuf *ibuf, ImBuf *(*make_scop
{
ImBuf *display_ibuf = IMB_dupImBuf(ibuf);
ImBuf *scope;
-
+
IMB_colormanagement_imbuf_make_display_space(display_ibuf, &scene->view_settings,
&scene->display_settings);
diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c
index c8b70c0ce4a..79b50f2d3ae 100644
--- a/source/blender/editors/space_sequencer/sequencer_scopes.c
+++ b/source/blender/editors/space_sequencer/sequencer_scopes.c
@@ -531,7 +531,7 @@ BLI_INLINE int get_bin_float(float f)
static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf)
{
ImBuf *rval = IMB_allocImBuf(515, 128, 32, IB_rect);
- int n, c, x, y;
+ int nr, ng, nb, x, y;
float *src = ibuf->rect_float;
unsigned int bins[3][HIS_STEPS];
@@ -563,23 +563,30 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf)
}
}
- draw_histogram_marker(rval, get_bin_float(0.0));
- draw_histogram_marker(rval, get_bin_float(1.0));
-
- n = 0;
- for (c = 0; c < 3; c++) {
- for (x = 0; x < HIS_STEPS; x++) {
- if (bins[c][x] > n) {
- n = bins[c][x];
- }
- }
+ nr = nb = ng = 0;
+ for (x = 0; x < HIS_STEPS; x++) {
+ if (bins[0][x] > nr)
+ nr = bins[0][x];
+ if (bins[1][x] > ng)
+ ng = bins[1][x];
+ if (bins[2][x] > nb)
+ nb = bins[2][x];
}
- for (c = 0; c < 3; c++) {
- for (x = 0; x < HIS_STEPS; x++) {
- draw_histogram_bar(rval, x + 1, (float) bins[c][x] / n, c);
+
+ for (x = 0; x < HIS_STEPS; x++) {
+ if (nr) {
+ draw_histogram_bar(rval, x + 1, ((float) bins[0][x]) / nr, 0);
+ }
+ if (ng) {
+ draw_histogram_bar(rval, x + 1, ((float) bins[1][x]) / ng, 1);
+ }
+ if (nb) {
+ draw_histogram_bar(rval, x + 1, ((float) bins[2][x]) / nb, 2);
}
}
-
+
+ draw_histogram_marker(rval, get_bin_float(0.0));
+ draw_histogram_marker(rval, get_bin_float(1.0));
wform_put_border((unsigned char *) rval->rect, rval->x, rval->y);
return rval;