how to perform Bump Distortion in ios 5.0?

半腔热情 提交于 2019-12-01 14:42:41
Brad Larson

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.

Calling [CIFilter filterNamesInCategory:kCICategoryDistortionEffect] will show you that distortion filters (such as CIBumpDistortion) aren't available at all on iOS.

You can use the same method with kCICategoryBuiltIn to get a list of all filters that are available.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!