Libvje / refactor : transblend

* frame->width, frame->height
This commit is contained in:
[d.j.a.y] Jerome Blanchi
2016-04-20 21:18:39 +02:00
parent 2c2f242027
commit ddc8b56e9a
4 changed files with 14 additions and 16 deletions

View File

@@ -327,9 +327,9 @@ extern void revtv_apply( VJFrame *frame, int space, int vscale, int c, int cn);
extern void softblur_apply( VJFrame *frame, int width, int height, int n); ////TODO refactor call
extern void split_apply( VJFrame *frame, VJFrame *frame2, int n, int swap);
extern void widthmirror_apply( VJFrame *frame, int div);
extern void transblend_apply(VJFrame *frame, VJFrame *frame2, int w,
int h, int mode, int twidth, int theight,
int x1, int y1, int x2, int y2);
extern void transblend_apply(VJFrame *frame, VJFrame *frame2, int mode,
int twidth, int theight,
int x1, int y1, int x2, int y2);
extern void borders_apply(VJFrame *frame, int width, int height,
int size, int color);

View File

@@ -61,9 +61,9 @@ vj_effect *transblend_init(int width, int height)
void transblend_apply( VJFrame *frame, VJFrame *frame2, int width,
int height, int type, int twidth, int theight,
int x1, int y1, int x2, int y2)
void transblend_apply( VJFrame *frame, VJFrame *frame2, int type,
int twidth, int theight,
int x1, int y1, int x2, int y2)
{
int x, y;
@@ -89,13 +89,13 @@ void transblend_apply( VJFrame *frame, VJFrame *frame2, int width,
if( (theight + y2) > height ) y2 = (height-theight);
if( (twidth + x2) > width) x2 = (width-twidth);
if( (theight + y2) > frame->height ) y2 = (frame->height-theight);
if( (twidth + x2) > frame->width) x2 = (frame->width-twidth);
for (y = 0; y < theight; y++) {
for (x = 0; x < twidth; x++) {
p = (y2 + y) * width + x2 + x;
q = (y1 + y) * width + x1 + x;
p = (y2 + y) * frame->width + x2 + x;
q = (y1 + y) * frame->width + x1 + x;
Y[p] = func_y(Y[p], Y2[q]);
}
}

View File

@@ -26,9 +26,8 @@
vj_effect *transblend_init(int width, int height);
void transblend_apply( VJFrame *frame, VJFrame *frame2, int w, int h,
int mode, int twidth, int theight, int x1, int y1,
int x2, int y2);
void transblend_apply( VJFrame *frame, VJFrame *frame2, int mode,
int twidth, int theight, int x1, int y1, int x2, int y2);
#endif

View File

@@ -650,9 +650,8 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in
frames[0]->height, arg[0]);
break;
case VJ_VIDEO_EFFECT_TRANSBLEND:
transblend_apply(frames[0], frames[1], frames[0]->width, frames[0]->height,
arg[0], arg[1], arg[2], arg[3], arg[4], arg[5],
arg[6]);
transblend_apply(frames[0], frames[1], arg[0], arg[1], arg[2], arg[3],
arg[4], arg[5], arg[6]);
break;
case VJ_VIDEO_EFFECT_PICINPIC:
picinpic_apply( vj_effects[entry]->user_data,frames[0], frames[1], frames[0]->width, frames[0]->height,