Created
March 18, 2016 11:23
-
-
Save FlexMonkey/0d938db6e42ca97911a5 to your computer and use it in GitHub Desktop.
CIVector extension to multiply each component by a single CIFloat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CIVector | |
{ | |
func multiply(value: CGFloat) -> CIVector | |
{ | |
let n = self.count | |
var targetArray = [CGFloat]() | |
for i in 0 ..< n | |
{ | |
targetArray.append(self.valueAtIndex(i) * value) | |
} | |
return CIVector(values: targetArray, count: n) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment