Getting immutable UIImage data pointer without copy?
Getting immutable UIImage data pointer without copy?
- Subject: Getting immutable UIImage data pointer without copy?
- From: Rick Mann <email@hidden>
- Date: Tue, 14 Nov 2017 18:36:27 -0800
Is there a way to get at the underlying raw image data for a given UIImage (in
an immutable buffer) in Swift?
Does this end up making copies? (For bonus points, what's the array magic?)
let img: UIImage = UIImage(named: "MyImage")
let data: CFData? = img.CGImage.dataProvider.data
let dataArray: [UInt8] = <some Swift magic to see this as [UInt8]>
Thanks,
--
Rick Mann
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden