I'm looking at GPUImage3, My question is why closures are used here instead of direct assignments
public class LuminanceThreshold: BasicOperation {
public var threshold:Float = 0.5 { didSet { uniformSettings["threshold"] = threshold } }
public init() {
super.init(fragmentFunctionName: "thresholdFragment", numberOfInputs:1)
({threshold = 0.5})() //this line
}
}
I want to know why and how it works.