I have a function that manipulates a UIImage
func myFunc(sourceImage: UIImage) {
...
UIGraphicsBeginImageContextWithOptions(dstSize, true, 1)
let ctx = UIGraphicsGetCurrentContext()!
CGContextSetInterpolationQuality(ctx, CGInterpolationQuality.High)
sourceImage.drawInRect(dstRect)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
...
}
Is this function thread-safe (multiple threads can process different images at the same time)?
From my understanding, functions like UIGraphicsGetCurrentContext
returns the same object on every thread so it isn't