From 18e94d8e9858b6243b6b2c3e172e37b45a97630c Mon Sep 17 00:00:00 2001 From: "[d.j.a.y] Jerome Blanchi" Date: Sat, 30 Jul 2016 14:53:25 +0200 Subject: [PATCH] Libvje / refactor : mirror (fix) * w, h * clean headers --- .../veejay-server/libvje/effects/mirrors.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/veejay-current/veejay-server/libvje/effects/mirrors.c b/veejay-current/veejay-server/libvje/effects/mirrors.c index 91a7c45c..d4df20ee 100644 --- a/veejay-current/veejay-server/libvje/effects/mirrors.c +++ b/veejay-current/veejay-server/libvje/effects/mirrors.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "mirrors.h" -#include "common.h" vj_effect *mirrors_init(int width,int height) { @@ -138,13 +135,15 @@ static int N__ = 0; void mirrors_apply(VJFrame *frame, int type, int factor ) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; int interpolate = 1; int motion = 0; int tmp1 = 0; int tmp2 = factor; if( motionmap_active() ) { - int hi = (int)((float)(frame->width * 0.33)); + int hi = (int)((float)(width * 0.33)); motionmap_scale_to( hi,hi,0,0,&tmp1,&tmp2,&n__,&N__); motion = 1; @@ -158,16 +157,16 @@ void mirrors_apply(VJFrame *frame, int type, int factor ) switch (type) { case 0: - _mirrors_v(frame->data, frame->width, frame->height, tmp2, 0); + _mirrors_v(frame->data, width, height, tmp2, 0); break; case 1: - _mirrors_v(frame->data,frame->width, frame->height,tmp2,1); + _mirrors_v(frame->data,width, height,tmp2,1); break; case 2: - _mirrors_h(frame->data,frame->width, frame->height,tmp2,0); + _mirrors_h(frame->data,width, height,tmp2,0); break; case 3: - _mirrors_h(frame->data,frame->width, frame->height,tmp2,1); + _mirrors_h(frame->data,width, height,tmp2,1); break; }