source: trunk/Subtitles/SubContext.h @ 658

Revision 658, 1.8 KB checked in by astrange, 7 years ago (diff)

Heavily rewrite the subtitle code, should be cleaner and faster and better-looking. Also it probably breaks everything.

Line 
1//
2//  SubContext.h
3//  SSARender2
4//
5//  Created by Alexander Strange on 7/28/07.
6//  Copyright 2007 __MyCompanyName__. All rights reserved.
7//
8
9#import <Cocoa/Cocoa.h>
10#import "SubRenderer.h"
11
12enum {kSubTypeSSA, kSubTypeASS, kSubTypeSRT};
13enum {kSubCollisionsNormal, kSubCollisionsReverse};
14enum {kSubLineWrapTopWider = 0, kSubLineWrapSimple, kSubLineWrapNone, kSubLineWrapBottomWider};
15enum {kSubAlignmentLeft, kSubAlignmentCenter, kSubAlignmentRight};
16enum {kSubAlignmentBottom, kSubAlignmentMiddle, kSubAlignmentTop};
17
18typedef ATSURGBAlphaColor SubRGBAColor;
19
20@interface SubStyle : NSObject {       
21        @public;
22        NSString *name;
23        NSString *fontname;
24        Float32 size;
25        SubRGBAColor primaryColor, secondaryColor, outlineColor, shadowColor;
26        Float32 scaleX, scaleY, tracking, angle;
27        Float32 outlineRadius, shadowDist;
28        unsigned marginL, marginR, marginV;
29        BOOL bold, italic, underline, strikeout;
30        UInt8 alignH, alignV, borderStyle;
31        void* ex;
32        SubRenderer *delegate;
33}
34+(SubStyle*)defaultStyleWithDelegate:(SubRenderer*)delegate;
35-(SubStyle*)initWithDictionary:(NSDictionary *)s scriptVersion:(UInt8)version delegate:(SubRenderer *)renderer;
36@end
37
38@interface SubContext : NSObject {
39        @public;
40       
41        float resX, resY;
42        UInt8 scriptType, collisions, wrapStyle;
43        NSDictionary *styles; SubStyle *defaultStyle;
44        NSDictionary *headers;
45        NSString *headertext;
46}
47
48-(SubContext*)initWithHeaders:(NSDictionary *)headers styles:(NSArray *)styles extraData:(NSString *)ed delegate:(SubRenderer*)delegate;
49-(SubContext*)initWithNonSSAType:(UInt8)type delegate:(SubRenderer*)delegate;
50-(SubStyle*)styleForName:(NSString *)name;
51-(void)fixupResForVideoAspectRatio:(float)aspect;
52@end
53
54extern UInt8 SSA2ASSAlignment(UInt8 a);
55void ParseASSAlignment(UInt8 a, UInt8 *alignH, UInt8 *alignV);
56extern SubRGBAColor ParseSSAColor(unsigned rgb);
Note: See TracBrowser for help on using the repository browser.