Re: Obtaining unpremultiplied bitmap from PNG file
Re: Obtaining unpremultiplied bitmap from PNG file
- Subject: Re: Obtaining unpremultiplied bitmap from PNG file
- From: David Duncan <email@hidden>
- Date: Thu, 14 Jun 2007 10:57:53 -0700
On Jun 13, 2007, at 2:28 PM, Shamyl Zakariya wrote:
As far as I can tell, Cocoa simply won't give you non-premultiplied
bitmap data. The CG constant kCGImageAlphaLast ( IIRC ) is there,
but isn't actually implemented.
kCGImageAlphaLast is implemented and fully supported for creating a
CGImageRef. What is not implemented is creating a bitmap context (via
CGBitmapContextCreate) that does not use pre-multiplied alpha. The
distinction is subtle, but practically it means that you can create
an image that does not used pre-multiplied alpha, but in the current
API you cannot obtain the pixel data from that image into your own
buffer without getting it pre-multiplied.
On Jun 14, 2007, at 2:34 AM, Barry wrote:
How do I access the pixel data of a CGImage object?
at
http://developer.apple.com/qa/qa2007/qa1509.html
Is this a solution ???
This Q&A demonstrates obtaining the pixel data via a bitmap context,
which as above requires you to work with pre-multiplied data.
--
David Duncan
Apple DTS Quartz and Printing
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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