swift - CIFilter key : kCIInputPoint0Key for CIToneCurve - Swift 3 & macOS 出错

标签 swift cifilter

我正在尝试控制亮度,如 Stack Overflow post 所示 使用 CIFilter CIToneCurve .

我收到这个错误:

Use of unresolved identifier 'kCIInputPoint0Key'

我在这里也找不到 key :Filter Parameter Keys

有没有人弄明白了?

最佳答案

从您在过滤器参数键上的链接(强调我的):

These keys represent some of the most commonly used input parameters. A filter can use other kinds of input parameters.

您需要做的是“硬编码”这些参数。例如:

let ciVector0 = CIVector(cgPoint: CGPoint(x: 0, y: 0))
filter.setValue(ciVector0, forKey: "inputPoint0")

您需要为这个过滤器的所有 5 个向量执行此操作。

关于swift - CIFilter key : kCIInputPoint0Key for CIToneCurve - Swift 3 & macOS 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43976456/

相关文章:

ios - Rxswift iOS-验证OTP字段并在单击按钮时确认OTP字段

swift - 使用 ARKit 和 SceneKit 检测真实世界的物体

ios - 如何从 GameScene 中的 ViewController 调用方法

ios - 任意混合半透明的PNG,在iOS上保留Alpha

ios - 如何使用 Swift 模糊 UIImageView 中的现有图像?

swift - 将 CIImage 乘以标量

ios - 在 Swift 中将 PaintCode 代码插入 UIImageView

ios - 设置 UIContextualAction 大小

ios - 格式化数据 CIColorCube

swift - 创建透明渐变并将其用作 SpriteKit 中的 alpha 蒙版