ios - 替换 iOS 12 中的自定义 CIFilter。

标签 ios swift ios12 cifilter

自 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/

相关文章:

ios - UILabel sizeToFit 不会拉伸(stretch)到宽度

iphone - 如何防止 iOS 设备上的显示屏变暗和关闭?

ios - 在 Firebase 上存储图像不起作用

ios - 使用自适应布局的 iPhone 和 iPad 设备的不同 uitableview 单元格高度

arrays - 如何在 swift 4 中声明数组索引的类型

ios - 将选取的图像发送到另一个 View

ios - 使用 UINavigationController navigationItem -> rightBarButtonItem

ios - ios 12 无法获取 Wifi 的 SSID

objective-c - NSString sizeWithAttributes在iOS 12上崩溃

scenekit - iOS 12 和 SceneKit : Node showing up in White