使用GPUImage在CATransition动画期间处理图像

时间:2014-06-05 04:06:39

标签: ios objective-c gpuimage catransition

当我摇动设备时,我正试图将图像恢复为默认值。问题是,图像处理为默认值,之后才发生rippleEffect。

我正在尝试在动画期间执行此操作,而不是之前或之后。 任何想法?

    -(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
         if(motion == UIEventSubtypeMotionShake){
            CATransition *animation=[CATransition animation];
            [animation setDelegate:self];
            [animation setDuration:1.0];
            [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
            [animation setType:@"rippleEffect"];
            //[animation setFillMode:kCAFillModeRemoved];
            animation.endProgress=0.99;

            [(GPUImageBulgeDistortionFilter *)sepiaFilter setScale:0.0];
            [sourcePicture processImage];

            [animation setRemovedOnCompletion:NO];
            [self.view.layer addAnimation:animation forKey:nil];
        }
    }

0 个答案:

没有答案