追記(2008/10/06): サンプルプロジェクトを作った.エントリーと異なる部分もあるが許してください.
でTransitionクラス.NSViewの画像キャプチャー部
…
@class CIImage;
…
@interface Transition : NSObject {
…
CIImage *_finalImage;
CIImage *_initialImage;
…
}
@end
@implementation Transition
…
- (void)captureViewForInitialView:(NSView*)view {
CIImage * image = [self createCoreImage:view];
[_initialImage release];
_initialImage = [image retain];
}
- (void)captureViewForFinalView:(NSView*)view {
CIImage * image = [self createCoreImage:view];
[_finalImage release];
_finalImage = [image retain];
}
- (CIImage *)createCoreImage:(NSView *)view {
NSBitmapImageRep *bitmap= [view bitmapImageRepForCachingDisplayInRect:[view bounds]];
[view cacheDisplayInRect:[view bounds] toBitmapImageRep:bitmap]; //important
CIImage *img= [[CIImage alloc] initWithBitmapImageRep:bitmap];
return img;
}
…
@end
0 件のコメント:
コメントを投稿