2008年10月19日日曜日

波紋のトランジション

こちらのエントリーをみて,以前書いたこれサンプルが,どれくらい簡単に変更できるか興味がわいたのでやってみた.

まぁ,想像の範囲内,一応以下のように'createTransitionFilter'メソッドだけ変更すればできた.
Transition.m
- (void)createTransitionFilter {
[_transitionFilter release];
_transitionFilter = nil;

_transitionFilter = [[CIFilter filterWithName:@"CIRippleTransition"] retain];
[_transitionFilter setDefaults];
[_transitionFilter setValue:_initialImage
forKey:@"inputImage"];
[_transitionFilter setValue:_finalImage
forKey:@"inputTargetImage"];
[_transitionFilter setValue:_inputShadingImage
forKey:@"inputShadingImage"];
NSRect rect = [_delegate bounds];
[_transitionFilter setValue:[CIVector vectorWithX:rect.origin.x
Y:rect.origin.y
Z:rect.size.width
W:rect.size.height]
forKey:@"inputExtent"];
[_transitionFilter setValue:[CIVector vectorWithX:NSMidX(rect)
Y:NSMidY(rect)
Z:0
W:0]
forKey:@"inputCenter"];
[_transitionFilter setValue:[NSNumber numberWithInt:30]
forKey:@"inputWidth"];
[_transitionFilter setValue:[NSNumber numberWithInt:50]
forKey:@"inputScale"];

}

変更
video

変更
video


参考
トランジションフィルタ (Transition Filters)
http://developer.apple.com/jp/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_filters/chapter_5_section_14.html


間違いがあればご指摘いただければ幸いです.

0 件のコメント: