mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-23 00:00:02 +01:00
Libvje / refactor : transblend
* frame->width, frame->height
This commit is contained in:
@@ -327,8 +327,8 @@ 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 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 split_apply( VJFrame *frame, VJFrame *frame2, int n, int swap);
|
||||||
extern void widthmirror_apply( VJFrame *frame, int div);
|
extern void widthmirror_apply( VJFrame *frame, int div);
|
||||||
extern void transblend_apply(VJFrame *frame, VJFrame *frame2, int w,
|
extern void transblend_apply(VJFrame *frame, VJFrame *frame2, int mode,
|
||||||
int h, int mode, int twidth, int theight,
|
int twidth, int theight,
|
||||||
int x1, int y1, int x2, int y2);
|
int x1, int y1, int x2, int y2);
|
||||||
|
|
||||||
extern void borders_apply(VJFrame *frame, int width, int height,
|
extern void borders_apply(VJFrame *frame, int width, int height,
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ vj_effect *transblend_init(int width, int height)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void transblend_apply( VJFrame *frame, VJFrame *frame2, int width,
|
void transblend_apply( VJFrame *frame, VJFrame *frame2, int type,
|
||||||
int height, int type, int twidth, int theight,
|
int twidth, int theight,
|
||||||
int x1, int y1, int x2, int y2)
|
int x1, int y1, int x2, int y2)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -89,13 +89,13 @@ void transblend_apply( VJFrame *frame, VJFrame *frame2, int width,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( (theight + y2) > height ) y2 = (height-theight);
|
if( (theight + y2) > frame->height ) y2 = (frame->height-theight);
|
||||||
if( (twidth + x2) > width) x2 = (width-twidth);
|
if( (twidth + x2) > frame->width) x2 = (frame->width-twidth);
|
||||||
|
|
||||||
for (y = 0; y < theight; y++) {
|
for (y = 0; y < theight; y++) {
|
||||||
for (x = 0; x < twidth; x++) {
|
for (x = 0; x < twidth; x++) {
|
||||||
p = (y2 + y) * width + x2 + x;
|
p = (y2 + y) * frame->width + x2 + x;
|
||||||
q = (y1 + y) * width + x1 + x;
|
q = (y1 + y) * frame->width + x1 + x;
|
||||||
Y[p] = func_y(Y[p], Y2[q]);
|
Y[p] = func_y(Y[p], Y2[q]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,8 @@
|
|||||||
|
|
||||||
vj_effect *transblend_init(int width, int height);
|
vj_effect *transblend_init(int width, int height);
|
||||||
|
|
||||||
void transblend_apply( VJFrame *frame, VJFrame *frame2, int w, int h,
|
void transblend_apply( VJFrame *frame, VJFrame *frame2, int mode,
|
||||||
int mode, int twidth, int theight, int x1, int y1,
|
int twidth, int theight, int x1, int y1, int x2, int y2);
|
||||||
int x2, int y2);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -650,9 +650,8 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in
|
|||||||
frames[0]->height, arg[0]);
|
frames[0]->height, arg[0]);
|
||||||
break;
|
break;
|
||||||
case VJ_VIDEO_EFFECT_TRANSBLEND:
|
case VJ_VIDEO_EFFECT_TRANSBLEND:
|
||||||
transblend_apply(frames[0], frames[1], frames[0]->width, frames[0]->height,
|
transblend_apply(frames[0], frames[1], arg[0], arg[1], arg[2], arg[3],
|
||||||
arg[0], arg[1], arg[2], arg[3], arg[4], arg[5],
|
arg[4], arg[5], arg[6]);
|
||||||
arg[6]);
|
|
||||||
break;
|
break;
|
||||||
case VJ_VIDEO_EFFECT_PICINPIC:
|
case VJ_VIDEO_EFFECT_PICINPIC:
|
||||||
picinpic_apply( vj_effects[entry]->user_data,frames[0], frames[1], frames[0]->width, frames[0]->height,
|
picinpic_apply( vj_effects[entry]->user_data,frames[0], frames[1], frames[0]->width, frames[0]->height,
|
||||||
|
|||||||
Reference in New Issue
Block a user