FFmpeg
Data Structures | Macros | Functions | Variables
vf_lumakey.c File Reference
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  LumakeyContext
 

Macros

#define OFFSET(x)   offsetof(LumakeyContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static int do_lumakey_slice8 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int do_lumakey_slice16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 AVFILTER_DEFINE_CLASS (lumakey)
 

Variables

static enum AVPixelFormat pixel_fmts []
 
static const AVFilterPad lumakey_inputs []
 
static const AVFilterPad lumakey_outputs []
 
static const AVOption lumakey_options []
 
const AVFilter ff_vf_lumakey
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(LumakeyContext, x)

Definition at line 183 of file vf_lumakey.c.

◆ FLAGS

Definition at line 184 of file vf_lumakey.c.

Function Documentation

◆ do_lumakey_slice8()

static int do_lumakey_slice8 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 43 of file vf_lumakey.c.

Referenced by config_input().

◆ do_lumakey_slice16()

static int do_lumakey_slice16 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 75 of file vf_lumakey.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 108 of file vf_lumakey.c.

Referenced by process_command().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 132 of file vf_lumakey.c.

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 154 of file vf_lumakey.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( lumakey  )

Variable Documentation

◆ pixel_fmts

enum AVPixelFormat pixel_fmts[]
static

◆ lumakey_inputs

const AVFilterPad lumakey_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
}

Definition at line 166 of file vf_lumakey.c.

◆ lumakey_outputs

const AVFilterPad lumakey_outputs[]
static
Initial value:
= {
{
.name = "default",
},
}

Definition at line 176 of file vf_lumakey.c.

◆ lumakey_options

const AVOption lumakey_options[]
static
Initial value:
= {
{ "threshold", "set the threshold value", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, FLAGS },
{ "tolerance", "set the tolerance value", OFFSET(tolerance), AV_OPT_TYPE_DOUBLE, {.dbl=0.01}, 0, 1, FLAGS },
{ "softness", "set the softness value", OFFSET(softness), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, FLAGS },
{ NULL }
}

Definition at line 186 of file vf_lumakey.c.

◆ ff_vf_lumakey

const AVFilter ff_vf_lumakey
Initial value:
= {
.name = "lumakey",
.description = NULL_IF_CONFIG_SMALL("Turns a certain luma into transparency."),
.priv_size = sizeof(LumakeyContext),
.priv_class = &lumakey_class,
.process_command = process_command,
}

Definition at line 195 of file vf_lumakey.c.

AV_PIX_FMT_YUVA422P16
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:449
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:170
AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:441
AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:448
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:443
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_lumakey.c:132
LumakeyContext
Definition: vf_lumakey.c:28
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:444
AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:440
AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:450
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
lumakey_inputs
static const AVFilterPad lumakey_inputs[]
Definition: vf_lumakey.c:166
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:447
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: vf_lumakey.c:183
lumakey_outputs
static const AVFilterPad lumakey_outputs[]
Definition: vf_lumakey.c:176
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:445
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:152
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_lumakey.c:145
AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:442
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_lumakey.c:108
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:446
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:127
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_lumakey.c:154
FLAGS
#define FLAGS
Definition: vf_lumakey.c:184
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:166
AVFILTERPAD_FLAG_NEEDS_WRITABLE
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition: internal.h:68