2 * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
4 * This file is part of libass.
6 * libass is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * libass is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with libass; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef LIBASS_TYPES_H
22 #define LIBASS_TYPES_H
27 #define VALIGN_CENTER 8
30 #define HALIGN_CENTER 2
31 #define HALIGN_RIGHT 3
33 /* Opaque objects internally used by libass. Contents are private. */
34 typedef struct ass_renderer ASS_Renderer
;
35 typedef struct render_priv ASS_RenderPriv
;
36 typedef struct parser_priv ASS_ParserPriv
;
37 typedef struct ass_library ASS_Library
;
40 typedef struct ass_style
{
44 uint32_t PrimaryColour
;
45 uint32_t SecondaryColour
;
46 uint32_t OutlineColour
;
64 int treat_fontname_as_pattern
;
68 * ASS_Event corresponds to a single Dialogue line;
69 * text is stored as-is, style overrides will be parsed later.
71 typedef struct ass_event
{
72 long long Start
; // ms
73 long long Duration
; // ms
85 ASS_RenderPriv
*render_priv
;
89 * ass track represent either an external script or a matroska subtitle stream
90 * (no real difference between them); it can be used in rendering after the
91 * headers are parsed (i.e. events format line read).
93 typedef struct ass_track
{
94 int n_styles
; // amount used
95 int max_styles
; // amount allocated
98 ASS_Style
*styles
; // array of styles, max_styles length, n_styles used
99 ASS_Event
*events
; // the same as styles
101 char *style_format
; // style format line (everything after "Format: ")
102 char *event_format
; // event format line
105 TRACK_TYPE_UNKNOWN
= 0,
110 // Script header fields
115 int ScaledBorderAndShadow
;
118 int default_style
; // index of default style
119 char *name
; // file name in case of external subs, 0 for streams
121 ASS_Library
*library
;
122 ASS_ParserPriv
*parser_priv
;
125 #endif /* LIBASS_TYPES_H */