diff options
author | Juho Vepsalainen <bebraw@gmail.com> | 2008-01-07 18:44:45 +0300 |
---|---|---|
committer | Juho Vepsalainen <bebraw@gmail.com> | 2008-01-07 18:44:45 +0300 |
commit | adc68be1a87781112667005455e13f4f1514a7f2 (patch) | |
tree | 357b74931b5594dbe3ebeee306e1521d0eb2310f /source/blender/nodes/intern/CMP_nodes | |
parent | 011e0a93dde724650a6ec6315110c4d6bc615913 (diff) |
Blur Node to support Relative (percent) values
This commit makes it possible to use relative values when using a Blur node. There
is a new toggle in the node that can be used to enable the feature.
Thanks to David Millan Escriva for contribution!
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes')
-rw-r--r-- | source/blender/nodes/intern/CMP_nodes/CMP_blur.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c index 8ef4af4d219..3d6b3dd2955 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c @@ -22,7 +22,8 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Campbell Barton, Alfredo de Greef, David Millan Escriva, + * Juho Vepsäläinen * * ***** END GPL LICENSE BLOCK ***** */ @@ -556,16 +557,20 @@ static void blur_with_reference(bNode *node, CompBuf *new, CompBuf *img, CompBuf static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { CompBuf *new, *img= in[0]->data; + NodeBlurData *nbd= node->storage; - if(img==NULL || out[0]->hasoutput==0) - return; + if(img==NULL) return; + + /* store image in size that is needed for absolute/relative conversions on ui level */ + nbd->image_in_width= img->x; + nbd->image_in_height= img->y; + + if(out[0]->hasoutput==0) return; if (((NodeBlurData *)node->storage)->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];*/ - - NodeBlurData *nbd= node->storage; const float sx = ((float)nbd->sizex)/2.0f, sy = ((float)nbd->sizey)/2.0f; int c; |