CIFilter 密钥错误:CIToneCurve 的 kCIInputPoint0Key - Swift 3 & macOS

Error with CIFilter key: kCIInputPoint0Key for CIToneCurve - Swift 3 & macOS

我正在尝试像这样控制亮度 Stack Overflow post 使用 CIFilter CIToneCurve.

我收到这个错误:

Use of unresolved identifier 'kCIInputPoint0Key'

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

有人解决了吗?

来自过滤器参数键上的 link(强调我的):

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

你需要做的就是"hard-code"那些参数。例如:

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

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