jassub 1.7.13 → 1.7.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -2
- package/dist/js/jassub-worker-modern.js +0 -128
- package/dist/js/jassub-worker-modern.wasm +0 -0
- package/dist/js/jassub-worker.js +0 -128
- package/dist/js/jassub-worker.wasm +0 -0
- package/dist/js/jassub-worker.wasm.js +0 -84
- package/dist/js/jassub.js +0 -832
- package/dist/libraries/bin/brotli.js +0 -1
- package/dist/libraries/include/ass/ass.h +0 -812
- package/dist/libraries/include/ass/ass_types.h +0 -292
- package/dist/libraries/include/brotli/decode.h +0 -344
- package/dist/libraries/include/brotli/encode.h +0 -448
- package/dist/libraries/include/brotli/port.h +0 -288
- package/dist/libraries/include/brotli/types.h +0 -83
- package/dist/libraries/include/expat.h +0 -1064
- package/dist/libraries/include/expat_config.h +0 -115
- package/dist/libraries/include/expat_external.h +0 -165
- package/dist/libraries/include/fontconfig/fcfreetype.h +0 -59
- package/dist/libraries/include/fontconfig/fcprivate.h +0 -134
- package/dist/libraries/include/fontconfig/fontconfig.h +0 -1154
- package/dist/libraries/include/freetype2/freetype/config/ftconfig.h +0 -63
- package/dist/libraries/include/freetype2/freetype/config/ftheader.h +0 -824
- package/dist/libraries/include/freetype2/freetype/config/ftmodule.h +0 -20
- package/dist/libraries/include/freetype2/freetype/config/ftoption.h +0 -1011
- package/dist/libraries/include/freetype2/freetype/config/ftstdlib.h +0 -175
- package/dist/libraries/include/freetype2/freetype/config/integer-types.h +0 -245
- package/dist/libraries/include/freetype2/freetype/config/mac-support.h +0 -49
- package/dist/libraries/include/freetype2/freetype/config/public-macros.h +0 -120
- package/dist/libraries/include/freetype2/freetype/freetype.h +0 -4833
- package/dist/libraries/include/freetype2/freetype/ftadvanc.h +0 -188
- package/dist/libraries/include/freetype2/freetype/ftbbox.h +0 -101
- package/dist/libraries/include/freetype2/freetype/ftbdf.h +0 -212
- package/dist/libraries/include/freetype2/freetype/ftbitmap.h +0 -329
- package/dist/libraries/include/freetype2/freetype/ftbzip2.h +0 -102
- package/dist/libraries/include/freetype2/freetype/ftcache.h +0 -1087
- package/dist/libraries/include/freetype2/freetype/ftchapters.h +0 -147
- package/dist/libraries/include/freetype2/freetype/ftcid.h +0 -167
- package/dist/libraries/include/freetype2/freetype/ftcolor.h +0 -1609
- package/dist/libraries/include/freetype2/freetype/ftdriver.h +0 -1193
- package/dist/libraries/include/freetype2/freetype/fterrdef.h +0 -279
- package/dist/libraries/include/freetype2/freetype/fterrors.h +0 -296
- package/dist/libraries/include/freetype2/freetype/ftfntfmt.h +0 -93
- package/dist/libraries/include/freetype2/freetype/ftgasp.h +0 -143
- package/dist/libraries/include/freetype2/freetype/ftglyph.h +0 -664
- package/dist/libraries/include/freetype2/freetype/ftgxval.h +0 -354
- package/dist/libraries/include/freetype2/freetype/ftgzip.h +0 -151
- package/dist/libraries/include/freetype2/freetype/ftimage.h +0 -1276
- package/dist/libraries/include/freetype2/freetype/ftincrem.h +0 -348
- package/dist/libraries/include/freetype2/freetype/ftlcdfil.h +0 -323
- package/dist/libraries/include/freetype2/freetype/ftlist.h +0 -296
- package/dist/libraries/include/freetype2/freetype/ftlogging.h +0 -184
- package/dist/libraries/include/freetype2/freetype/ftlzw.h +0 -100
- package/dist/libraries/include/freetype2/freetype/ftmac.h +0 -289
- package/dist/libraries/include/freetype2/freetype/ftmm.h +0 -752
- package/dist/libraries/include/freetype2/freetype/ftmodapi.h +0 -806
- package/dist/libraries/include/freetype2/freetype/ftmoderr.h +0 -204
- package/dist/libraries/include/freetype2/freetype/ftotval.h +0 -206
- package/dist/libraries/include/freetype2/freetype/ftoutln.h +0 -586
- package/dist/libraries/include/freetype2/freetype/ftparams.h +0 -203
- package/dist/libraries/include/freetype2/freetype/ftpfr.h +0 -179
- package/dist/libraries/include/freetype2/freetype/ftrender.h +0 -244
- package/dist/libraries/include/freetype2/freetype/ftsizes.h +0 -159
- package/dist/libraries/include/freetype2/freetype/ftsnames.h +0 -272
- package/dist/libraries/include/freetype2/freetype/ftstroke.h +0 -773
- package/dist/libraries/include/freetype2/freetype/ftsynth.h +0 -83
- package/dist/libraries/include/freetype2/freetype/ftsystem.h +0 -352
- package/dist/libraries/include/freetype2/freetype/fttrigon.h +0 -350
- package/dist/libraries/include/freetype2/freetype/fttypes.h +0 -615
- package/dist/libraries/include/freetype2/freetype/ftwinfnt.h +0 -276
- package/dist/libraries/include/freetype2/freetype/t1tables.h +0 -773
- package/dist/libraries/include/freetype2/freetype/ttnameid.h +0 -1235
- package/dist/libraries/include/freetype2/freetype/tttables.h +0 -855
- package/dist/libraries/include/freetype2/freetype/tttags.h +0 -123
- package/dist/libraries/include/freetype2/ft2build.h +0 -42
- package/dist/libraries/include/fribidi/fribidi-arabic.h +0 -81
- package/dist/libraries/include/fribidi/fribidi-begindecls.h +0 -3
- package/dist/libraries/include/fribidi/fribidi-bidi-types-list.h +0 -96
- package/dist/libraries/include/fribidi/fribidi-bidi-types.h +0 -405
- package/dist/libraries/include/fribidi/fribidi-bidi.h +0 -142
- package/dist/libraries/include/fribidi/fribidi-brackets.h +0 -89
- package/dist/libraries/include/fribidi/fribidi-char-sets-list.h +0 -54
- package/dist/libraries/include/fribidi/fribidi-char-sets.h +0 -106
- package/dist/libraries/include/fribidi/fribidi-common.h +0 -158
- package/dist/libraries/include/fribidi/fribidi-config.h +0 -23
- package/dist/libraries/include/fribidi/fribidi-deprecated.h +0 -175
- package/dist/libraries/include/fribidi/fribidi-enddecls.h +0 -3
- package/dist/libraries/include/fribidi/fribidi-flags.h +0 -72
- package/dist/libraries/include/fribidi/fribidi-joining-types-list.h +0 -44
- package/dist/libraries/include/fribidi/fribidi-joining-types.h +0 -249
- package/dist/libraries/include/fribidi/fribidi-joining.h +0 -74
- package/dist/libraries/include/fribidi/fribidi-mirroring.h +0 -86
- package/dist/libraries/include/fribidi/fribidi-shape.h +0 -71
- package/dist/libraries/include/fribidi/fribidi-types.h +0 -79
- package/dist/libraries/include/fribidi/fribidi-unicode-version.h +0 -10
- package/dist/libraries/include/fribidi/fribidi-unicode.h +0 -105
- package/dist/libraries/include/fribidi/fribidi.h +0 -129
- package/dist/libraries/include/harfbuzz/hb-aat-layout.h +0 -795
- package/dist/libraries/include/harfbuzz/hb-aat.h +0 -38
- package/dist/libraries/include/harfbuzz/hb-blob.h +0 -160
- package/dist/libraries/include/harfbuzz/hb-buffer.h +0 -799
- package/dist/libraries/include/harfbuzz/hb-common.h +0 -902
- package/dist/libraries/include/harfbuzz/hb-cplusplus.hh +0 -221
- package/dist/libraries/include/harfbuzz/hb-deprecated.h +0 -251
- package/dist/libraries/include/harfbuzz/hb-draw.h +0 -325
- package/dist/libraries/include/harfbuzz/hb-face.h +0 -181
- package/dist/libraries/include/harfbuzz/hb-font.h +0 -1108
- package/dist/libraries/include/harfbuzz/hb-ft.h +0 -145
- package/dist/libraries/include/harfbuzz/hb-map.h +0 -124
- package/dist/libraries/include/harfbuzz/hb-ot-color.h +0 -146
- package/dist/libraries/include/harfbuzz/hb-ot-deprecated.h +0 -141
- package/dist/libraries/include/harfbuzz/hb-ot-font.h +0 -45
- package/dist/libraries/include/harfbuzz/hb-ot-layout.h +0 -503
- package/dist/libraries/include/harfbuzz/hb-ot-math.h +0 -333
- package/dist/libraries/include/harfbuzz/hb-ot-meta.h +0 -72
- package/dist/libraries/include/harfbuzz/hb-ot-metrics.h +0 -129
- package/dist/libraries/include/harfbuzz/hb-ot-name.h +0 -158
- package/dist/libraries/include/harfbuzz/hb-ot-shape.h +0 -53
- package/dist/libraries/include/harfbuzz/hb-ot-var.h +0 -191
- package/dist/libraries/include/harfbuzz/hb-ot.h +0 -49
- package/dist/libraries/include/harfbuzz/hb-set.h +0 -200
- package/dist/libraries/include/harfbuzz/hb-shape-plan.h +0 -122
- package/dist/libraries/include/harfbuzz/hb-shape.h +0 -62
- package/dist/libraries/include/harfbuzz/hb-style.h +0 -81
- package/dist/libraries/include/harfbuzz/hb-subset-repacker.h +0 -81
- package/dist/libraries/include/harfbuzz/hb-subset.h +0 -234
- package/dist/libraries/include/harfbuzz/hb-unicode.h +0 -643
- package/dist/libraries/include/harfbuzz/hb-version.h +0 -95
- package/dist/libraries/include/harfbuzz/hb.h +0 -50
- package/dist/libraries/lib/cmake/expat-2.4.7/expat-config-version.cmake +0 -70
- package/dist/libraries/lib/cmake/expat-2.4.7/expat-config.cmake +0 -99
- package/dist/libraries/lib/cmake/expat-2.4.7/expat-noconfig.cmake +0 -19
- package/dist/libraries/lib/cmake/expat-2.4.7/expat.cmake +0 -99
- package/dist/libraries/lib/libass.a +0 -0
- package/dist/libraries/lib/libass.la +0 -41
- package/dist/libraries/lib/libbrotlicommon.a +0 -0
- package/dist/libraries/lib/libbrotlidec.a +0 -0
- package/dist/libraries/lib/libbrotlienc.a +0 -0
- package/dist/libraries/lib/libexpat.a +0 -0
- package/dist/libraries/lib/libfontconfig.a +0 -0
- package/dist/libraries/lib/libfontconfig.la +0 -41
- package/dist/libraries/lib/libfreetype.a +0 -0
- package/dist/libraries/lib/libfreetype.la +0 -41
- package/dist/libraries/lib/libfribidi.a +0 -0
- package/dist/libraries/lib/libfribidi.la +0 -41
- package/dist/libraries/lib/libharfbuzz-subset.a +0 -0
- package/dist/libraries/lib/libharfbuzz-subset.la +0 -41
- package/dist/libraries/lib/libharfbuzz.a +0 -0
- package/dist/libraries/lib/libharfbuzz.la +0 -41
- package/dist/libraries/lib/pkgconfig/expat.pc +0 -11
- package/dist/libraries/lib/pkgconfig/fontconfig.pc +0 -18
- package/dist/libraries/lib/pkgconfig/freetype2.pc +0 -14
- package/dist/libraries/lib/pkgconfig/fribidi.pc +0 -13
- package/dist/libraries/lib/pkgconfig/harfbuzz-subset.pc +0 -12
- package/dist/libraries/lib/pkgconfig/harfbuzz.pc +0 -13
- package/dist/libraries/lib/pkgconfig/libass.pc +0 -13
- package/dist/libraries/lib/pkgconfig/libbrotlicommon.pc +0 -11
- package/dist/libraries/lib/pkgconfig/libbrotlidec.pc +0 -12
- package/dist/libraries/lib/pkgconfig/libbrotlienc.pc +0 -12
- package/dist/libraries/share/aclocal/freetype2.m4 +0 -194
- package/dist/libraries/share/doc/expat/AUTHORS +0 -10
- package/dist/libraries/share/doc/expat/changelog +0 -1161
- package/dist/license/all +0 -951
- package/dist/license/all.tmp +0 -307
- package/dist/license/brotli +0 -12
- package/dist/license/expat +0 -71
- package/dist/license/fontconfig +0 -46
- package/dist/license/freetype +0 -92
- package/dist/license/fribidi +0 -15
- package/dist/license/harfbuzz +0 -32
- package/dist/license/jassub +0 -0
- package/dist/license/libass +0 -28
|
@@ -1,812 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
|
|
3
|
-
* Copyright (C) 2011 Grigori Goronzy <greg@chown.ath.cx>
|
|
4
|
-
*
|
|
5
|
-
* This file is part of libass.
|
|
6
|
-
*
|
|
7
|
-
* Permission to use, copy, modify, and distribute this software for any
|
|
8
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
9
|
-
* copyright notice and this permission notice appear in all copies.
|
|
10
|
-
*
|
|
11
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
#ifndef LIBASS_ASS_H
|
|
21
|
-
#define LIBASS_ASS_H
|
|
22
|
-
|
|
23
|
-
#include <stdio.h>
|
|
24
|
-
#include <stdarg.h>
|
|
25
|
-
#include "ass_types.h"
|
|
26
|
-
|
|
27
|
-
#define LIBASS_VERSION 0x01701000
|
|
28
|
-
|
|
29
|
-
#ifdef __cplusplus
|
|
30
|
-
extern "C" {
|
|
31
|
-
#endif
|
|
32
|
-
|
|
33
|
-
#if (defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || defined(__clang__)
|
|
34
|
-
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || defined(__clang__)
|
|
35
|
-
#define ASS_DEPRECATED(msg) __attribute__((deprecated(msg)))
|
|
36
|
-
#else
|
|
37
|
-
#define ASS_DEPRECATED(msg) __attribute__((deprecated))
|
|
38
|
-
#endif
|
|
39
|
-
#if __GNUC__ > 5 || defined(__clang__)
|
|
40
|
-
#define ASS_DEPRECATED_ENUM(msg) __attribute__((deprecated(msg)))
|
|
41
|
-
#else
|
|
42
|
-
#define ASS_DEPRECATED_ENUM(msg)
|
|
43
|
-
#endif
|
|
44
|
-
#elif defined(_MSC_VER)
|
|
45
|
-
#define ASS_DEPRECATED(msg) __declspec(deprecated(msg))
|
|
46
|
-
#define ASS_DEPRECATED_ENUM(msg)
|
|
47
|
-
#else
|
|
48
|
-
#define ASS_DEPRECATED(msg)
|
|
49
|
-
#define ASS_DEPRECATED_ENUM(msg)
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/*
|
|
54
|
-
* A linked list of images produced by an ass renderer.
|
|
55
|
-
*
|
|
56
|
-
* These images have to be rendered in-order for the correct screen
|
|
57
|
-
* composition. The libass renderer clips these bitmaps to the frame size.
|
|
58
|
-
* w/h can be zero, in this case the bitmap should not be rendered at all.
|
|
59
|
-
* The last bitmap row is not guaranteed to be padded up to stride size,
|
|
60
|
-
* e.g. in the worst case a bitmap has the size stride * (h - 1) + w.
|
|
61
|
-
*/
|
|
62
|
-
typedef struct ass_image {
|
|
63
|
-
int w, h; // Bitmap width/height
|
|
64
|
-
int stride; // Bitmap stride
|
|
65
|
-
unsigned char *bitmap; // 1bpp stride*h alpha buffer
|
|
66
|
-
// Note: the last row may not be padded to
|
|
67
|
-
// bitmap stride!
|
|
68
|
-
uint32_t color; // Bitmap color and alpha, RGBA
|
|
69
|
-
// For full VSFilter compatibility, the value
|
|
70
|
-
// must be transformed as described in
|
|
71
|
-
// ass_types.h for ASS_YCbCrMatrix
|
|
72
|
-
int dst_x, dst_y; // Bitmap placement inside the video frame
|
|
73
|
-
|
|
74
|
-
struct ass_image *next; // Next image, or NULL
|
|
75
|
-
|
|
76
|
-
enum {
|
|
77
|
-
IMAGE_TYPE_CHARACTER,
|
|
78
|
-
IMAGE_TYPE_OUTLINE,
|
|
79
|
-
IMAGE_TYPE_SHADOW
|
|
80
|
-
} type;
|
|
81
|
-
|
|
82
|
-
// New fields can be added here in new ABI-compatible library releases.
|
|
83
|
-
} ASS_Image;
|
|
84
|
-
|
|
85
|
-
/*
|
|
86
|
-
* Hinting type. (see ass_set_hinting below)
|
|
87
|
-
*
|
|
88
|
-
* Setting hinting to anything but ASS_HINTING_NONE will put libass in a mode
|
|
89
|
-
* that reduces compatibility with vsfilter and many ASS scripts. The main
|
|
90
|
-
* problem is that hinting conflicts with smooth scaling, which precludes
|
|
91
|
-
* animations and precise positioning.
|
|
92
|
-
*
|
|
93
|
-
* In other words, enabling hinting might break some scripts severely.
|
|
94
|
-
*
|
|
95
|
-
* FreeType's native hinter is still buggy sometimes and it is recommended
|
|
96
|
-
* to use the light autohinter, ASS_HINTING_LIGHT, instead. For best
|
|
97
|
-
* compatibility with problematic fonts, disable hinting.
|
|
98
|
-
*/
|
|
99
|
-
typedef enum {
|
|
100
|
-
ASS_HINTING_NONE = 0,
|
|
101
|
-
ASS_HINTING_LIGHT,
|
|
102
|
-
ASS_HINTING_NORMAL,
|
|
103
|
-
ASS_HINTING_NATIVE
|
|
104
|
-
} ASS_Hinting;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* \brief Text shaping levels.
|
|
108
|
-
*
|
|
109
|
-
* SIMPLE is a fast, font-agnostic shaper that can do only substitutions.
|
|
110
|
-
* COMPLEX is a slower shaper using OpenType for substitutions and positioning.
|
|
111
|
-
*
|
|
112
|
-
* libass uses the best shaper available by default.
|
|
113
|
-
*/
|
|
114
|
-
typedef enum {
|
|
115
|
-
ASS_SHAPING_SIMPLE = 0,
|
|
116
|
-
ASS_SHAPING_COMPLEX
|
|
117
|
-
} ASS_ShapingLevel;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* \brief Style override options. See
|
|
121
|
-
* ass_set_selective_style_override_enabled() for details.
|
|
122
|
-
*/
|
|
123
|
-
typedef enum {
|
|
124
|
-
/**
|
|
125
|
-
* Default mode (with no other bits set). All selective override features
|
|
126
|
-
* as well as the style set with ass_set_selective_style_override() are
|
|
127
|
-
* disabled, but traditional overrides like ass_set_font_scale() are
|
|
128
|
-
* applied unconditionally.
|
|
129
|
-
*/
|
|
130
|
-
ASS_OVERRIDE_DEFAULT = 0,
|
|
131
|
-
/**
|
|
132
|
-
* Apply the style as set with ass_set_selective_style_override() on events
|
|
133
|
-
* which look like dialogue. Other style overrides are also applied this
|
|
134
|
-
* way, except ass_set_font_scale(). How ass_set_font_scale() is applied
|
|
135
|
-
* depends on the ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE flag.
|
|
136
|
-
*
|
|
137
|
-
* This is equivalent to setting all of the following bits:
|
|
138
|
-
*
|
|
139
|
-
* ASS_OVERRIDE_BIT_FONT_NAME
|
|
140
|
-
* ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS
|
|
141
|
-
* ASS_OVERRIDE_BIT_COLORS
|
|
142
|
-
* ASS_OVERRIDE_BIT_BORDER
|
|
143
|
-
* ASS_OVERRIDE_BIT_ATTRIBUTES
|
|
144
|
-
*/
|
|
145
|
-
ASS_OVERRIDE_BIT_STYLE = 1 << 0,
|
|
146
|
-
/**
|
|
147
|
-
* Apply ass_set_font_scale() only on events which look like dialogue.
|
|
148
|
-
* If not set, the font scale is applied to all events. (The behavior and
|
|
149
|
-
* name of this flag are unintuitive, but exist for compatibility)
|
|
150
|
-
*/
|
|
151
|
-
ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE = 1 << 1,
|
|
152
|
-
/**
|
|
153
|
-
* Old alias for ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE. Deprecated. Do not use.
|
|
154
|
-
*/
|
|
155
|
-
ASS_OVERRIDE_BIT_FONT_SIZE ASS_DEPRECATED_ENUM("replaced by ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE") = 1 << 1,
|
|
156
|
-
/**
|
|
157
|
-
* On dialogue events override: FontSize, Spacing, Blur, ScaleX, ScaleY
|
|
158
|
-
*/
|
|
159
|
-
ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS = 1 << 2,
|
|
160
|
-
/**
|
|
161
|
-
* On dialogue events override: FontName, treat_fontname_as_pattern
|
|
162
|
-
*/
|
|
163
|
-
ASS_OVERRIDE_BIT_FONT_NAME = 1 << 3,
|
|
164
|
-
/**
|
|
165
|
-
* On dialogue events override: PrimaryColour, SecondaryColour, OutlineColour, BackColour
|
|
166
|
-
*/
|
|
167
|
-
ASS_OVERRIDE_BIT_COLORS = 1 << 4,
|
|
168
|
-
/**
|
|
169
|
-
* On dialogue events override: Bold, Italic, Underline, StrikeOut
|
|
170
|
-
*/
|
|
171
|
-
ASS_OVERRIDE_BIT_ATTRIBUTES = 1 << 5,
|
|
172
|
-
/**
|
|
173
|
-
* On dialogue events override: BorderStyle, Outline, Shadow
|
|
174
|
-
*/
|
|
175
|
-
ASS_OVERRIDE_BIT_BORDER = 1 << 6,
|
|
176
|
-
/**
|
|
177
|
-
* On dialogue events override: Alignment
|
|
178
|
-
*/
|
|
179
|
-
ASS_OVERRIDE_BIT_ALIGNMENT = 1 << 7,
|
|
180
|
-
/**
|
|
181
|
-
* On dialogue events override: MarginL, MarginR, MarginV
|
|
182
|
-
*/
|
|
183
|
-
ASS_OVERRIDE_BIT_MARGINS = 1 << 8,
|
|
184
|
-
/**
|
|
185
|
-
* Unconditionally replace all fields of all styles with the one provided
|
|
186
|
-
* with ass_set_selective_style_override().
|
|
187
|
-
* Does not apply ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE.
|
|
188
|
-
* Add ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS and ASS_OVERRIDE_BIT_BORDER if
|
|
189
|
-
* you want FontSize, Spacing, Outline, Shadow to be scaled to the script
|
|
190
|
-
* resolution given by the ASS_Track.
|
|
191
|
-
*/
|
|
192
|
-
ASS_OVERRIDE_FULL_STYLE = 1 << 9,
|
|
193
|
-
/**
|
|
194
|
-
* On dialogue events override: Justify
|
|
195
|
-
*/
|
|
196
|
-
ASS_OVERRIDE_BIT_JUSTIFY = 1 << 10,
|
|
197
|
-
// New enum values can be added here in new ABI-compatible library releases.
|
|
198
|
-
} ASS_OverrideBits;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* \brief Return the version of library. This returns the value LIBASS_VERSION
|
|
202
|
-
* was set to when the library was compiled.
|
|
203
|
-
* \return library version
|
|
204
|
-
*/
|
|
205
|
-
int ass_library_version(void);
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* \brief Default Font provider to load fonts in libass' database
|
|
209
|
-
*
|
|
210
|
-
* NONE don't use any default font provider for font lookup
|
|
211
|
-
* AUTODETECT use the first available font provider
|
|
212
|
-
* CORETEXT force a CoreText based font provider (OS X only)
|
|
213
|
-
* DIRECTWRITE force a DirectWrite based font provider (Microsoft Win32 only)
|
|
214
|
-
* FONTCONFIG force a Fontconfig based font provider
|
|
215
|
-
*
|
|
216
|
-
* libass uses the best shaper available by default.
|
|
217
|
-
*/
|
|
218
|
-
typedef enum {
|
|
219
|
-
ASS_FONTPROVIDER_NONE = 0,
|
|
220
|
-
ASS_FONTPROVIDER_AUTODETECT = 1,
|
|
221
|
-
ASS_FONTPROVIDER_CORETEXT,
|
|
222
|
-
ASS_FONTPROVIDER_FONTCONFIG,
|
|
223
|
-
ASS_FONTPROVIDER_DIRECTWRITE,
|
|
224
|
-
} ASS_DefaultFontProvider;
|
|
225
|
-
|
|
226
|
-
typedef enum {
|
|
227
|
-
/**
|
|
228
|
-
* Enable libass extensions that would display ASS subtitles incorrectly.
|
|
229
|
-
* These may be useful for applications, which use libass as renderer for
|
|
230
|
-
* subtitles converted from another format, or which use libass for other
|
|
231
|
-
* purposes that do not involve actual ASS subtitles authored for
|
|
232
|
-
* distribution.
|
|
233
|
-
*/
|
|
234
|
-
ASS_FEATURE_INCOMPATIBLE_EXTENSIONS,
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Match bracket pairs in bidirectional text according to the revised
|
|
238
|
-
* Unicode Bidirectional Algorithm introduced in Unicode 6.3.
|
|
239
|
-
* This is incompatible with VSFilter and disabled by default.
|
|
240
|
-
*
|
|
241
|
-
* (Directional isolates, also introduced in Unicode 6.3,
|
|
242
|
-
* are unconditionally processed when FriBidi is new enough.)
|
|
243
|
-
*
|
|
244
|
-
* This feature may be unavailable at runtime (ass_track_set_feature
|
|
245
|
-
* may return -1) if libass was compiled against old FriBidi.
|
|
246
|
-
*/
|
|
247
|
-
ASS_FEATURE_BIDI_BRACKETS,
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* When this feature is disabled, text is split into VSFilter-compatible
|
|
251
|
-
* segments and text in each segment is processed in isolation.
|
|
252
|
-
* Notably, this includes running the Unicode Bidirectional
|
|
253
|
-
* Algorithm and shaping the text within each run separately.
|
|
254
|
-
* The individual runs are then laid out left-to-right,
|
|
255
|
-
* even if they contain right-to-left text.
|
|
256
|
-
*
|
|
257
|
-
* When this feature is enabled, each event's text is processed as a whole
|
|
258
|
-
* (as far as possible). In particular, the Unicode Bidirectional
|
|
259
|
-
* Algorithm is run on the whole text, and text is shaped across
|
|
260
|
-
* override tags.
|
|
261
|
-
*
|
|
262
|
-
* This is incompatible with VSFilter and disabled by default.
|
|
263
|
-
*
|
|
264
|
-
* libass extensions to ASS such as Encoding -1 can cause individual
|
|
265
|
-
* events to be always processed as if this feature is enabled.
|
|
266
|
-
*/
|
|
267
|
-
ASS_FEATURE_WHOLE_TEXT_LAYOUT,
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Break lines according to the Unicode Line Breaking Algorithm.
|
|
271
|
-
* If the track language is set, some additional language-specific tweaks
|
|
272
|
-
* may be applied. Setting this enables more breaking opportunities
|
|
273
|
-
* compared to classic ASS. However, it is still possible for long words
|
|
274
|
-
* without breaking opportunities to cause overfull lines.
|
|
275
|
-
* This is incompatible with VSFilter and disabled by default.
|
|
276
|
-
*
|
|
277
|
-
* This feature may be unavailable at runtime if
|
|
278
|
-
* libass was compiled without libunibreak support.
|
|
279
|
-
*/
|
|
280
|
-
ASS_FEATURE_WRAP_UNICODE,
|
|
281
|
-
|
|
282
|
-
// New enum values can be added here in new ABI-compatible library releases.
|
|
283
|
-
} ASS_Feature;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* \brief Initialize the library.
|
|
287
|
-
* \return library handle or NULL if failed
|
|
288
|
-
*/
|
|
289
|
-
ASS_Library *ass_library_init(void);
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* \brief Finalize the library
|
|
293
|
-
* \param priv library handle
|
|
294
|
-
*/
|
|
295
|
-
void ass_library_done(ASS_Library *priv);
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* \brief Set additional fonts directory.
|
|
299
|
-
* Optional directory that will be scanned for fonts. The fonts
|
|
300
|
-
* found are used for font lookup.
|
|
301
|
-
* NOTE: A valid font directory is not needed to support embedded fonts.
|
|
302
|
-
* On Microsoft Windows, when using WIN32-APIs, fonts_dir must be in either
|
|
303
|
-
* UTF-8 mixed with lone or paired UTF-16 surrogates encoded like in CESU-8
|
|
304
|
-
* or the encoding accepted by fopen with the former taking precedence
|
|
305
|
-
* if both versions are valid and exist.
|
|
306
|
-
* On all other systems there is no need for special considerations like that.
|
|
307
|
-
*
|
|
308
|
-
* \param priv library handle
|
|
309
|
-
* \param fonts_dir directory with additional fonts
|
|
310
|
-
*/
|
|
311
|
-
void ass_set_fonts_dir(ASS_Library *priv, const char *fonts_dir);
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* \brief Whether fonts should be extracted from track data.
|
|
315
|
-
* \param priv library handle
|
|
316
|
-
* \param extract whether to extract fonts
|
|
317
|
-
*/
|
|
318
|
-
void ass_set_extract_fonts(ASS_Library *priv, int extract);
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* \brief Register style overrides with a library instance.
|
|
322
|
-
* The overrides should have the form [Style.]Param=Value, e.g.
|
|
323
|
-
* SomeStyle.Font=Arial
|
|
324
|
-
* ScaledBorderAndShadow=yes
|
|
325
|
-
*
|
|
326
|
-
* \param priv library handle
|
|
327
|
-
* \param list NULL-terminated list of strings
|
|
328
|
-
*/
|
|
329
|
-
void ass_set_style_overrides(ASS_Library *priv, char **list);
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* \brief Explicitly process style overrides for a track.
|
|
333
|
-
* \param track track handle
|
|
334
|
-
*/
|
|
335
|
-
void ass_process_force_style(ASS_Track *track);
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* \brief Register a callback for debug/info messages.
|
|
339
|
-
* If a callback is registered, it is called for every message emitted by
|
|
340
|
-
* libass. The callback receives a format string and a list of arguments,
|
|
341
|
-
* to be used for the printf family of functions. Additionally, a log level
|
|
342
|
-
* from 0 (FATAL errors) to 7 (verbose DEBUG) is passed. Usually, level 5
|
|
343
|
-
* should be used by applications.
|
|
344
|
-
* If no callback is set, all messages level < 5 are printed to stderr,
|
|
345
|
-
* prefixed with [ass].
|
|
346
|
-
*
|
|
347
|
-
* \param priv library handle
|
|
348
|
-
* \param msg_cb pointer to callback function
|
|
349
|
-
* \param data additional data, will be passed to callback
|
|
350
|
-
*/
|
|
351
|
-
void ass_set_message_cb(ASS_Library *priv, void (*msg_cb)
|
|
352
|
-
(int level, const char *fmt, va_list args, void *data),
|
|
353
|
-
void *data);
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* \brief Initialize the renderer.
|
|
357
|
-
* \param priv library handle
|
|
358
|
-
* \return renderer handle or NULL if failed
|
|
359
|
-
*
|
|
360
|
-
* NOTE: before rendering starts the renderer should also be
|
|
361
|
-
* configured with at least ass_set_storage_size(),
|
|
362
|
-
* ass_set_frame_size() and ass_set_fonts();
|
|
363
|
-
* see respective docs.
|
|
364
|
-
*/
|
|
365
|
-
ASS_Renderer *ass_renderer_init(ASS_Library *);
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* \brief Finalize the renderer.
|
|
369
|
-
* \param priv renderer handle
|
|
370
|
-
*/
|
|
371
|
-
void ass_renderer_done(ASS_Renderer *priv);
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* \brief Set the frame size in pixels, including margins.
|
|
375
|
-
* The renderer will never return images that are outside of the frame area.
|
|
376
|
-
* The value set with this function can influence the pixel aspect ratio used
|
|
377
|
-
* for rendering.
|
|
378
|
-
* If after compensating for configured margins the frame size
|
|
379
|
-
* is not an isotropically scaled version of the video display size,
|
|
380
|
-
* you may have to use ass_set_pixel_aspect().
|
|
381
|
-
* @see ass_set_pixel_aspect()
|
|
382
|
-
* @see ass_set_margins()
|
|
383
|
-
* \param priv renderer handle
|
|
384
|
-
* \param w width
|
|
385
|
-
* \param h height
|
|
386
|
-
*
|
|
387
|
-
* NOTE: frame size must be configured before an ASS_Renderer can be used.
|
|
388
|
-
*/
|
|
389
|
-
void ass_set_frame_size(ASS_Renderer *priv, int w, int h);
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* \brief Set the source image size in pixels.
|
|
393
|
-
* This affects some ASS tags like e.g. 3D transforms and
|
|
394
|
-
* is used to calculate the source aspect ratio and blur scale.
|
|
395
|
-
* If subtitles specify valid LayoutRes* headers, those will take precedence.
|
|
396
|
-
* The source image size can be reset to default by setting w and h to 0.
|
|
397
|
-
* The value set with this function can influence the pixel aspect ratio used
|
|
398
|
-
* for rendering.
|
|
399
|
-
* The values must be the actual storage size of the video stream,
|
|
400
|
-
* without any anamorphic de-squeeze applied.
|
|
401
|
-
* @see ass_set_pixel_aspect()
|
|
402
|
-
* \param priv renderer handle
|
|
403
|
-
* \param w width
|
|
404
|
-
* \param h height
|
|
405
|
-
*
|
|
406
|
-
* NOTE: storage size must be configured to get correct results,
|
|
407
|
-
* otherwise libass is forced to make a fallible guess.
|
|
408
|
-
*/
|
|
409
|
-
void ass_set_storage_size(ASS_Renderer *priv, int w, int h);
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* \brief Set shaping level. This is merely a hint, the renderer will use
|
|
413
|
-
* whatever is available if the request cannot be fulfilled.
|
|
414
|
-
* \param level shaping level
|
|
415
|
-
*/
|
|
416
|
-
void ass_set_shaper(ASS_Renderer *priv, ASS_ShapingLevel level);
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* \brief Set frame margins. These values may be negative if pan-and-scan
|
|
420
|
-
* is used. The margins are in pixels. Each value specifies the distance from
|
|
421
|
-
* the video rectangle to the renderer frame. If a given margin value is
|
|
422
|
-
* positive, there will be free space between renderer frame and video area.
|
|
423
|
-
* If a given margin value is negative, the frame is inside the video, i.e.
|
|
424
|
-
* the video has been cropped.
|
|
425
|
-
*
|
|
426
|
-
* The renderer will try to keep subtitles inside the frame area. If possible,
|
|
427
|
-
* text is layout so that it is inside the cropped area. Subtitle events
|
|
428
|
-
* that can't be moved are cropped against the frame area.
|
|
429
|
-
*
|
|
430
|
-
* ass_set_use_margins() can be used to allow libass to render subtitles into
|
|
431
|
-
* the empty areas if margins are positive, i.e. the video area is smaller than
|
|
432
|
-
* the frame. (Traditionally, this has been used to show subtitles in
|
|
433
|
-
* the bottom "black bar" between video bottom screen border when playing 16:9
|
|
434
|
-
* video on a 4:3 screen.)
|
|
435
|
-
*
|
|
436
|
-
* \param priv renderer handle
|
|
437
|
-
* \param t top margin
|
|
438
|
-
* \param b bottom margin
|
|
439
|
-
* \param l left margin
|
|
440
|
-
* \param r right margin
|
|
441
|
-
*/
|
|
442
|
-
void ass_set_margins(ASS_Renderer *priv, int t, int b, int l, int r);
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* \brief Whether margins should be used for placing regular events.
|
|
446
|
-
* \param priv renderer handle
|
|
447
|
-
* \param use whether to use the margins
|
|
448
|
-
*/
|
|
449
|
-
void ass_set_use_margins(ASS_Renderer *priv, int use);
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* \brief Set pixel aspect ratio correction.
|
|
453
|
-
* This is the ratio of pixel width to pixel height.
|
|
454
|
-
*
|
|
455
|
-
* Generally, this is (d_w / d_h) / (s_w / s_h), where s_w and s_h is the
|
|
456
|
-
* video storage size, and d_w and d_h is the video display size. (Display
|
|
457
|
-
* and storage size can be different for anamorphic video, such as DVDs.)
|
|
458
|
-
*
|
|
459
|
-
* If the pixel aspect ratio is 0, or if the aspect ratio has never been set
|
|
460
|
-
* by calling this function, libass will calculate a default pixel aspect ratio
|
|
461
|
-
* out of values set with ass_set_frame_size() and ass_set_storage_size(). Note
|
|
462
|
-
* that this default assumes the frame size after compensating for margins
|
|
463
|
-
* corresponds to an isotropically scaled version of the video display size.
|
|
464
|
-
* If the storage size has not been set, a pixel aspect ratio of 1 is assumed.
|
|
465
|
-
*
|
|
466
|
-
* If subtitles specify valid LayoutRes* headers, the API-configured
|
|
467
|
-
* pixel aspect value is discarded in favour of one calculated out of the
|
|
468
|
-
* headers and values set with ass_set_frame_size().
|
|
469
|
-
*
|
|
470
|
-
* \param priv renderer handle
|
|
471
|
-
* \param par pixel aspect ratio (1.0 means square pixels, 0 means default)
|
|
472
|
-
*/
|
|
473
|
-
void ass_set_pixel_aspect(ASS_Renderer *priv, double par);
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* \brief Set aspect ratio parameters.
|
|
477
|
-
* This calls ass_set_pixel_aspect(priv, dar / sar).
|
|
478
|
-
* @deprecated New code should use ass_set_pixel_aspect().
|
|
479
|
-
* \param priv renderer handle
|
|
480
|
-
* \param dar display aspect ratio (DAR), prescaled for output PAR
|
|
481
|
-
* \param sar storage aspect ratio (SAR)
|
|
482
|
-
*/
|
|
483
|
-
ASS_DEPRECATED("use 'ass_set_pixel_aspect' instead")
|
|
484
|
-
void ass_set_aspect_ratio(ASS_Renderer *priv, double dar, double sar);
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* \brief Set a fixed font scaling factor.
|
|
488
|
-
* \param priv renderer handle
|
|
489
|
-
* \param font_scale scaling factor, default is 1.0
|
|
490
|
-
*/
|
|
491
|
-
void ass_set_font_scale(ASS_Renderer *priv, double font_scale);
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* \brief Set font hinting method.
|
|
495
|
-
* \param priv renderer handle
|
|
496
|
-
* \param ht hinting method
|
|
497
|
-
*/
|
|
498
|
-
void ass_set_hinting(ASS_Renderer *priv, ASS_Hinting ht);
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* \brief Set line spacing. Will not be scaled with frame size.
|
|
502
|
-
* \param priv renderer handle
|
|
503
|
-
* \param line_spacing line spacing in pixels
|
|
504
|
-
*/
|
|
505
|
-
void ass_set_line_spacing(ASS_Renderer *priv, double line_spacing);
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* \brief Set vertical line position.
|
|
509
|
-
* \param priv renderer handle
|
|
510
|
-
* \param line_position vertical line position of subtitles in percent
|
|
511
|
-
* (0-100: 0 = on the bottom (default), 100 = on top)
|
|
512
|
-
*/
|
|
513
|
-
void ass_set_line_position(ASS_Renderer *priv, double line_position);
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* \brief Get the list of available font providers. The output array
|
|
517
|
-
* is allocated with malloc and can be released with free(). If an
|
|
518
|
-
* allocation error occurs, size is set to (size_t)-1.
|
|
519
|
-
* \param priv library handle
|
|
520
|
-
* \param providers output, list of default providers (malloc'ed array)
|
|
521
|
-
* \param size output, number of providers
|
|
522
|
-
* \return list of available font providers (user owns the returned array)
|
|
523
|
-
*/
|
|
524
|
-
void ass_get_available_font_providers(ASS_Library *priv,
|
|
525
|
-
ASS_DefaultFontProvider **providers,
|
|
526
|
-
size_t *size);
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* \brief Set font lookup defaults.
|
|
530
|
-
* \param default_font path to default font to use. Must be supplied if
|
|
531
|
-
* all system fontproviders are disabled or unavailable.
|
|
532
|
-
* \param default_family fallback font family, or NULL
|
|
533
|
-
* \param dfp which font provider to use (one of ASS_DefaultFontProvider). In
|
|
534
|
-
* older libass version, this could be 0 or 1, where 1 enabled fontconfig.
|
|
535
|
-
* Newer relases also accept 0 (ASS_FONTPROVIDER_NONE) and 1
|
|
536
|
-
* (ASS_FONTPROVIDER_AUTODETECT), which is almost backward-compatible.
|
|
537
|
-
* If the requested fontprovider does not exist or fails to initialize, the
|
|
538
|
-
* behavior is the same as when ASS_FONTPROVIDER_NONE was passed.
|
|
539
|
-
* \param config path to fontconfig configuration file, or NULL. Only relevant
|
|
540
|
-
* if fontconfig is used. The encoding must match the one accepted by fontconfig.
|
|
541
|
-
* \param update whether fontconfig cache should be built/updated now. Only
|
|
542
|
-
* relevant if fontconfig is used.
|
|
543
|
-
*
|
|
544
|
-
* NOTE: font lookup must be configured before an ASS_Renderer can be used.
|
|
545
|
-
*/
|
|
546
|
-
void ass_set_fonts(ASS_Renderer *priv, const char *default_font,
|
|
547
|
-
const char *default_family, int dfp,
|
|
548
|
-
const char *config, int update);
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* \brief Set selective style override mode.
|
|
552
|
-
* If enabled, the renderer attempts to override the ASS script's styling of
|
|
553
|
-
* normal subtitles, without affecting explicitly positioned text. If an event
|
|
554
|
-
* looks like a normal subtitle, parts of the font style are copied from the
|
|
555
|
-
* user style set with ass_set_selective_style_override().
|
|
556
|
-
* Warning: the heuristic used for deciding when to override the style is rather
|
|
557
|
-
* rough, and enabling this option can lead to incorrectly rendered
|
|
558
|
-
* subtitles. Since the ASS format doesn't have any support for
|
|
559
|
-
* allowing end-users to customize subtitle styling, this feature can
|
|
560
|
-
* only be implemented on "best effort" basis, and has to rely on
|
|
561
|
-
* heuristics that can easily break.
|
|
562
|
-
* \param priv renderer handle
|
|
563
|
-
* \param bits bit mask comprised of ASS_OverrideBits values.
|
|
564
|
-
*/
|
|
565
|
-
void ass_set_selective_style_override_enabled(ASS_Renderer *priv, int bits);
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* \brief Set style for selective style override.
|
|
569
|
-
* See ass_set_selective_style_override_enabled().
|
|
570
|
-
* \param style style settings to use if override is enabled. Applications
|
|
571
|
-
* should initialize it with {0} before setting fields. Strings will be copied
|
|
572
|
-
* by the function.
|
|
573
|
-
*/
|
|
574
|
-
void ass_set_selective_style_override(ASS_Renderer *priv, ASS_Style *style);
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* \brief This is a stub and does nothing. Old documentation: Update/build font
|
|
578
|
-
* cache. This needs to be called if it was disabled when ass_set_fonts was set.
|
|
579
|
-
*
|
|
580
|
-
* \param priv renderer handle
|
|
581
|
-
* \return success
|
|
582
|
-
*/
|
|
583
|
-
ASS_DEPRECATED("it does nothing")
|
|
584
|
-
int ass_fonts_update(ASS_Renderer *priv);
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* \brief Set hard cache limits. Do not set, or set to zero, for reasonable
|
|
588
|
-
* defaults.
|
|
589
|
-
*
|
|
590
|
-
* \param priv renderer handle
|
|
591
|
-
* \param glyph_max maximum number of cached glyphs
|
|
592
|
-
* \param bitmap_max_size maximum bitmap cache size (in MB)
|
|
593
|
-
*/
|
|
594
|
-
void ass_set_cache_limits(ASS_Renderer *priv, int glyph_max,
|
|
595
|
-
int bitmap_max_size);
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* \brief Render a frame, producing a list of ASS_Image.
|
|
599
|
-
* \param priv renderer handle
|
|
600
|
-
* \param track subtitle track
|
|
601
|
-
* \param now video timestamp in milliseconds
|
|
602
|
-
* \param detect_change compare to the previous call and set to 1
|
|
603
|
-
* if positions may have changed, or set to 2 if content may have changed.
|
|
604
|
-
*/
|
|
605
|
-
ASS_Image *ass_render_frame(ASS_Renderer *priv, ASS_Track *track,
|
|
606
|
-
long long now, int *detect_change);
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
/*
|
|
610
|
-
* The following functions operate on track objects and do not need
|
|
611
|
-
* an ass_renderer
|
|
612
|
-
*/
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* \brief Allocate a new empty track object.
|
|
616
|
-
* \param library handle
|
|
617
|
-
* \return pointer to empty track or NULL on failure
|
|
618
|
-
*/
|
|
619
|
-
ASS_Track *ass_new_track(ASS_Library *);
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* \brief Enable or disable certain features
|
|
623
|
-
* This manages flags that control the behavior of the renderer and how certain
|
|
624
|
-
* tags etc. within the track are interpreted. The defaults on a newly created
|
|
625
|
-
* ASS_Track are such that rendering is compatible with traditional renderers
|
|
626
|
-
* like VSFilter, and/or old versions of libass. Calling ass_process_data() or
|
|
627
|
-
* ass_process_codec_private() may change some of these flags according to file
|
|
628
|
-
* headers. (ass_process_chunk() will not change any of the flags.)
|
|
629
|
-
* Additions to ASS_Feature are backward compatible to old libass releases (ABI
|
|
630
|
-
* compatibility).
|
|
631
|
-
* After calling ass_render_frame, changing features is no longer allowed.
|
|
632
|
-
* \param track track
|
|
633
|
-
* \param feature the specific feature to enable or disable
|
|
634
|
-
* \param enable 0 for disable, any non-0 value for enable
|
|
635
|
-
* \return 0 if feature set, -1 if feature is unknown
|
|
636
|
-
*/
|
|
637
|
-
int ass_track_set_feature(ASS_Track *track, ASS_Feature feature, int enable);
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* \brief Deallocate track and all its child objects (styles and events).
|
|
641
|
-
* \param track track to deallocate or NULL
|
|
642
|
-
*/
|
|
643
|
-
void ass_free_track(ASS_Track *track);
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* \brief Allocate new style.
|
|
647
|
-
* \param track track
|
|
648
|
-
* \return newly allocated style id >= 0, or a value < 0 on failure
|
|
649
|
-
* See GENERAL NOTE in ass_types.h.
|
|
650
|
-
*/
|
|
651
|
-
int ass_alloc_style(ASS_Track *track);
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* \brief Allocate new event.
|
|
655
|
-
* \param track track
|
|
656
|
-
* \return newly allocated event id >= 0, or a value < 0 on failure
|
|
657
|
-
* See GENERAL NOTE in ass_types.h.
|
|
658
|
-
*/
|
|
659
|
-
int ass_alloc_event(ASS_Track *track);
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* \brief Delete a style.
|
|
663
|
-
* \param track track
|
|
664
|
-
* \param sid style id
|
|
665
|
-
* Deallocates style data. Does not modify track->n_styles.
|
|
666
|
-
* Freeing a style without subsequently setting track->n_styles
|
|
667
|
-
* to a value less than or equal to the freed style id before calling
|
|
668
|
-
* any other libass API function on the track is undefined behaviour.
|
|
669
|
-
* Additionally a freed style style still being referenced by an event
|
|
670
|
-
* in track->events will also result in undefined behaviour.
|
|
671
|
-
* See GENERAL NOTE in ass_types.h.
|
|
672
|
-
*/
|
|
673
|
-
void ass_free_style(ASS_Track *track, int sid);
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* \brief Delete an event.
|
|
677
|
-
* \param track track
|
|
678
|
-
* \param eid event id
|
|
679
|
-
* Deallocates event data. Does not modify track->n_events.
|
|
680
|
-
* Freeing an event without subsequently setting track->n_events
|
|
681
|
-
* to a value less than or equal to the freed event id before calling
|
|
682
|
-
* any other libass API function on the track is undefined behaviour.
|
|
683
|
-
* See GENERAL NOTE in ass_types.h
|
|
684
|
-
*/
|
|
685
|
-
void ass_free_event(ASS_Track *track, int eid);
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* \brief Parse a chunk of subtitle stream data.
|
|
689
|
-
* \param track track
|
|
690
|
-
* \param data string to parse
|
|
691
|
-
* \param size length of data
|
|
692
|
-
*/
|
|
693
|
-
void ass_process_data(ASS_Track *track, char *data, int size);
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* \brief Parse Codec Private section of the subtitle stream, in Matroska
|
|
697
|
-
* format. See the Matroska specification for details.
|
|
698
|
-
* \param track target track
|
|
699
|
-
* \param data string to parse
|
|
700
|
-
* \param size length of data
|
|
701
|
-
*/
|
|
702
|
-
void ass_process_codec_private(ASS_Track *track, char *data, int size);
|
|
703
|
-
|
|
704
|
-
/**
|
|
705
|
-
* \brief Parse a chunk of subtitle stream data. A chunk contains exactly one
|
|
706
|
-
* event in Matroska format. See the Matroska specification for details.
|
|
707
|
-
* In later libass versions (since LIBASS_VERSION==0x01300001), using this
|
|
708
|
-
* function means you agree not to modify events manually, or using other
|
|
709
|
-
* functions manipulating the event list like ass_process_data(). If you do
|
|
710
|
-
* anyway, the internal duplicate checking might break. Calling
|
|
711
|
-
* ass_flush_events() is still allowed.
|
|
712
|
-
* \param track track
|
|
713
|
-
* \param data string to parse
|
|
714
|
-
* \param size length of data
|
|
715
|
-
* \param timecode starting time of the event (milliseconds)
|
|
716
|
-
* \param duration duration of the event (milliseconds)
|
|
717
|
-
*/
|
|
718
|
-
void ass_process_chunk(ASS_Track *track, char *data, int size,
|
|
719
|
-
long long timecode, long long duration);
|
|
720
|
-
|
|
721
|
-
/**
|
|
722
|
-
* \brief Set whether the ReadOrder field when processing a packet with
|
|
723
|
-
* ass_process_chunk() should be used for eliminating duplicates.
|
|
724
|
-
* \param check_readorder 0 means do not try to eliminate duplicates; 1 means
|
|
725
|
-
* use the ReadOrder field embedded in the packet as unique identifier, and
|
|
726
|
-
* discard the packet if there was already a packet with the same ReadOrder.
|
|
727
|
-
* Other values are undefined.
|
|
728
|
-
* If this function is not called, the default value is 1.
|
|
729
|
-
*/
|
|
730
|
-
void ass_set_check_readorder(ASS_Track *track, int check_readorder);
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* \brief Flush buffered events.
|
|
734
|
-
* \param track track
|
|
735
|
-
*/
|
|
736
|
-
void ass_flush_events(ASS_Track *track);
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* \brief Read subtitles from file.
|
|
740
|
-
* \param library library handle
|
|
741
|
-
* \param fname file name
|
|
742
|
-
* \param codepage encoding (iconv format)
|
|
743
|
-
* \return newly allocated track or NULL on failure
|
|
744
|
-
* NOTE: On Microsoft Windows, when using WIN32-APIs, fname must be in either
|
|
745
|
-
* UTF-8 mixed with lone or paired UTF-16 surrogates encoded like in CESU-8
|
|
746
|
-
* or the encoding accepted by fopen with the former taking precedence
|
|
747
|
-
* if both versions are valid and exist.
|
|
748
|
-
* On all other systems there is no need for special considerations like that.
|
|
749
|
-
*/
|
|
750
|
-
ASS_Track *ass_read_file(ASS_Library *library, char *fname,
|
|
751
|
-
char *codepage);
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* \brief Read subtitles from memory.
|
|
755
|
-
* \param library library handle
|
|
756
|
-
* \param buf pointer to subtitles text
|
|
757
|
-
* \param bufsize size of buffer
|
|
758
|
-
* \param codepage encoding (iconv format)
|
|
759
|
-
* \return newly allocated track or NULL on failure
|
|
760
|
-
*/
|
|
761
|
-
ASS_Track *ass_read_memory(ASS_Library *library, char *buf,
|
|
762
|
-
size_t bufsize, char *codepage);
|
|
763
|
-
/**
|
|
764
|
-
* \brief Read styles from file into already initialized track.
|
|
765
|
-
* \param fname file name
|
|
766
|
-
* \param codepage encoding (iconv format)
|
|
767
|
-
* \return 0 on success
|
|
768
|
-
* NOTE: On Microsoft Windows, when using WIN32-APIs, fname must be in either
|
|
769
|
-
* UTF-8 mixed with lone or paired UTF-16 surrogates encoded like in CESU-8
|
|
770
|
-
* or the encoding accepted by fopen with the former taking precedence
|
|
771
|
-
* if both versions are valid and exist.
|
|
772
|
-
* On all other systems there is no need for special considerations like that.
|
|
773
|
-
*/
|
|
774
|
-
int ass_read_styles(ASS_Track *track, char *fname, char *codepage);
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* \brief Add a memory font.
|
|
778
|
-
* \param library library handle
|
|
779
|
-
* \param name attachment name
|
|
780
|
-
* \param data binary font data
|
|
781
|
-
* \param data_size data size
|
|
782
|
-
*/
|
|
783
|
-
void ass_add_font(ASS_Library *library, const char *name, const char *data,
|
|
784
|
-
int data_size);
|
|
785
|
-
|
|
786
|
-
/**
|
|
787
|
-
* \brief Remove all fonts stored in an ass_library object.
|
|
788
|
-
* This can only be called safely if all ASS_Track and ASS_Renderer instances
|
|
789
|
-
* associated with the library handle have been released first.
|
|
790
|
-
* \param library library handle
|
|
791
|
-
*/
|
|
792
|
-
void ass_clear_fonts(ASS_Library *library);
|
|
793
|
-
|
|
794
|
-
/**
|
|
795
|
-
* \brief Calculates timeshift from now to the start of some other subtitle
|
|
796
|
-
* event, depending on movement parameter.
|
|
797
|
-
* \param track subtitle track
|
|
798
|
-
* \param now current time in milliseconds
|
|
799
|
-
* \param movement how many events to skip from the one currently displayed
|
|
800
|
-
* +2 means "the one after the next", -1 means "previous"
|
|
801
|
-
* \return timeshift in milliseconds
|
|
802
|
-
*/
|
|
803
|
-
long long ass_step_sub(ASS_Track *track, long long now, int movement);
|
|
804
|
-
|
|
805
|
-
#undef ASS_DEPRECATED
|
|
806
|
-
#undef ASS_DEPRECATED_ENUM
|
|
807
|
-
|
|
808
|
-
#ifdef __cplusplus
|
|
809
|
-
}
|
|
810
|
-
#endif
|
|
811
|
-
|
|
812
|
-
#endif /* LIBASS_ASS_H */
|