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:
authorLukas Toenne <lukas.toenne@googlemail.com>2011-02-10 23:54:02 +0300
committerLukas Toenne <lukas.toenne@googlemail.com>2011-02-10 23:54:02 +0300
commit46bb5643b7660033bc0d15c5fcc752324a1b519f (patch)
treeae9f798b1ce120af18a1b3bb98e876349b605000 /source/blender/nodes/intern
parentcbe53cc48d5e4460c2d04d1344bd30a882b2cadb (diff)
Different method for blur node aspect correction. Now the user can still set different sizes for x/y blurring in relative mode, but choose to use aspect correction on either of the axes.
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_blur.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
index d92ee6924c9..75aca3e0428 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
@@ -577,17 +577,19 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
if(out[0]->hasoutput==0) return;
- switch (nbd->size_type) {
- case CMP_NODE_BLUR_SIZE_WIDTH:
- nbd->sizex= nbd->sizey= (int)(nbd->percentx*0.01f*nbd->image_in_width);
- break;
- case CMP_NODE_BLUR_SIZE_HEIGHT:
- nbd->sizex= nbd->sizey= (int)(nbd->percenty*0.01f*nbd->image_in_height);
- break;
- case CMP_NODE_BLUR_SIZE_BOTH:
- nbd->sizex= (int)(nbd->percentx*0.01f*nbd->image_in_width);
- nbd->sizey= (int)(nbd->percenty*0.01f*nbd->image_in_height);
- break;
+ if(nbd->relative) {
+ if (nbd->aspect==CMP_NODE_BLUR_ASPECT_NONE) {
+ nbd->sizex= (int)(nbd->percentx*0.01f*nbd->image_in_width);
+ nbd->sizey= (int)(nbd->percenty*0.01f*nbd->image_in_height);
+ }
+ else if (nbd->aspect==CMP_NODE_BLUR_ASPECT_Y) {
+ nbd->sizex= (int)(nbd->percentx*0.01f*nbd->image_in_width);
+ nbd->sizey= (int)(nbd->percenty*0.01f*nbd->image_in_width);
+ }
+ else if (nbd->aspect==CMP_NODE_BLUR_ASPECT_X) {
+ nbd->sizex= (int)(nbd->percentx*0.01f*nbd->image_in_height);
+ nbd->sizey= (int)(nbd->percenty*0.01f*nbd->image_in_height);
+ }
}
if (nbd->sizex==0 && nbd->sizey==0) {