add FX travel matte (alpha) and feather mask (alpha)

This commit is contained in:
niels
2015-11-01 18:54:02 +01:00
parent 33cc1c9018
commit 03efbfdd01
5 changed files with 21 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ EXTRA_DIST += effects/autoeq.h effects/crosspixel.h effects/mask.h effects/rawva
effects/contrast.h effects/magicscratcher.h effects/rawman.h effects/zoom.h effects/iris.h \ effects/contrast.h effects/magicscratcher.h effects/rawman.h effects/zoom.h effects/iris.h \
effects/cali.h effects/median.h effects/average-blend.h effects/perspective.h \ effects/cali.h effects/median.h effects/average-blend.h effects/perspective.h \
effects/toalpha.h effects/mixtoalpha.h effects/alpha2img.h effects/alphafill.h effects/alphaflatten.h \ effects/toalpha.h effects/mixtoalpha.h effects/alpha2img.h effects/alphafill.h effects/alphaflatten.h \
effects/magicalphaoverlays.h effects/magicalphaoverlays.h effects/travelmatte.h effects/feathermask.h
EXTRA_DIST += specs/FreeFrame.h specs/frei0r.h EXTRA_DIST += specs/FreeFrame.h specs/frei0r.h
@@ -96,6 +96,6 @@ libvje_la_SOURCES = vj-effect.c vj-effman.c effects/common.c \
effects/contourextract.c effects/maskstop.c effects/photoplay.c effects/videoplay.c effects/rgbchannel.c \ effects/contourextract.c effects/maskstop.c effects/photoplay.c effects/videoplay.c effects/rgbchannel.c \
effects/videowall.c effects/flare.c effects/radioactive.c effects/baltantv.c effects/constantblend.c effects/picinpic.c effects/bgsubtract.c effects/cali.c effects/median.c effects/average-blend.c effects/perspective.c \ effects/videowall.c effects/flare.c effects/radioactive.c effects/baltantv.c effects/constantblend.c effects/picinpic.c effects/bgsubtract.c effects/cali.c effects/median.c effects/average-blend.c effects/perspective.c \
effects/toalpha.c effects/mixtoalpha.c effects/alpha2img.c effects/alphafill.c effects/alphaflatten.c \ effects/toalpha.c effects/mixtoalpha.c effects/alpha2img.c effects/alphafill.c effects/alphaflatten.c \
effects/magicalphaoverlays.c effects/magicalphaoverlays.c effects/travelmatte.c effects/feathermask.c

View File

@@ -122,6 +122,7 @@ enum {
VJ_VIDEO_EFFECT_AVERAGEBLEND = 247, VJ_VIDEO_EFFECT_AVERAGEBLEND = 247,
VJ_VIDEO_EFFECT_MIXTOALPHA = 248, VJ_VIDEO_EFFECT_MIXTOALPHA = 248,
VJ_VIDEO_EFFECT_MAGICALPHA = 249, VJ_VIDEO_EFFECT_MAGICALPHA = 249,
VJ_VIDEO_EFFECT_TRAVELMATTE = 250,
}; };
@@ -223,14 +224,15 @@ enum {
VJ_IMAGE_EFFECT_ALPHA2IMG = 194, VJ_IMAGE_EFFECT_ALPHA2IMG = 194,
VJ_IMAGE_EFFECT_TOALPHA = 195, VJ_IMAGE_EFFECT_TOALPHA = 195,
VJ_IMAGE_EFFECT_ALPHAFLATTEN = 196, VJ_IMAGE_EFFECT_ALPHAFLATTEN = 196,
VJ_IMAGE_EFFECT_ALPHAFEATHERMASK = 197,
VJ_IMAGE_EFFECT_DUMMY=100, VJ_IMAGE_EFFECT_DUMMY=100,
}; };
#define VJ_IMAGE_EFFECT_MIN 100 #define VJ_IMAGE_EFFECT_MIN 100
#define VJ_IMAGE_EFFECT_MAX 197 #define VJ_IMAGE_EFFECT_MAX 198
#define VJ_VIDEO_EFFECT_MIN 200 #define VJ_VIDEO_EFFECT_MIN 200
#define VJ_VIDEO_EFFECT_MAX 250 #define VJ_VIDEO_EFFECT_MAX 251
#define VJ_VIDEO_COUNT (VJ_VIDEO_EFFECT_MAX - VJ_VIDEO_EFFECT_MIN) #define VJ_VIDEO_COUNT (VJ_VIDEO_EFFECT_MAX - VJ_VIDEO_EFFECT_MIN)
@@ -641,4 +643,6 @@ extern void alpha2img_apply( VJFrame *frame, int width, int height);
extern void alphafill_apply( VJFrame *frame, int width, int height, int val); extern void alphafill_apply( VJFrame *frame, int width, int height, int val);
extern void alphaflatten_apply( VJFrame *frame, int width, int height); extern void alphaflatten_apply( VJFrame *frame, int width, int height);
extern void overlayalphamagic_apply(VJFrame *frame, VJFrame *frame2, int width,int height, int n, int visible); extern void overlayalphamagic_apply(VJFrame *frame, VJFrame *frame2, int width,int height, int n, int visible);
extern void travelmatte_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int mode);
extern void feathermask_apply( VJFrame *frame, int width, int height );
#endif #endif

