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>2008-01-14 22:03:27 +0300
committerTon Roosendaal <ton@blender.org>2008-01-14 22:03:27 +0300
commit28667a314e94da91de6121894dfd237217da0b80 (patch)
tree74bad101e5c1f1599decb7528c389b51fe1854fa /source/blender/src/editsima.c
parentcdcba166f63dcb3c87bf1c99c4b7aae4f3481701 (diff)
Feature + Fix:
- while sampling color in image window, you now get the sampled color as a line drawn in the node editor Curve nodes, allowing quicker view of what values you actually change. - reverted temporary the patch [#6779] by Matthew Plough He replaced image drawing of backdrop-node-editor with our Texture drawing function. That call is extremely slow, and should be by definition slower than glDrawPixels (unless you don't upload the image each time to gfx mem). Drawing large frames (2k, 4k) in node editor became unacceptable slow, even with the neatest hardware around. (tested nvidia, ati) Probably (Campbell thinks) this is a bypass for Linux ATI cards? Anyhoo, this should be investigated further before applying. It better then becomes a user pref, or even much better: part of the OpenGL profiler we need.
Diffstat (limited to 'source/blender/src/editsima.c')
-rw-r--r--source/blender/src/editsima.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c
index c5215615618..0c29bceba37 100644
--- a/source/blender/src/editsima.c
+++ b/source/blender/src/editsima.c
@@ -97,6 +97,7 @@
#include "BSE_drawipo.h"
#include "BSE_edit.h"
#include "BSE_filesel.h"
+#include "BSE_node.h"
#include "BSE_trans_types.h"
#include "BDR_editobject.h"
@@ -1889,6 +1890,7 @@ void sima_sample_color(void)
if(fx>=0.0 && fy>=0.0 && fx<1.0 && fy<1.0) {
float *fp= NULL, *zpf= NULL;
+ float vec[3];
int *zp= NULL;
char *cp= NULL;
@@ -1907,14 +1909,14 @@ void sima_sample_color(void)
if(ibuf->rect_float)
fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x));
+ if(fp==NULL) {
+ fp= vec;
+ vec[0]= (float)cp[0]/255.0f;
+ vec[1]= (float)cp[1]/255.0f;
+ vec[2]= (float)cp[2]/255.0f;
+ }
+
if(G.sima->cumap) {
- float vec[3];
- if(fp==NULL) {
- fp= vec;
- vec[0]= (float)cp[0]/255.0f;
- vec[1]= (float)cp[1]/255.0f;
- vec[2]= (float)cp[2]/255.0f;
- }
if(ibuf->channels==4) {
if(G.qual & LR_CTRLKEY) {
@@ -1928,18 +1930,36 @@ void sima_sample_color(void)
}
}
+ {
+ ScrArea *sa, *cur= curarea;
+
+ node_curvemap_sample(fp); /* sends global to node editor */
+ for(sa= G.curscreen->areabase.first; sa; sa= sa->next) {
+ if(sa->spacetype==SPACE_NODE) {
+ areawinset(sa->win);
+ scrarea_do_windraw(sa);
+ }
+ }
+ node_curvemap_sample(NULL); /* clears global in node editor */
+ curarea= cur;
+ }
+
+ areawinset(curarea->win);
scrarea_do_windraw(curarea);
myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375);
glLoadIdentity();
- sima_show_info(ibuf->channels, x, y, cp, fp, zp, zpf);
+
+ sima_show_info(ibuf->channels, x, y, cp, (ibuf->rect_float)?fp:NULL, zp, zpf);
+
screen_swapbuffers();
+
}
-
}
BIF_wait_for_statechange();
}
scrarea_queue_winredraw(curarea);
+
}
/* Image functions */