Remove libswscale directory in MPlayer sources
[mplayer.git] / libass / ass_types.h
blobd43fef3137fcdaa83de860a191904e360fdbdfc5
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 int treat_fontname_as_pattern;
62 } ass_style_t;
64 typedef struct render_priv_s render_priv_t;
66 /// ass_event_t corresponds to a single Dialogue line
67 /// Text is stored as-is, style overrides will be parsed later
68 typedef struct ass_event_s {
69 long long Start; // ms
70 long long Duration; // ms
72 int ReadOrder;
73 int Layer;
74 int Style;
75 char* Name;
76 int MarginL;
77 int MarginR;
78 int MarginV;
79 char* Effect;
80 char* Text;
82 render_priv_t* render_priv;
83 } ass_event_t;
85 typedef struct parser_priv_s parser_priv_t;
87 typedef struct ass_library_s ass_library_t;
89 /// ass track represent either an external script or a matroska subtitle stream (no real difference between them)
90 /// it can be used in rendering after the headers are parsed (i.e. events format line read)
91 typedef struct ass_track_s {
92 int n_styles; // amount used
93 int max_styles; // amount allocated
94 int n_events;
95 int max_events;
96 ass_style_t* styles; // array of styles, max_styles length, n_styles used
97 ass_event_t* events; // the same as styles
99 char* style_format; // style format line (everything after "Format: ")
100 char* event_format; // event format line
102 enum {TRACK_TYPE_UNKNOWN = 0, TRACK_TYPE_ASS, TRACK_TYPE_SSA} track_type;
104 // script header fields
105 int PlayResX;
106 int PlayResY;
107 double Timer;
108 int WrapStyle;
109 char ScaledBorderAndShadow;
112 int default_style; // index of default style
113 char* name; // file name in case of external subs, 0 for streams
115 ass_library_t* library;
116 parser_priv_t* parser_priv;
117 } ass_track_t;
119 #endif /* LIBASS_TYPES_H */