FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_floodfill.c File Reference
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  Points
 
struct  FloodfillContext
 

Macros

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

Functions

static int is_inside (int x, int y, int w, int h)
 
static int is_same4 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same4_16 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same3 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same3_16 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same1 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same1_16 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static void set_pixel1 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel1_16 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel3 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel3_16 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel4 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel4_16 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void pick_pixel1 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel1_16 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel3 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel3_16 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel4 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel4_16 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static av_cold int query_formats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (floodfill)
 

Variables

static const AVFilterPad floodfill_inputs []
 
static const AVFilterPad floodfill_outputs []
 
static const AVOption floodfill_options []
 
AVFilter ff_vf_floodfill
 

Macro Definition Documentation

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

Definition at line 404 of file vf_floodfill.c.

Definition at line 405 of file vf_floodfill.c.

Function Documentation

static int is_inside ( int  x,
int  y,
int  w,
int  h 
)
static

Definition at line 51 of file vf_floodfill.c.

Referenced by filter_frame().

static int is_same4 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 58 of file vf_floodfill.c.

Referenced by config_input().

static int is_same4_16 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 71 of file vf_floodfill.c.

Referenced by config_input().

static int is_same3 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 84 of file vf_floodfill.c.

Referenced by config_input().

static int is_same3_16 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 96 of file vf_floodfill.c.

Referenced by config_input().

static int is_same1 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 108 of file vf_floodfill.c.

Referenced by config_input().

static int is_same1_16 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 118 of file vf_floodfill.c.

Referenced by config_input().

static void set_pixel1 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 128 of file vf_floodfill.c.

Referenced by config_input().

static void set_pixel1_16 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 134 of file vf_floodfill.c.

Referenced by config_input().

static void set_pixel3 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 140 of file vf_floodfill.c.

Referenced by config_input().

static void set_pixel3_16 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 148 of file vf_floodfill.c.

Referenced by config_input().

static void set_pixel4 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 156 of file vf_floodfill.c.

Referenced by config_input().

static void set_pixel4_16 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 165 of file vf_floodfill.c.

Referenced by config_input().

static void pick_pixel1 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 174 of file vf_floodfill.c.

Referenced by config_input().

static void pick_pixel1_16 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 181 of file vf_floodfill.c.

Referenced by config_input().

static void pick_pixel3 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 188 of file vf_floodfill.c.

Referenced by config_input().

static void pick_pixel3_16 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 199 of file vf_floodfill.c.

Referenced by config_input().

static void pick_pixel4 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 210 of file vf_floodfill.c.

Referenced by config_input().

static void pick_pixel4_16 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 223 of file vf_floodfill.c.

Referenced by config_input().

static int config_input ( AVFilterLink inlink)
static

Definition at line 236 of file vf_floodfill.c.

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 279 of file vf_floodfill.c.

static av_cold int query_formats ( AVFilterContext ctx)
static

Definition at line 343 of file vf_floodfill.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 379 of file vf_floodfill.c.

AVFILTER_DEFINE_CLASS ( floodfill  )

Variable Documentation

const AVFilterPad floodfill_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: vf_floodfill.c:236
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_floodfill.c:279

Definition at line 386 of file vf_floodfill.c.

const AVFilterPad floodfill_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 396 of file vf_floodfill.c.

const AVOption floodfill_options[]
static
Initial value:
= {
{ "x", "set pixel x coordinate", OFFSET(x), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "y", "set pixel y coordinate", OFFSET(y), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "s0", "set source #0 component value", OFFSET(s0), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "s1", "set source #1 component value", OFFSET(s1), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "s2", "set source #2 component value", OFFSET(s2), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "s3", "set source #3 component value", OFFSET(s3), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "d0", "set destination #0 component value", OFFSET(d0), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "d1", "set destination #1 component value", OFFSET(d1), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "d2", "set destination #2 component value", OFFSET(d2), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "d3", "set destination #3 component value", OFFSET(d3), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define s2
Definition: regdef.h:39
#define s0
Definition: regdef.h:37
#define FLAGS
Definition: vf_floodfill.c:405
#define s3
Definition: regdef.h:40
#define s1
Definition: regdef.h:38
#define OFFSET(x)
Definition: vf_floodfill.c:404

Definition at line 407 of file vf_floodfill.c.

AVFilter ff_vf_floodfill
Initial value:
= {
.name = "floodfill",
.description = NULL_IF_CONFIG_SMALL("Fill area with same color with another color."),
.priv_size = sizeof(FloodfillContext),
.priv_class = &floodfill_class,
}
static const AVFilterPad floodfill_outputs[]
Definition: vf_floodfill.c:396
#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:125
static int flags
Definition: log.c:55
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static const AVFilterPad floodfill_inputs[]
Definition: vf_floodfill.c:386
static av_cold int query_formats(AVFilterContext *ctx)
Definition: vf_floodfill.c:343
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_floodfill.c:379

Definition at line 423 of file vf_floodfill.c.