how to perform Bump Distortion in ios 5.0?(如何在 ios 5.0 中执行凹凸失真?)
问题描述
我需要在 ios 5.0 中执行 Bump Distortion...我的 xcode 没有显示任何错误,而且我没有得到任何输出......在跟踪并打印 凹凸过滤器 实例时,它会打印空值...
关于这个的任何想法......
一些帖子显示在 ios 5.0 中无法使用,还有其他方法可以执行凹凸失真...
提前谢谢....
问候,
间谍网
我的代码...
context = [CIContext contextWithOptions:nil];CIFilter *bumpDistortion = [CIFilter filterWithName:@"CIBumpDistortion"];[bumpDistortion setValue:ciimage forKey:kCIInputImageKey];[bumpDistortion setValue:[CIVector vectorWithX:200 Y:150] forKey:@"inputCenter"];[bumpDistortion setValue:[NSNumber numberWithFloat:100] forKey:@"inputRadius"];[bumpDistortion setValue:[NSNumber numberWithFloat:3.0] forKey:@"inputScale"];CIImage *imageOutput = [bumpDistortion outputImage];CGImageRef cgimg = [context createCGImage:imageOutput fromRect:[imageOutput extent]];UIImage *newImg = [UIImage imageWithCGImage:cgimg];[self.imageView setImage:newImg];
正如 omz 指出的那样,从 iOS 5.1 开始,这个特殊的 Core Image 过滤器就没有了.
但是,您可以使用我的 中展示了您可以使用此框架执行的其他一些变形.
i need to perform Bump Distortion in ios 5.0... my xcode doesn't show any error and also i am not get any output ... while trace and print the Bump filter instance it prints the null value...
any idea about that...
some of the post shows that was not work in ios 5.0, any other way is there to perform the Bump Distortion...
Thanks in advance....
Regards,
Spynet
My code...
context = [CIContext contextWithOptions:nil];
CIFilter *bumpDistortion = [CIFilter filterWithName:@"CIBumpDistortion"];
[bumpDistortion setValue:ciimage forKey:kCIInputImageKey];
[bumpDistortion setValue:[CIVector vectorWithX:200 Y:150] forKey:@"inputCenter"];
[bumpDistortion setValue:[NSNumber numberWithFloat:100] forKey:@"inputRadius"];
[bumpDistortion setValue:[NSNumber numberWithFloat:3.0] forKey:@"inputScale"];
CIImage *imageOutput = [bumpDistortion outputImage];
CGImageRef cgimg = [context createCGImage:imageOutput fromRect:[imageOutput extent]];
UIImage *newImg = [UIImage imageWithCGImage:cgimg];
[self.imageView setImage:newImg];
As omz points out, this particular Core Image filter is missing as of iOS 5.1.
However, you can easily do this using my GPUImage framework and the GPUImageBulgeDistortionFilter:
For processing a UIImage, and getting a UIImage result, you'd use code like the following:
UIImage *inputImage = [UIImage imageNamed:@"test.jpg"];
GPUImageBulgeDistortionFilter *stillImageFilter = [[GPUImageBulgeDistortionFilter alloc] init];
UIImage *quickFilteredImage = [stillImageFilter imageByFilteringImage:inputImage];
You can also do this on live video or prerecorded movies in realtime.
I show a few other distortions you can perform with this framework in this answer.
这篇关于如何在 ios 5.0 中执行凹凸失真?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 ios 5.0 中执行凹凸失真?


基础教程推荐
- Android:对话框关闭而不调用关闭 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01