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:
authorMatt Ebb <matt@mke3.net>2010-01-19 04:32:06 +0300
committerMatt Ebb <matt@mke3.net>2010-01-19 04:32:06 +0300
commitaab8196a1c16a1695a168c486fc6883953f97722 (patch)
treebcd6de7e916feba5f068936eb7e289605b0fb87a /source/blender/editors/space_image/image_draw.c
parent849024df83602758f134695495eb0b19a6993421 (diff)
Finished some work from the weekend to keep local tree clean..
* Added a generic 'histogram' ui control, currently available in new image editor 'scopes' region (shortcut P). Shows the histogram of the currently viewed image. It's a baby step in unifying the functionality and code from the sequence editor, so eventually we can migrate the sequence preview to the image editor too, like compositor. Still a couple of rough edges to tweak, regarding when it updates. Also would be very nice to have this region as a partially transparent overlapping region...
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r--source/blender/editors/space_image/image_draw.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index ea526b13219..2b2f1f0b3e4 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -204,6 +204,16 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
UI_DrawString(10, 10, str);
}
+static inline int get_bin_float(float f)
+{
+ CLAMP(f, 0.0, 1.0);
+
+ //return (int) (((f + 0.25) / 1.5) * 512);
+
+ return (int)(f * 511);
+}
+
+
/* image drawing */
static void draw_image_grid(ARegion *ar, float zoomx, float zoomy)
@@ -702,6 +712,11 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
if(ibuf && ima && show_render)
draw_render_info(ima, ar);
+ /* histogram */
+ if (ibuf) {
+ histogram_update(&sima->hist, ibuf);
+ }
+
/* XXX integrate this code */
#if 0
if(ibuf) {