FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_colorkey.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  ColorkeyContext
 

Macros

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

Functions

static uint8_t do_colorkey_pixel (ColorkeyContext *ctx, uint8_t r, uint8_t g, uint8_t b)
 
static int do_colorkey_slice (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static av_cold int config_output (AVFilterLink *outlink)
 
static av_cold int query_formats (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (colorkey)
 

Variables

static const AVFilterPad colorkey_inputs []
 
static const AVFilterPad colorkey_outputs []
 
static const AVOption colorkey_options []
 
AVFilter ff_vf_colorkey
 

Macro Definition Documentation

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

Definition at line 148 of file vf_colorkey.c.

Definition at line 149 of file vf_colorkey.c.

Function Documentation

static uint8_t do_colorkey_pixel ( ColorkeyContext ctx,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)
static

Definition at line 39 of file vf_colorkey.c.

Referenced by do_colorkey_slice().

static int do_colorkey_slice ( AVFilterContext avctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 54 of file vf_colorkey.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 80 of file vf_colorkey.c.

static av_cold int config_output ( AVFilterLink outlink)
static

Definition at line 94 of file vf_colorkey.c.

static av_cold int query_formats ( AVFilterContext avctx)
static

Definition at line 111 of file vf_colorkey.c.

AVFILTER_DEFINE_CLASS ( colorkey  )

Variable Documentation

const AVFilterPad colorkey_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_colorkey.c:80

Definition at line 130 of file vf_colorkey.c.

const AVFilterPad colorkey_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static av_cold int config_output(AVFilterLink *outlink)
Definition: vf_colorkey.c:94

Definition at line 139 of file vf_colorkey.c.

const AVOption colorkey_options[]
static
Initial value:
= {
{ "color", "set the colorkey key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
{ "similarity", "set the colorkey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS },
{ "blend", "set the colorkey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: vf_colorkey.c:149
#define OFFSET(x)
Definition: vf_colorkey.c:148

Definition at line 151 of file vf_colorkey.c.

AVFilter ff_vf_colorkey
Initial value:
= {
.name = "colorkey",
.description = NULL_IF_CONFIG_SMALL("Turns a certain color into transparency. Operates on RGB colors."),
.priv_size = sizeof(ColorkeyContext),
.priv_class = &colorkey_class,
}
static const AVFilterPad colorkey_outputs[]
Definition: vf_colorkey.c:139
#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:122
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:113
static const AVFilterPad colorkey_inputs[]
Definition: vf_colorkey.c:130
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:385
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:375
static int flags
Definition: cpu.c:47
static av_cold int query_formats(AVFilterContext *avctx)
Definition: vf_colorkey.c:111

Definition at line 160 of file vf_colorkey.c.