Re: CGImageRef to bitmap context? [SOLVED]
Re: CGImageRef to bitmap context? [SOLVED]
- Subject: Re: CGImageRef to bitmap context? [SOLVED]
- From: David Duncan <email@hidden>
- Date: Mon, 13 Aug 2007 12:42:24 -0700
On Aug 13, 2007, at 11:30 AM, Scott Thompson wrote:
It also seems possible that CGImage could potentially store more
than one representation behind it's façade. (I'm not trying to
imply that it does, but it could). I could imagine where a CGImage
contains more than one cached representation of an image... say for
drawing the images into different destination color spaces. If you
could ask the CGImage for a pixel, it wouldn't know which cached
image it should take the pixel value from.
The current API doesn't really allow for that, as each image carries
around it's complete specification (color space, pixel size, pixel
format, etc). In theory the API could be extended to allow multiple
data providers depending on certain conditions, but the API would
have to be modified fairly extensively (you no longer have an image
format, but a list of native formats, no longer one size, but
multiple sizes, etc).
However, if you wanted to implement something like this, a CGImage
itself isn't a very expensive structure to maintain (the image data
is typically far more expensive, as are any cached representations
that may be created when you draw it). If you wanted to do something
like this, you could create a group of related CGImages and on-demand
data providers that created the representation when you wanted it.
Then you just use the appropriate image ref and the proper
representation is created on demand.
--
David Duncan
Apple DTS Quartz and Printing
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