Mercurial > projects > dstep
comparison dstep/quartzcore/CIImageProvider.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.quartzcore.CIImageProvider; | |
8 | |
9 import dstep.foundation.NSDictionary; | |
10 import dstep.foundation.NSString; | |
11 import dstep.objc.bridge.Bridge; | |
12 import dstep.objc.objc; | |
13 import dstep.quartzcore.CIImage; | |
14 | |
15 import bindings = dstep.quartzcore.CIImageProvider_bindings; | |
16 | |
17 private | |
18 { | |
19 NSString kCIImageProviderTileSize_; | |
20 NSString kCIImageProviderUserInfo_; | |
21 } | |
22 | |
23 NSString kCIImageProviderTileSize () | |
24 { | |
25 if (kCIImageProviderTileSize_) | |
26 return kCIImageProviderTileSize_; | |
27 | |
28 return kCIImageProviderTileSize_ = new NSString(bindings.kCIImageProviderTileSize); | |
29 } | |
30 | |
31 NSString kCIImageProviderUserInfo () | |
32 { | |
33 if (kCIImageProviderUserInfo_) | |
34 return kCIImageProviderUserInfo_; | |
35 | |
36 return kCIImageProviderUserInfo_ = new NSString(bindings.kCIImageProviderUserInfo); | |
37 } | |
38 | |
39 const TCIImageProvider = ` | |
40 | |
41 static CIImage imageWithImageProvider (Object p, size_t width, size_t height, CIFormat f, CGColorSpaceRef cs, NSDictionary dict) | |
42 { | |
43 return invokeObjcSelfClass!(CIImage, "imageWithImageProvider:size::format:colorSpace:options:", Object, size_t, size_t, CIFormat, CGColorSpaceRef, NSDictionary)(p, width, height, f, cs, dict); | |
44 } | |
45 | |
46 typeof(this) initWithImageProvider (Object p, size_t width, size_t height, CIFormat f, CGColorSpaceRef cs, NSDictionary dict) | |
47 { | |
48 id result = invokeObjcSelf!(id, "initWithImageProvider:size::format:colorSpace:options:", Object, size_t, size_t, CIFormat, CGColorSpaceRef, NSDictionary)(p, width, height, f, cs, dict); | |
49 return result is this.objcObject ? this : (result !is null ? new typeof(this)(result) : null); | |
50 } | |
51 | |
52 this (Object p, size_t width, size_t height, CIFormat f, CGColorSpaceRef cs, NSDictionary dict) | |
53 { | |
54 super(typeof(this).alloc.initWithImageProvider(p, width, height, f, cs, dict).objcObject); | |
55 } | |
56 | |
57 //mixin ObjcBindClassMethod!(imageWithImageProvider, "imageWithImageProvider:size::format:colorSpace:options:"); | |
58 //mixin ObjcBindMethod!(initWithImageProvider, "initWithImageProvider:size::format:colorSpace:options:"); | |
59 | |
60 `; | |
61 |