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

Go to the source code of this file.

Data Structures

struct  ColorkeyContext
 

Macros

#define COLORKEY_SLICE(name, type)
 
#define COLORHOLD_SLICE(name, type, htype)
 
#define OFFSET(x)   offsetof(ColorkeyContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static int do_colorkey_pixel (const uint8_t *colorkey_rgba, int r, int g, int b, float similarity, float iblend, int max, double scale)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static av_cold int config_output (AVFilterLink *outlink)
 

Variables

static enum AVPixelFormat pixel_fmts []
 
static const AVFilterPad colorkey_inputs []
 
static const AVFilterPad colorkey_outputs []
 

Macro Definition Documentation

◆ COLORKEY_SLICE

#define COLORKEY_SLICE (   name,
  type 
)

Definition at line 66 of file vf_colorkey.c.

◆ COLORHOLD_SLICE

#define COLORHOLD_SLICE (   name,
  type,
  htype 
)

Definition at line 102 of file vf_colorkey.c.

◆ OFFSET

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

Definition at line 213 of file vf_colorkey.c.

◆ FLAGS

Definition at line 214 of file vf_colorkey.c.

Function Documentation

◆ do_colorkey_pixel()

static int do_colorkey_pixel ( const uint8_t *  colorkey_rgba,
int  r,
int  g,
int  b,
float  similarity,
float  iblend,
int  max,
double  scale 
)
static

Definition at line 48 of file vf_colorkey.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 150 of file vf_colorkey.c.

◆ config_output()

static av_cold int config_output ( AVFilterLink outlink)
static

Definition at line 163 of file vf_colorkey.c.

Variable Documentation

◆ pixel_fmts

enum AVPixelFormat pixel_fmts[]
static

◆ colorkey_inputs

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

Definition at line 196 of file vf_colorkey.c.

◆ colorkey_outputs

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

Definition at line 205 of file vf_colorkey.c.

AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_colorkey.c:150
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_RGBA64
Definition: pixfmt.h:449
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
AV_PIX_FMT_BGRA64
#define AV_PIX_FMT_BGRA64
Definition: pixfmt.h:454
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
config_output
static av_cold int config_output(AVFilterLink *outlink)
Definition: vf_colorkey.c:163
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