On Aug 18, 2011, at 4:31 PM, The Karl Adam wrote: > Hey David, > Why not just use the CGDataProviderCopyData(CGImageGetDataProvider(imageRef)) > to create a new NSBitmapImageRequest with the image's original data? Is > drawing it more performant or gives you a better more compact data > representation?
In the end the difference is minor (assuming you use either the NSCompositeCopy compositing operation or kCGBlendModeCopy blend mode when drawing the image – if you don't you leave some performance on the ground and need to ensure your destination buffer has been cleared). The primary downside to using CGDataProviderCopyData is that if the original image isn't in precisely the format you need, you have to re-draw it anyway. Typically CGDataProviderCopyData() is most valuable if your source data is in non-premultiplied alpha format and you need it to remain in that format. Core Graphics can't provide you with non-premultiplied alpha pixels via drawing, so thats the only route if you need them. -- David Duncan _______________________________________________ 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