Update vdpau:deint documentation.
[mplayer/glamo.git] / libass / ass_types.h
blob870fab4caa76db27b22b8094d3d3b5d0167f7eea
1 // -*- c-basic-offset: 8; indent-tabs-mode: t -*-
2 // vim:ts=8:sw=8:noet:ai:
3 /*
4 * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
6 * This file is part of libass.
8 * libass is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * libass is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with libass; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef LIBASS_TYPES_H
24 #define LIBASS_TYPES_H
26 #include <stdint.h>
28 #define VALIGN_SUB 0
29 #define VALIGN_CENTER 8
30 #define VALIGN_TOP 4
31 #define HALIGN_LEFT 1
32 #define HALIGN_CENTER 2
33 #define HALIGN_RIGHT 3
35 /// ass Style: line
36 typedef struct ass_style_s {
37 char* Name;
38 char* FontName;
39 double FontSize;
40 uint32_t PrimaryColour;
41 uint32_t SecondaryColour;
42 uint32_t OutlineColour;
43 uint32_t BackColour;
44 int Bold;
45 int Italic;
46 int Underline;
47 int StrikeOut;
48 double ScaleX;
49 double ScaleY;
50 double Spacing;
51 int Angle;
52 int BorderStyle;
53 double Outline;
54 double Shadow;
55 int Alignment;
56 int MarginL;
57 int MarginR;
58 int MarginV;
59 // int AlphaLevel;
60 int Encoding;
61 } ass_style_t;
63 typedef struct render_priv_s render_priv_t;
65 /// ass_event_t corresponds to a single Dialogue line
66 /// Text is stored as-is, style overrides will be parsed later
67 typedef struct ass_event_s {
68 long long Start; // ms
69 long long Duration; // ms
71 int ReadOrder;
72 int Layer;
73 int Style;
74 char* Name;
75 int MarginL;
76 int MarginR;
77 int MarginV;
78 char* Effect;
79 char* Text;
81 render_priv_t* render_priv;
82 } ass_event_t;
84 typedef struct parser_priv_s parser_priv_t;
86 typedef struct ass_library_s ass_library_t;
88 /// ass track represent either an external script or a matroska subtitle stream (no real difference between them)
89 /// it can be used in rendering after the headers are parsed (i.e. events format line read)
90 typedef struct ass_track_s {
91 int n_styles; // amount used
92 int max_styles; // amount allocated
93 int n_events;
94 int max_events;
95 ass_style_t* styles; // array of styles, max_styles length, n_styles used
96 ass_event_t* events; // the same as styles
98 char* style_format; // style format line (everything after "Format: ")
99 char* event_format; // event format line
101 enum {TRACK_TYPE_UNKNOWN = 0, TRACK_TYPE_ASS, TRACK_TYPE_SSA} track_type;
103 // script header fields
104 int PlayResX;
105 int PlayResY;
106 double Timer;
107 int WrapStyle;
110 int default_style; // index of default style
111 char* name; // file name in case of external subs, 0 for streams
113 ass_library_t* library;
114 parser_priv_t* parser_priv;
115 } ass_track_t;
117 #endif /* LIBASS_TYPES_H */