| 1 | /* |
|---|
| 2 | * SubATSUIRenderer.h |
|---|
| 3 | * Created by Alexander Strange on 7/30/07. |
|---|
| 4 | * |
|---|
| 5 | * This file is part of Perian. |
|---|
| 6 | * |
|---|
| 7 | * This library is free software; you can redistribute it and/or |
|---|
| 8 | * modify it under the terms of the GNU Lesser General Public |
|---|
| 9 | * License as published by the Free Software Foundation; either |
|---|
| 10 | * version 2.1 of the License, or (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This library is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 | * Lesser General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU Lesser General Public |
|---|
| 18 | * License along with FFmpeg; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | #ifdef __cplusplus |
|---|
| 23 | extern "C" |
|---|
| 24 | { |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | #ifdef __OBJC__ |
|---|
| 28 | #import <Cocoa/Cocoa.h> |
|---|
| 29 | #import "SubRenderer.h" |
|---|
| 30 | |
|---|
| 31 | @interface SubATSUIRenderer : SubRenderer { |
|---|
| 32 | SubContext *context; |
|---|
| 33 | unichar *ubuffer; |
|---|
| 34 | UniCharArrayOffset *breakbuffer; |
|---|
| 35 | ATSUTextLayout layout; |
|---|
| 36 | float screenScaleX, screenScaleY, videoWidth, videoHeight; |
|---|
| 37 | @public; |
|---|
| 38 | CGColorSpaceRef srgbCSpace; |
|---|
| 39 | TextBreakLocatorRef breakLocator; |
|---|
| 40 | } |
|---|
| 41 | -(SubATSUIRenderer*)initWithVideoWidth:(float)width videoHeight:(float)height; |
|---|
| 42 | -(SubATSUIRenderer*)initWithSSAHeader:(NSString*)header videoWidth:(float)width videoHeight:(float)height; |
|---|
| 43 | -(void)renderPacket:(NSString *)packet inContext:(CGContextRef)c width:(float)cWidth height:(float)cHeight; |
|---|
| 44 | @end |
|---|
| 45 | |
|---|
| 46 | typedef SubATSUIRenderer *SubtitleRendererPtr; |
|---|
| 47 | |
|---|
| 48 | #else |
|---|
| 49 | #include <QuickTime/QuickTime.h> |
|---|
| 50 | |
|---|
| 51 | typedef void *SubtitleRendererPtr; |
|---|
| 52 | |
|---|
| 53 | #endif |
|---|
| 54 | |
|---|
| 55 | extern SubtitleRendererPtr SubInitForSSA(char *header, size_t headerLen, int width, int height); |
|---|
| 56 | extern SubtitleRendererPtr SubInitNonSSA(int width, int height); |
|---|
| 57 | extern CGColorSpaceRef SubGetColorSpace(SubtitleRendererPtr s); |
|---|
| 58 | extern void SubRenderPacket(SubtitleRendererPtr s, CGContextRef c, CFStringRef str, int cWidth, int cHeight); |
|---|
| 59 | extern void SubPrerollFromHeader(char *header, int headerLen); |
|---|
| 60 | extern void SubDisposeRenderer(SubtitleRendererPtr s); |
|---|
| 61 | |
|---|
| 62 | #ifdef __cplusplus |
|---|
| 63 | } |
|---|
| 64 | #endif |
|---|