FFmpeg
Data Structures | Macros | Functions | Variables
vf_shear.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.h"
#include "video.h"
#include <float.h>

Go to the source code of this file.

Data Structures

struct  ShearContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(ShearContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define NN(type, name)
 
#define BL(type, name)
 

Functions

 AVFILTER_DEFINE_CLASS (shear)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_output (AVFilterLink *outlink)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
 

Variables

static const AVOption shear_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_vf_shear
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 59 of file vf_shear.c.

◆ FLAGS

Definition at line 60 of file vf_shear.c.

◆ NN

#define NN (   type,
  name 
)

Definition at line 120 of file vf_shear.c.

◆ BL

#define BL (   type,
  name 
)

Definition at line 166 of file vf_shear.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( shear  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 75 of file vf_shear.c.

Referenced by process_command().

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 88 of file vf_shear.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 225 of file vf_shear.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 253 of file vf_shear.c.

◆ process_command()

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

Definition at line 277 of file vf_shear.c.

Variable Documentation

◆ shear_options

const AVOption shear_options[]
static
Initial value:
= {
{ "shx", "set x shear factor", OFFSET(shx), AV_OPT_TYPE_FLOAT, {.dbl=0.}, -2, 2, .flags=FLAGS },
{ "shy", "set y shear factor", OFFSET(shy), AV_OPT_TYPE_FLOAT, {.dbl=0.}, -2, 2, .flags=FLAGS },
{ "fillcolor", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, 0, 0, .flags=FLAGS },
{ "c", "set background fill color", OFFSET(fillcolor_str), AV_OPT_TYPE_STRING, {.str="black"}, 0, 0, .flags=FLAGS },
{ "interp", "set interpolation", OFFSET(interp), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, .flags=FLAGS, "interp" },
{ "nearest", "nearest neighbour", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, .flags=FLAGS, "interp" },
{ "bilinear", "bilinear", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, .flags=FLAGS, "interp" },
{ NULL }
}

Definition at line 62 of file vf_shear.c.

◆ inputs

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

Definition at line 299 of file vf_shear.c.

◆ outputs

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

Definition at line 307 of file vf_shear.c.

◆ ff_vf_shear

const AVFilter ff_vf_shear
Initial value:
= {
.name = "shear",
.description = NULL_IF_CONFIG_SMALL("Shear transform the input image."),
.priv_size = sizeof(ShearContext),
.init = init,
.priv_class = &shear_class,
.process_command = process_command,
}

Definition at line 315 of file vf_shear.c.

config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_shear.c:253
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_shear.c:88
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Definition: vf_shear.c:277
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_shear.c:225
FLAGS
#define FLAGS
Definition: vf_shear.c:60
outputs
static const AVFilterPad outputs[]
Definition: vf_shear.c:307
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:152
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: vf_shear.c:59
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
inputs
static const AVFilterPad inputs[]
Definition: vf_shear.c:299
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:130
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:227
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_shear.c:75
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
ShearContext
Definition: vf_shear.c:34
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:121
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:153
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233