FFmpeg
Data Structures | Macros | Functions | Variables
vsrc_gradients.c File Reference
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "video.h"
#include "internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/lfg.h"
#include "libavutil/random_seed.h"
#include <float.h>
#include <math.h>

Go to the source code of this file.

Data Structures

struct  GradientsContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (gradients)
 
static float lerpf (float a, float b, float x)
 
static uint32_t lerp_color (uint8_t c0[4], uint8_t c1[4], float x)
 
static uint64_t lerp_color16 (uint8_t c0[4], uint8_t c1[4], float x)
 
static uint32_t lerp_colors (uint8_t arr[3][4], int nb_colors, int nb_wrap_colors, float step)
 
static uint64_t lerp_colors16 (uint8_t arr[3][4], int nb_colors, int nb_wrap_colors, float step)
 
static void lerp_colors32 (float arr[3][4], int nb_colors, int nb_wrap_colors, float step, float *r, float *g, float *b, float *a)
 
static float project (float origin_x, float origin_y, float dest_x, float dest_y, float point_x, float point_y, int type)
 
static int draw_gradients_slice (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int draw_gradients_slice16 (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int draw_gradients_slice32_planar (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption gradients_options []
 
static const AVFilterPad gradients_outputs []
 
const AVFilter ff_vsrc_gradients
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 56 of file vsrc_gradients.c.

◆ FLAGS

Definition at line 57 of file vsrc_gradients.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( gradients  )

◆ lerpf()

static float lerpf ( float  a,
float  b,
float  x 
)
static

Definition at line 93 of file vsrc_gradients.c.

Referenced by lerp_colors32().

◆ lerp_color()

static uint32_t lerp_color ( uint8_t  c0[4],
uint8_t  c1[4],
float  x 
)
static

Definition at line 100 of file vsrc_gradients.c.

Referenced by lerp_colors().

◆ lerp_color16()

static uint64_t lerp_color16 ( uint8_t  c0[4],
uint8_t  c1[4],
float  x 
)
static

Definition at line 110 of file vsrc_gradients.c.

Referenced by lerp_colors16().

◆ lerp_colors()

static uint32_t lerp_colors ( uint8_t  arr[3][4],
int  nb_colors,
int  nb_wrap_colors,
float  step 
)
static

Definition at line 120 of file vsrc_gradients.c.

Referenced by draw_gradients_slice().

◆ lerp_colors16()

static uint64_t lerp_colors16 ( uint8_t  arr[3][4],
int  nb_colors,
int  nb_wrap_colors,
float  step 
)
static

Definition at line 143 of file vsrc_gradients.c.

Referenced by draw_gradients_slice16().

◆ lerp_colors32()

static void lerp_colors32 ( float  arr[3][4],
int  nb_colors,
int  nb_wrap_colors,
float  step,
float r,
float g,
float b,
float a 
)
static

Definition at line 166 of file vsrc_gradients.c.

Referenced by draw_gradients_slice32_planar().

◆ project()

static float project ( float  origin_x,
float  origin_y,
float  dest_x,
float  dest_y,
float  point_x,
float  point_y,
int  type 
)
static

◆ draw_gradients_slice()

static int draw_gradients_slice ( AVFilterContext ctx,
void *  arg,
int  job,
int  nb_jobs 
)
static

Definition at line 246 of file vsrc_gradients.c.

Referenced by config_output().

◆ draw_gradients_slice16()

static int draw_gradients_slice16 ( AVFilterContext ctx,
void *  arg,
int  job,
int  nb_jobs 
)
static

Definition at line 269 of file vsrc_gradients.c.

Referenced by config_output().

◆ draw_gradients_slice32_planar()

static int draw_gradients_slice32_planar ( AVFilterContext ctx,
void *  arg,
int  job,
int  nb_jobs 
)
static

Definition at line 292 of file vsrc_gradients.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 325 of file vsrc_gradients.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 374 of file vsrc_gradients.c.

Variable Documentation

◆ gradients_options

const AVOption gradients_options[]
static

Definition at line 59 of file vsrc_gradients.c.

◆ gradients_outputs

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

Definition at line 415 of file vsrc_gradients.c.

◆ ff_vsrc_gradients

const AVFilter ff_vsrc_gradients
Initial value:
= {
.name = "gradients",
.description = NULL_IF_CONFIG_SMALL("Draw a gradients."),
.priv_size = sizeof(GradientsContext),
.priv_class = &gradients_class,
.activate = activate,
}

Definition at line 423 of file vsrc_gradients.c.

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:398
NULL
#define NULL
Definition: coverity.c:32
gradients_outputs
static const AVFilterPad gradients_outputs[]
Definition: vsrc_gradients.c:415
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
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
FILTER_PIXFMTS
#define FILTER_PIXFMTS(...)
Definition: internal.h:176
GradientsContext
Definition: vsrc_gradients.c:35
AV_PIX_FMT_GBRAPF32
#define AV_PIX_FMT_GBRAPF32
Definition: pixfmt.h:438
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:127
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
activate
static int activate(AVFilterContext *ctx)
Definition: vsrc_gradients.c:374
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
config_output
static int config_output(AVFilterLink *outlink)
Definition: vsrc_gradients.c:325