FFmpeg
Data Structures | Macros | Functions | Variables
vsrc_gradients.c File Reference
#include "avfilter.h"
#include "filters.h"
#include "video.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.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
 
#define VFT   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_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[8][4], int nb_colors, int nb_wrap_colors, float step)
 
static uint64_t lerp_colors16 (uint8_t arr[8][4], int nb_colors, int nb_wrap_colors, float step)
 
static void lerp_colors32 (float arr[8][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 53 of file vsrc_gradients.c.

◆ FLAGS

Definition at line 54 of file vsrc_gradients.c.

◆ VFT

Definition at line 55 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 92 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 99 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 109 of file vsrc_gradients.c.

Referenced by lerp_colors16().

◆ lerp_colors()

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

Definition at line 119 of file vsrc_gradients.c.

Referenced by draw_gradients_slice().

◆ lerp_colors16()

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

Definition at line 142 of file vsrc_gradients.c.

Referenced by draw_gradients_slice16().

◆ lerp_colors32()

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

Definition at line 165 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 251 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 275 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 299 of file vsrc_gradients.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 333 of file vsrc_gradients.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 383 of file vsrc_gradients.c.

Variable Documentation

◆ gradients_options

const AVOption gradients_options[]
static

Definition at line 57 of file vsrc_gradients.c.

◆ gradients_outputs

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

Definition at line 438 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,
.process_command = ff_filter_process_command,
}

Definition at line 446 of file vsrc_gradients.c.

FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:100
AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_RGBA64
Definition: pixfmt.h:492
NULL
#define NULL
Definition: coverity.c:32
gradients_outputs
static const AVFilterPad gradients_outputs[]
Definition: vsrc_gradients.c:438
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:94
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:900
GradientsContext
Definition: vsrc_gradients.c:31
FILTER_PIXFMTS
#define FILTER_PIXFMTS(...)
Definition: filters.h:248
AV_PIX_FMT_GBRAPF32
#define AV_PIX_FMT_GBRAPF32
Definition: pixfmt.h:533
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:152
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
activate
static int activate(AVFilterContext *ctx)
Definition: vsrc_gradients.c:383
config_output
static int config_output(AVFilterLink *outlink)
Definition: vsrc_gradients.c:333