On May 4, 2010, at 8:57 AM, Thomas Davie wrote:

> After much searching about, I discovered (contrary to what the docs say), 
> that NSBitmapImageReps do not always premultiply their r/g/b by their alpha.  
> Because of this, I've dived in, and attempted to write my own 
> premultiplication, but something is going very wrong.  Some images are coming 
> out a quarter of the width they went in, others coming out completely empty...


Before diving too deeply into you code, why do you want to do this manually? 
Why not just create a second NSBitmapImageRep with the geometry that you 
desire, then draw the first into the second? This should do the 
premultiplication for you as well as cover any format that NSBitmapImageRep 
supports, rather than the ones that you manually code (as well as being more 
efficient since we've spent the effort to performance optimize those 
conversions).
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to