I am trying to create the CICrossPolynomial filter type in Swift.
I am unsure how to create the syntax to do it however.
The documentation specifies a CIVector which has an array of floats?
A CIVector object whose display name is RedCoefficients.
Default value: [1 0 0 0 0 0 0 0 0 0] Identity: [1 0 0 0 0 0 0 0 0 0]
But how do I actually declare such a CIVector? There is one constructor that has this signature
CIVector(values: <UnsafePointer<CGFloat>>, count: <UInt>)
But when I try
var floatArr:Array<CGFloat> = [1,0,0,0,0,0,0,0,0]
var vector = CIVector(values: floatArr, count: floatArr.count)
I get the error:
Cannot invoke 'init' with an argument list type (values: @lvaue Array<CGFloat>, count:Int)
Do you know how I can properly create a CIVector with an array of CGFloats?
floatArr.count
has the typeInt
, but thecount:
parameter has the typeUInt
, therefore you need to convert it explicitly: