mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-24 16:49:59 +01:00
Libvje / refactor : opacity
* frame->width, frame->height
This commit is contained in:
@@ -113,8 +113,7 @@ static inline int blend_plane( uint8_t *dst, uint8_t *A, uint8_t *B, int size, i
|
||||
#endif
|
||||
|
||||
|
||||
static void opacity_apply1( VJFrame *frame, VJFrame *frame2, int width,
|
||||
int height, int opacity)
|
||||
static void opacity_apply1( VJFrame *frame, VJFrame *frame2, int opacity)
|
||||
{
|
||||
int y = blend_plane( frame->data[0], frame->data[0], frame2->data[0], frame->len, opacity );
|
||||
int u = blend_plane( frame->data[1], frame->data[1], frame2->data[1], (frame->ssm ? frame->len : frame->uv_len), opacity );
|
||||
@@ -154,21 +153,19 @@ static void opacity_apply_job( void *arg )
|
||||
|
||||
}
|
||||
|
||||
void opacity_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
int height, int opacity)
|
||||
void opacity_apply( VJFrame *frame, VJFrame *frame2, int opacity)
|
||||
{
|
||||
opacity_apply1( frame,frame2,width,height,opacity );
|
||||
opacity_apply1( frame, frame2, opacity);
|
||||
}
|
||||
|
||||
void opacity_applyN( VJFrame *frame, VJFrame *frame2, int width,
|
||||
int height, int opacity)
|
||||
void opacity_applyN( VJFrame *frame, VJFrame *frame2, int opacity)
|
||||
{
|
||||
if( vj_task_available() ) {
|
||||
vj_task_set_from_frame( frame );
|
||||
vj_task_set_param( opacity,0 );
|
||||
vj_task_run( frame->data, frame2->data, NULL, NULL, 3, (performer_job_routine) &opacity_apply_job );
|
||||
} else {
|
||||
opacity_apply1( frame,frame2,width,height,opacity );
|
||||
opacity_apply1( frame,frame2,opacity );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,10 @@
|
||||
#include <stdint.h>
|
||||
|
||||
vj_effect *opacity_init(int w, int h);
|
||||
void opacity_apply( VJFrame *frame, VJFrame *frame2, int width,
|
||||
int height, int opacity);
|
||||
void opacity_apply( VJFrame *frame, VJFrame *frame2, int opacity);
|
||||
|
||||
void opacity_blend_luma_apply( uint8_t *src, uint8_t *dst, int len, int opacity );
|
||||
void opacity_blend_apply( uint8_t *src[3], uint8_t *dst[3], int len, int uv_len, int opacity );
|
||||
void opacity_applyN( VJFrame *frame, VJFrame *frame2, int width, int height, int opacity);
|
||||
void opacity_applyN( VJFrame *frame, VJFrame *frame2, int opacity);
|
||||
void opacity_free();
|
||||
#endif
|
||||
|
||||
@@ -147,7 +147,7 @@ void scratcher_apply(VJFrame *src,
|
||||
srcB.data[0] = frame[0] + offset;
|
||||
srcB.data[1] = frame[1] + uv_offset;
|
||||
srcB.data[2] = frame[2] + uv_offset;
|
||||
opacity_applyN( src, &srcB, src->width,src->height, opacity );
|
||||
opacity_applyN( src, &srcB, opacity );
|
||||
copy.uv_len = src->uv_len;
|
||||
copy.data[0] = frame[0];
|
||||
copy.data[1] = frame[1];
|
||||
|
||||
@@ -319,8 +319,7 @@ extern void negation_apply( VJFrame *frame, int val);
|
||||
extern void medianfilter_apply( VJFrame *frame, int val);
|
||||
extern void negatechannel_apply( VJFrame *frame, int chan, int val);
|
||||
extern void colormap_apply( VJFrame *frame, int r, int g, int b);
|
||||
extern void opacity_apply(VJFrame *frame, VJFrame *frame2, int width,
|
||||
int height, int opacity);
|
||||
extern void opacity_apply(VJFrame *frame, VJFrame *frame2, int opacity);
|
||||
extern void opacityadv_apply(VJFrame *frame, VJFrame *frame2, int w,
|
||||
int h, int o, int t1, int t2);
|
||||
extern void opacitythreshold_apply(VJFrame *frame, VJFrame *frame2,
|
||||
|
||||
@@ -510,8 +510,7 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in
|
||||
case VJ_VIDEO_EFFECT_DISSOLVE:
|
||||
dissolve_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0]);break;
|
||||
case VJ_VIDEO_EFFECT_OPACITY:
|
||||
opacity_apply(frames[0], frames[1], frames[0]->width,
|
||||
frames[0]->height, arg[0]);
|
||||
opacity_apply(frames[0], frames[1], arg[0]);
|
||||
break;
|
||||
case VJ_VIDEO_EFFECT_IRIS:
|
||||
iris_apply( frames[0],frames[1], frames[0]->width,frames[0]->height,arg[0],arg[1]);
|
||||
|
||||
Reference in New Issue
Block a user