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>2006-01-24 13:35:43 +0300
committerTon Roosendaal <ton@blender.org>2006-01-24 13:35:43 +0300
commita126178fd8eade4d7facdeb58bdd6592316e7f0a (patch)
treef4e0940c9cfe20685f1ae4e590c58e777549ba93 /source/blender/src/drawimage.c
parent4db91f978488acf6db6d84345545f011e74c6cd9 (diff)
Orange: made Image window react nicer to compositor output and own Curves;
- Image curves are only applied now when curves panel is in use. Closing the panel will disable curves, reopen Panel enable curves. You can minimize the Curves panel to keep it active. That latter then works as visualization curves are being applied. - Compositor output now also uses Image window curves, if active.
Diffstat (limited to 'source/blender/src/drawimage.c')
-rw-r--r--source/blender/src/drawimage.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c
index 9a002005e06..fa6a91b701d 100644
--- a/source/blender/src/drawimage.c
+++ b/source/blender/src/drawimage.c
@@ -978,7 +978,22 @@ static void image_panel_curves(short cntrl) // IMAGE_HANDLER_PROPERTIES
}
}
+/* are there curves? curves visible? and curves do something? */
+static int image_curves_active(ScrArea *sa)
+{
+ SpaceImage *sima= sa->spacedata.first;
+ if(sima->cumap) {
+ if(curvemapping_RGBA_does_something(sima->cumap)) {
+ short a;
+ for(a=0; a<SPACE_MAXHANDLER; a+=2) {
+ if(sima->blockhandler[a] == IMAGE_HANDLER_CURVES)
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
static void image_blockhandlers(ScrArea *sa)
{
@@ -1268,6 +1283,8 @@ void drawimagespace(ScrArea *sa, void *spacedata)
MEM_freeN(rect);
}
else {
+ /* this part is generic image display */
+
if(sima->flag & SI_SHOW_ALPHA) {
if(ibuf->rect)
sima_draw_alpha_pixels(x1, y1, ibuf->x, ibuf->y, ibuf->rect);
@@ -1283,6 +1300,20 @@ void drawimagespace(ScrArea *sa, void *spacedata)
sima_draw_alpha_backdrop(sima, x1, y1, (float)ibuf->x, (float)ibuf->y);
glEnable(GL_BLEND);
}
+
+ /* detect if we need to redo the curve map.
+ ibuf->rect is zero for compositor and render results after change
+ also: if no curves are active, we only keep the float rect
+ */
+ if(ibuf->rect_float) {
+ if(image_curves_active(sa)) {
+ if(ibuf->rect==NULL)
+ curvemapping_do_image(G.sima->cumap, G.sima->image);
+ }
+ else if(ibuf->rect)
+ imb_freerectImBuf(ibuf);
+ }
+
if(ibuf->rect)
glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
else