FFmpeg  4.0
Data Structures | Macros | Functions | Variables
vf_colorlevels.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.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  Range
 
struct  ColorLevelsContext
 

Macros

#define R   0
 
#define G   1
 
#define B   2
 
#define A   3
 
#define OFFSET(x)   offsetof(ColorLevelsContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (colorlevels)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption colorlevels_options []
 
static const AVFilterPad colorlevels_inputs []
 
static const AVFilterPad colorlevels_outputs []
 
AVFilter ff_vf_colorlevels
 

Macro Definition Documentation

◆ R

#define R   0

Definition at line 30 of file vf_colorlevels.c.

◆ G

#define G   1

Definition at line 31 of file vf_colorlevels.c.

◆ B

#define B   2

Definition at line 32 of file vf_colorlevels.c.

◆ A

#define A   3

Definition at line 33 of file vf_colorlevels.c.

◆ OFFSET

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

Definition at line 50 of file vf_colorlevels.c.

◆ FLAGS

Definition at line 51 of file vf_colorlevels.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( colorlevels  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 74 of file vf_colorlevels.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 93 of file vf_colorlevels.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 108 of file vf_colorlevels.c.

Variable Documentation

◆ colorlevels_options

const AVOption colorlevels_options[]
static
Initial value:
= {
{ "rimin", "set input red black point", OFFSET(range[R].in_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "gimin", "set input green black point", OFFSET(range[G].in_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "bimin", "set input blue black point", OFFSET(range[B].in_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "aimin", "set input alpha black point", OFFSET(range[A].in_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "rimax", "set input red white point", OFFSET(range[R].in_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -1, 1, FLAGS },
{ "gimax", "set input green white point", OFFSET(range[G].in_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -1, 1, FLAGS },
{ "bimax", "set input blue white point", OFFSET(range[B].in_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -1, 1, FLAGS },
{ "aimax", "set input alpha white point", OFFSET(range[A].in_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -1, 1, FLAGS },
{ "romin", "set output red black point", OFFSET(range[R].out_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, FLAGS },
{ "gomin", "set output green black point", OFFSET(range[G].out_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, FLAGS },
{ "bomin", "set output blue black point", OFFSET(range[B].out_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, FLAGS },
{ "aomin", "set output alpha black point", OFFSET(range[A].out_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, FLAGS },
{ "romax", "set output red white point", OFFSET(range[R].out_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
{ "gomax", "set output green white point", OFFSET(range[G].out_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
{ "bomax", "set output blue white point", OFFSET(range[B].out_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
{ "aomax", "set output alpha white point", OFFSET(range[A].out_max), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define G
#define A
#define FLAGS
#define B
#define OFFSET(x)
#define R

Definition at line 52 of file vf_colorlevels.c.

◆ colorlevels_inputs

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

Definition at line 229 of file vf_colorlevels.c.

◆ colorlevels_outputs

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

Definition at line 239 of file vf_colorlevels.c.

◆ ff_vf_colorlevels

AVFilter ff_vf_colorlevels
Initial value:
= {
.name = "colorlevels",
.description = NULL_IF_CONFIG_SMALL("Adjust the color levels."),
.priv_size = sizeof(ColorLevelsContext),
.priv_class = &colorlevels_class,
}
#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 query_formats(AVFilterContext *ctx)
static int flags
Definition: log.c:55
static const AVFilterPad colorlevels_inputs[]
#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 colorlevels_outputs[]

Definition at line 247 of file vf_colorlevels.c.