View File

@@ -175,6 +175,8 @@
#include "effects/mixtoalpha.h" #include "effects/mixtoalpha.h"
#include "effects/alphaflatten.h" #include "effects/alphaflatten.h"
#include "effects/magicalphaoverlays.h" #include "effects/magicalphaoverlays.h"
#include "effects/travelmatte.h"
#include "effects/feathermask.h"
#include <libplugger/plugload.h> #include <libplugger/plugload.h>
#include <veejay/vims.h> #include <veejay/vims.h>
@@ -266,6 +268,7 @@ static struct
{ bgsubtract_malloc, bgsubtract_free, VJ_IMAGE_EFFECT_BGSUBTRACT }, { bgsubtract_malloc, bgsubtract_free, VJ_IMAGE_EFFECT_BGSUBTRACT },
{ slicer_malloc, slicer_free, VJ_VIDEO_EFFECT_SLICER }, { slicer_malloc, slicer_free, VJ_VIDEO_EFFECT_SLICER },
{ perspective_malloc, perspective_free, VJ_IMAGE_EFFECT_PERSPECTIVE }, { perspective_malloc, perspective_free, VJ_IMAGE_EFFECT_PERSPECTIVE },
{ feathermask_malloc, feathermask_free, VJ_IMAGE_EFFECT_ALPHAFEATHERMASK },
{ NULL , NULL ,0 }, { NULL , NULL ,0 },
}; };
@@ -576,7 +579,8 @@ void vj_effect_initialize(int width, int height, int full_range)
vj_effects[44] = iris_init(width,height); vj_effects[44] = iris_init(width,height);
vj_effects[48] = mixtoalpha_init(width,height); vj_effects[48] = mixtoalpha_init(width,height);
vj_effects[49] = overlayalphamagic_init(width,height); vj_effects[49] = overlayalphamagic_init(width,height);
vj_effects[50] = dummy_init(width,height); vj_effects[50] = travelmatte_init(width,height);
vj_effects[51] = dummy_init(width,height);
vj_effects[i + 1] = mirrors2_init(width,height); vj_effects[i + 1] = mirrors2_init(width,height);
vj_effects[i + 2] = mirrors_init(width,height); vj_effects[i + 2] = mirrors_init(width,height);
vj_effects[i + 3] = widthmirror_init(width,height); vj_effects[i + 3] = widthmirror_init(width,height);
@@ -673,6 +677,7 @@ void vj_effect_initialize(int width, int height, int full_range)
vj_effects[i + 94 ] = alpha2img_init(width,height); vj_effects[i + 94 ] = alpha2img_init(width,height);
vj_effects[i + 95 ] = toalpha_init(width,height); vj_effects[i + 95 ] = toalpha_init(width,height);
vj_effects[i + 96 ] = alphaflatten_init(width,height); vj_effects[i + 96 ] = alphaflatten_init(width,height);
vj_effects[i + 97 ] = feathermask_init(width,height);
max_width = width; max_width = width;
max_height = height; max_height = height;

View File

@@ -424,6 +424,9 @@ void vj_effman_apply_image_effect(
case VJ_IMAGE_EFFECT_ALPHAFLATTEN: case VJ_IMAGE_EFFECT_ALPHAFLATTEN:
alphaflatten_apply(frames[0],frames[0]->width,frames[0]->height); alphaflatten_apply(frames[0],frames[0]->width,frames[0]->height);
break; break;
case VJ_IMAGE_EFFECT_ALPHAFEATHERMASK:
feathermask_apply(frames[0], frames[0]->width, frames[0]->height );
break;
} }
} }
@@ -652,6 +655,9 @@ void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,int *arg,
case VJ_VIDEO_EFFECT_MAGICALPHA: case VJ_VIDEO_EFFECT_MAGICALPHA:
overlayalphamagic_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]); overlayalphamagic_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]);
break; break;
case VJ_VIDEO_EFFECT_TRAVELMATTE:
travelmatte_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0]);
break;
} }
} }

View File

@@ -22,7 +22,7 @@
#define FX_LIMIT 1024 #define FX_LIMIT 1024
#define MAX_EFFECTS 147 #define MAX_EFFECTS 149
#define PARAM_WIDTH (1<<0x2) #define PARAM_WIDTH (1<<0x2)
#define PARAM_HEIGHT (1<<0x3) #define PARAM_HEIGHT (1<<0x3)
#define PARAM_FADER (1<<0x1) #define PARAM_FADER (1<<0x1)