comparison libass/ass_types.h @ 18937:9e95ac641e77

Initial libass release (without mencoder support).
author eugeni
date Fri, 07 Jul 2006 18:26:51 +0000
parents
children c8daf3471201
comparison
equal deleted inserted replaced
18936:b80b0c115a24 18937:9e95ac641e77
1 #ifndef __ASS_TYPES_H__
2 #define __ASS_TYPES_H__
3
4 #define VALIGN_SUB 0
5 #define VALIGN_CENTER 8
6 #define VALIGN_TOP 4
7 #define HALIGN_LEFT 1
8 #define HALIGN_CENTER 2
9 #define HALIGN_RIGHT 3
10
11 /// ass Style: line
12 typedef struct ass_style_s {
13 char* Name;
14 char* FontName;
15 int FontSize;
16 uint32_t PrimaryColour;
17 uint32_t SecondaryColour;
18 uint32_t OutlineColour;
19 uint32_t BackColour;
20 int Bold;
21 int Italic;
22 int Underline;
23 int StrikeOut;
24 double ScaleX;
25 double ScaleY;
26 int Spacing;
27 int Angle;
28 int BorderStyle;
29 double Outline;
30 double Shadow;
31 int Alignment;
32 int MarginL;
33 int MarginR;
34 int MarginV;
35 // int AlphaLevel;
36 int Encoding;
37 } ass_style_t;
38
39 /// ass_event_t corresponds to a single Dialogue line
40 /// Text is stored as-is, style overrides will be parsed later
41 typedef struct ass_event_s {
42 long long Start; // ms
43 long long Duration; // ms
44
45 int ReadOrder;
46 int Layer;
47 int Style;
48 char* Name;
49 int MarginL;
50 int MarginR;
51 int MarginV;
52 char* Effect;
53 char* Text;
54 } ass_event_t;
55
56 /// ass track represent either an external script or a matroska subtitle stream (no real difference between them)
57 /// it can be used in rendering after the headers are parsed (i.e. events format line read)
58 typedef struct ass_track_s {
59 int n_styles; // amount used
60 int max_styles; // amount allocated
61 int n_events;
62 int max_events;
63 ass_style_t* styles; // array of styles, max_styles length, n_styles used
64 ass_event_t* events; // the same as styles
65
66 char* style_format; // style format line (everything after "Format: ")
67 char* event_format; // event format line
68
69 enum {TRACK_TYPE_ASS, TRACK_TYPE_SSA} track_type;
70
71 // script header fields
72 int PlayResX;
73 int PlayResY;
74 double Timer;
75 int WrapStyle;
76
77
78 int default_style; // index of default style
79 char* name; // file name in case of external subs, 0 for streams
80 } ass_track_t;
81
82 #endif
83