source: trunk/Subtitles/SubContext.h @ 659

Revision 659, 1.9 KB checked in by astrange, 7 years ago (diff)

SSA: Fix \r, reduce spacing between lines, and attempt to match VSFilter's font sizes better.

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
12//you'd think VSFilter would use 72dpi (scale by 1) or 96dpi (scale by .75) but it doesn't
13#define kVSFilterFontScale .9
14
15enum {kSubTypeSSA, kSubTypeASS, kSubTypeSRT};
16enum {kSubCollisionsNormal, kSubCollisionsReverse};
17enum {kSubLineWrapTopWider = 0, kSubLineWrapSimple, kSubLineWrapNone, kSubLineWrapBottomWider};
18enum {kSubAlignmentLeft, kSubAlignmentCenter, kSubAlignmentRight};
19enum {kSubAlignmentBottom, kSubAlignmentMiddle, kSubAlignmentTop};
20
21typedef ATSURGBAlphaColor SubRGBAColor;
22
23@interface SubStyle : NSObject {       
24        @public;
25        NSString *name;
26        NSString *fontname;
27        Float32 size;
28        SubRGBAColor primaryColor, secondaryColor, outlineColor, shadowColor;
29        Float32 scaleX, scaleY, tracking, angle;
30        Float32 outlineRadius, shadowDist;
31        unsigned marginL, marginR, marginV;
32        BOOL bold, italic, underline, strikeout;
33        UInt8 alignH, alignV, borderStyle;
34        void* ex;
35        SubRenderer *delegate;
36}
37+(SubStyle*)defaultStyleWithDelegate:(SubRenderer*)delegate;
38-(SubStyle*)initWithDictionary:(NSDictionary *)s scriptVersion:(UInt8)version delegate:(SubRenderer *)renderer;
39@end
40
41@interface SubContext : NSObject {
42        @public;
43       
44        float resX, resY;
45        UInt8 scriptType, collisions, wrapStyle;
46        NSDictionary *styles; SubStyle *defaultStyle;
47        NSDictionary *headers;
48        NSString *headertext;
49}
50
51-(SubContext*)initWithHeaders:(NSDictionary *)headers styles:(NSArray *)styles extraData:(NSString *)ed delegate:(SubRenderer*)delegate;
52-(SubContext*)initWithNonSSAType:(UInt8)type delegate:(SubRenderer*)delegate;
53-(SubStyle*)styleForName:(NSString *)name;
54-(void)fixupResForVideoAspectRatio:(float)aspect;
55@end
56
57extern UInt8 SSA2ASSAlignment(UInt8 a);
58void ParseASSAlignment(UInt8 a, UInt8 *alignH, UInt8 *alignV);
59extern SubRGBAColor ParseSSAColor(unsigned rgb);
Note: See TracBrowser for help on using the repository browser.