扫码关注官方订阅号
我从一个页面跳过去 至少等了3秒 检查踩发现 因为那个页面正在对图像进行滤镜 有什么办法能提高速度
走同样的路,发现不同的人生
GPUImage或许会快一点,以下是我用CIFilter测了一个滤镜处理,用了快2秒。
NSLog(@"start"); CIContext *context = [CIContext contextWithOptions:nil]; CIImage *image = [CIImage imageWithContentsOfURL:[NSURL URLWithString:@"http://127.0.0.1:8000/top1.jpg"]]; CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"]; [filter setValue:image forKey:kCIInputImageKey]; [filter setValue:@10.0f forKey: @"inputRadius"]; CIImage *result = [filter valueForKey:kCIOutputImageKey]; CGImageRef outImage = [context createCGImage: result fromRect:[result extent]]; UIImage * blurImage = [UIImage imageWithCGImage:outImage]; self.backgroundImageView.image=blurImage; NSLog(@"end"); 2015-09-09 16:18:22.703 test[7211:602636] start 2015-09-09 16:18:24.470 test[7211:602636] end
你可以用OpenGL的Context啊,你不传context默认是CPU的,对高斯模糊这种,CPU弱的时候就很慢了。点开看OpenGL context
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
GPUImage或许会快一点,以下是我用CIFilter测了一个滤镜处理,用了快2秒。
你可以用OpenGL的Context啊,你不传context默认是CPU的,对高斯模糊这种,CPU弱的时候就很慢了。
点开看OpenGL context