Re: Getting immutable UIImage data pointer without copy?
Re: Getting immutable UIImage data pointer without copy?
- Subject: Re: Getting immutable UIImage data pointer without copy?
- From: Jens Alfke <email@hidden>
- Date: Tue, 14 Nov 2017 20:18:50 -0800
> On Nov 14, 2017, at 8:11 PM, Rick Mann <email@hidden> wrote:
>
> Maybe, at least for the bonus question. The bigger question is around the
> copy.
Where pixmaps live is a pretty complex issue — ideally they live in the GPU’s
address space as textures so they can be blitted efficiently, and that’s often
(depending on your hardware) not accessible to the CPU at all. But there’s a
lot of logic in CoreGraphics and the underlying graphics engines to shuffle the
pixmaps back and forth so software can read and write them.
Another factor is that the pixmap may be rescaled or translated into different
color spaces to optimize rendering it. So there may not exist a default
rendering of it at the time you request one, meaning CG will generate a new
pixmap for you. (Also, I dunno about UIImage, but NSImage supports image
formats like PDF that don’t have a native pixmap representation at all.)
I’m not super into graphics, but my gut feeling is that, if you care about
optimization details like whether pixmaps are being copied, you should really
be using a lower-level graphics API than UIImage, which is mostly a
cheap-and-cheerful convenience layer for apps that just need to splat a few
PNGs into their GUI.
—Jens
_______________________________________________
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