Quick change in Hue/Saturation Node: made the central Hue value 0.5, to

make applying changes easier. Saturation slider goes to 2.0 now.

Fix: rendering compositing nodes without scene crashed in header stats
drawing.
This commit is contained in:
2006-02-18 15:57:46 +00:00
parent 1ea9099474
commit f4ddc2fde2
5 changed files with 17 additions and 7 deletions

View File

@@ -32,18 +32,24 @@
#include <stdlib.h>
#include "BKE_nla.h"
#include "BKE_blender.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "DNA_space_types.h"
#include "DNA_nla_types.h"
#include "DNA_action_types.h"
#include "DNA_ID.h"
#include "DNA_ipo_types.h"
#include "DNA_object_types.h"
#include "MEM_guardedalloc.h"
#include "BKE_nla.h"
#include "BKE_action.h"
#include "BKE_blender.h"
#include "BKE_library.h"
#include "BKE_object.h" /* for convert_action_to_strip(ob) */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

View File

@@ -793,6 +793,7 @@ bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup)
else if(type==CMP_NODE_HUE_SAT) {
NodeHueSat *nhs= MEM_callocN(sizeof(NodeHueSat), "node hue sat");
node->storage= nhs;
nhs->hue= 0.5f;
nhs->sat= 1.0f;
}
}

View File

@@ -1303,11 +1303,11 @@ static void do_hue_sat(bNode *node, float *out, float *in)
{
NodeHueSat *nhs= node->storage;
if(nhs->hue!=0.0f || nhs->sat!=1.0) {
if(nhs->hue!=0.5f || nhs->sat!=1.0) {
float hsv[3];
rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2);
hsv[0]+= nhs->hue;
hsv[0]+= (nhs->hue - 0.5f);
if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
hsv[1]*= nhs->sat;
if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
@@ -2314,7 +2314,7 @@ static void bokeh_single_image(CompBuf *new, CompBuf *img, float fac, NodeBlurDa
int radx, rady, imgx= img->x, imgy= img->y;
int x, y;
int i, j;
float *src, *dest, *srcd;
float *src= NULL, *dest, *srcd= NULL;
/* horizontal */
radx = fac*(float)nbd->sizex;

View File

@@ -1066,6 +1066,9 @@ static void do_render_final(Render *re)
if(!re->test_break()) {
ntree->stats_draw= render_composit_stats;
/* in case it was never initialized */
R.stats_draw= re->stats_draw;
ntreeCompositExecTree(ntree, &re->r, G.background==0);
ntree->stats_draw= NULL;
}

View File

@@ -909,7 +909,7 @@ static int node_composit_buts_hue_sat(uiBlock *block, bNodeTree *ntree, bNode *n
&nhs->hue, 0.0f, 1.0f, 100, 0, "");
uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Sat ",
butr->xmin, butr->ymin, butr->xmax-butr->xmin, 19,
&nhs->sat, 0.0f, 1.0f, 100, 0, "");
&nhs->sat, 0.0f, 2.0f, 100, 0, "");
}
return 38;
}