[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32421] trunk/blender/source/blender/nodes /intern/CMP_nodes/CMP_blur.c: bugfix [#24225] Blur Node ignores gamma option when size has input.
Campbell Barton
ideasman42 at gmail.com
Mon Oct 11 23:08:26 CEST 2010
Revision: 32421
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32421
Author: campbellbarton
Date: 2010-10-11 23:08:26 +0200 (Mon, 11 Oct 2010)
Log Message:
-----------
bugfix [#24225] Blur Node ignores gamma option when size has input.
Modified Paths:
--------------
trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c 2010-10-11 20:55:05 UTC (rev 32420)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c 2010-10-11 21:08:26 UTC (rev 32421)
@@ -582,7 +582,11 @@
nbd->sizey= (int)(nbd->percenty*nbd->image_in_height);
}
- if (((NodeBlurData *)node->storage)->filtertype == R_FILTER_FAST_GAUSS) {
+ if (nbd->sizex==0 && nbd->sizey==0) {
+ new= pass_on_compbuf(img);
+ out[0]->data= new;
+ }
+ else if (nbd->filtertype == R_FILTER_FAST_GAUSS) {
CompBuf *new, *img = in[0]->data;
/*from eeshlo's original patch, removed to fit in with the existing blur node */
/*const float sx = in[1]->vec[0], sy = in[2]->vec[0];*/
@@ -622,6 +626,7 @@
/* if fac input, we do it different */
if(in[1]->data) {
+ CompBuf *gammabuf;
/* make output size of input image */
new= alloc_compbuf(img->x, img->y, img->type, 1); /* allocs */
@@ -630,7 +635,18 @@
new->xof = img->xof;
new->yof = img->yof;
- blur_with_reference(node, new, img, in[1]->data);
+ if(nbd->gamma) {
+ gammabuf= dupalloc_compbuf(img);
+ gamma_correct_compbuf(gammabuf, 0);
+ }
+ else gammabuf= img;
+
+ blur_with_reference(node, new, gammabuf, in[1]->data);
+
+ if(nbd->gamma) {
+ gamma_correct_compbuf(new, 1);
+ free_compbuf(gammabuf);
+ }
if(node->exec & NODE_BREAK) {
free_compbuf(new);
new= NULL;
@@ -643,7 +659,6 @@
new= pass_on_compbuf(img);
}
else {
- NodeBlurData *nbd= node->storage;
CompBuf *gammabuf;
/* make output size of input image */
More information about the Bf-blender-cvs
mailing list