Libav
|
drawtext filter, based on the original vhook/drawtext.c filter by Gustavo Sverzut Barbieri More...
#include <sys/time.h>
#include <time.h>
#include "libavutil/colorspace.h"
#include "libavutil/common.h"
#include "libavutil/file.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
#include "libavutil/random_seed.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/tree.h"
#include "libavutil/lfg.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include <ft2build.h>
#include <FT_FREETYPE_H>
#include <FT_GLYPH_H>
#include <FT_ERRORS_H>
Go to the source code of this file.
Data Structures | |
struct | DrawTextContext |
struct | ft_error |
Macros | |
#define | OFFSET(x) offsetof(DrawTextContext, x) |
#define | FLAGS AV_OPT_FLAG_VIDEO_PARAM |
#define | FT_ERROR_START_LIST { |
#define | FT_ERRORDEF(e, v, s) { (e), (s) }, |
#define | FT_ERROR_END_LIST { 0, NULL } }; |
#define | FT_ERRMSG(e) ft_errors[e].err_msg |
#define | GET_BITMAP_VAL(r, c) |
#define | SET_PIXEL_YUV(frame, yuva_color, val, x, y, hsub, vsub) |
#define | SET_PIXEL_RGB(frame, rgba_color, val, x, y, pixel_step, r_off, g_off, b_off, a_off) |
Typedefs | |
typedef double(* | eval_func2 )(void *, double a, double b) |
Functions | |
static double | drand (void *opaque, double min, double max) |
static const char * | drawtext_get_name (void *ctx) |
static int | glyph_cmp (void *key, const void *b) |
static int | load_glyph (AVFilterContext *ctx, Glyph **glyph_ptr, uint32_t code) |
Load glyphs corresponding to the UTF-32 codepoint code. More... | |
static av_cold int | init (AVFilterContext *ctx) |
static int | query_formats (AVFilterContext *ctx) |
static int | glyph_enu_free (void *opaque, void *elem) |
static av_cold void | uninit (AVFilterContext *ctx) |
static int | is_newline (uint32_t c) |
static int | dtext_prepare_text (AVFilterContext *ctx) |
static int | config_input (AVFilterLink *inlink) |
static int | draw_glyph_yuv (AVFrame *frame, FT_Bitmap *bitmap, unsigned int x, unsigned int y, unsigned int width, unsigned int height, const uint8_t yuva_color[4], int hsub, int vsub) |
static int | draw_glyph_rgb (AVFrame *frame, FT_Bitmap *bitmap, unsigned int x, unsigned int y, unsigned int width, unsigned int height, int pixel_step, const uint8_t rgba_color[4], const uint8_t rgba_map[4]) |
static void | drawbox (AVFrame *frame, unsigned int x, unsigned int y, unsigned int width, unsigned int height, uint8_t *line[4], int pixel_step[4], uint8_t color[4], int hsub, int vsub, int is_rgba_packed, uint8_t rgba_map[4]) |
static int | draw_glyphs (DrawTextContext *s, AVFrame *frame, int width, int height, const uint8_t rgbcolor[4], const uint8_t yuvcolor[4], int x, int y) |
static int | draw_text (AVFilterContext *ctx, AVFrame *frame, int width, int height) |
static int | normalize_double (int *n, double d) |
static int | filter_frame (AVFilterLink *inlink, AVFrame *frame) |
Variables | |
static const char *const | var_names [] |
static const char *const | fun2_names [] |
static const eval_func2 | fun2 [] |
static const AVOption | drawtext_options [] |
static const AVClass | drawtext_class |
struct ft_error | ft_errors [] |
static const AVFilterPad | avfilter_vf_drawtext_inputs [] |
static const AVFilterPad | avfilter_vf_drawtext_outputs [] |
AVFilter | ff_vf_drawtext |
drawtext filter, based on the original vhook/drawtext.c filter by Gustavo Sverzut Barbieri
Definition in file vf_drawtext.c.
#define OFFSET | ( | x | ) | offsetof(DrawTextContext, x) |
Definition at line 145 of file vf_drawtext.c.
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 146 of file vf_drawtext.c.
#define FT_ERROR_START_LIST { |
Definition at line 198 of file vf_drawtext.c.
#define FT_ERRORDEF | ( | e, | |
v, | |||
s | |||
) | { (e), (s) }, |
Definition at line 199 of file vf_drawtext.c.
#define FT_ERROR_END_LIST { 0, NULL } }; |
Definition at line 200 of file vf_drawtext.c.
#define GET_BITMAP_VAL | ( | r, | |
c | |||
) |
Definition at line 616 of file vf_drawtext.c.
Referenced by draw_glyph_rgb(), and draw_glyph_yuv().
#define SET_PIXEL_YUV | ( | frame, | |
yuva_color, | |||
val, | |||
x, | |||
y, | |||
hsub, | |||
vsub | |||
) |
Definition at line 621 of file vf_drawtext.c.
Referenced by draw_glyph_yuv(), and drawbox().
#define SET_PIXEL_RGB | ( | frame, | |
rgba_color, | |||
val, | |||
x, | |||
y, | |||
pixel_step, | |||
r_off, | |||
g_off, | |||
b_off, | |||
a_off | |||
) |
Definition at line 655 of file vf_drawtext.c.
Referenced by draw_glyph_rgb(), and drawbox().
Definition at line 77 of file vf_drawtext.c.
enum var_name |
Definition at line 84 of file vf_drawtext.c.
|
static |
Definition at line 72 of file vf_drawtext.c.
|
static |
Definition at line 186 of file vf_drawtext.c.
Definition at line 221 of file vf_drawtext.c.
Referenced by draw_glyphs(), dtext_prepare_text(), and load_glyph().
|
static |
Load glyphs corresponding to the UTF-32 codepoint code.
Definition at line 231 of file vf_drawtext.c.
Referenced by dtext_prepare_text(), and init().
|
static |
Definition at line 282 of file vf_drawtext.c.
|
static |
Definition at line 377 of file vf_drawtext.c.
Definition at line 393 of file vf_drawtext.c.
Referenced by uninit().
|
static |
Definition at line 399 of file vf_drawtext.c.
|
inlinestatic |
Definition at line 423 of file vf_drawtext.c.
Referenced by dtext_prepare_text().
|
static |
Definition at line 428 of file vf_drawtext.c.
Referenced by config_input(), and filter_frame().
|
static |
Definition at line 554 of file vf_drawtext.c.
|
inlinestatic |
Definition at line 633 of file vf_drawtext.c.
Referenced by draw_glyphs().
|
inlinestatic |
Definition at line 663 of file vf_drawtext.c.
Referenced by draw_glyphs().
|
inlinestatic |
Definition at line 687 of file vf_drawtext.c.
Referenced by avfilter_register_all(), and draw_text().
|
static |
Definition at line 714 of file vf_drawtext.c.
Referenced by draw_text().
|
static |
Definition at line 752 of file vf_drawtext.c.
Referenced by filter_frame().
|
inlinestatic |
Definition at line 784 of file vf_drawtext.c.
Referenced by filter_frame().
|
static |
Definition at line 799 of file vf_drawtext.c.
|
static |
Definition at line 53 of file vf_drawtext.c.
Referenced by config_input().
|
static |
Definition at line 68 of file vf_drawtext.c.
Referenced by config_input().
|
static |
|
static |
Definition at line 148 of file vf_drawtext.c.
|
static |
Definition at line 191 of file vf_drawtext.c.
struct ft_error ft_errors[] |
|
static |
Definition at line 849 of file vf_drawtext.c.
|
static |
Definition at line 861 of file vf_drawtext.c.
AVFilter ff_vf_drawtext |
Definition at line 869 of file vf_drawtext.c.