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 viewpager检测滑动超出范围 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01