Libvje / refactor : mirror (fix)

* w, h
* clean headers
This commit is contained in:
[d.j.a.y] Jerome Blanchi
2016-07-30 14:53:25 +02:00
parent 0793968fd4
commit 18e94d8e98

View File

@@ -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 <config.h>
#include <stdio.h>
#include <stdint.h>
#include <libvje/vje.h>
#include "common.h"
#include <libvjmem/vjmem.h>
#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;
}