From 46bb5643b7660033bc0d15c5fcc752324a1b519f Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Thu, 10 Feb 2011 20:54:02 +0000 Subject: 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. --- source/blender/nodes/intern/CMP_nodes/CMP_blur.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'source/blender/nodes/intern/CMP_nodes') 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) { -- cgit v1.2.3