自 iOS 12 起,CIColorKernel(source:"kernel string") 已被弃用。你们有人知道苹果的替代品是什么吗?
我正在 Swift 中寻找自定义 CIFilter。也许有一个开源库?
最佳答案
在 WWDC 2017 上宣布自定义滤镜也可以使用 Metal Shading Language 编写 - https://developer.apple.com/documentation/coreimage/writing_custom_kernels
所以现在显然他们正在完全摆脱核心图像内核语言。
这是使用 Metal 编写 CIColorKernel 的快速介绍 - https://medium.com/@shu223/core-image-filters-with-metal-71afd6377f4
使用 Metal 编写内核实际上更容易,唯一的问题是您需要在项目中指定 2 个编译器标志(请参阅上面的文章)。
关于ios - 替换 iOS 12 中的自定义 CIFilter。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52989593/