2017-05-15 3 views
0

このStack Overflow post のように明るさを制御しようとしていますが、CIFilter CIToneCurveを使用しています。CIFilterキーでエラー:CIToneCurve - Swift 3&macOSのkCIInputPoint0Key

カントー私はこのエラーを取得しています:

Use of unresolved identifier 'kCIInputPoint0Key' 

私もここで鍵を見つけることができません:Filter Parameter Keys

は、誰もがこれを考え出していますか?フィルタパラメータキー(強調鉱山)上のあなたのリンクから

答えて

1

:あなたがする必要がどのような

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つのベクトルすべてに対してこの処理を行う必要があります。

+0

ありがとうございました、キーを文字列として使用しました! – Hexagons

関連する問題