Re: [NSBitmapImageRep getBitmapDataPlanes] copying data?
Re: [NSBitmapImageRep getBitmapDataPlanes] copying data?
- Subject: Re: [NSBitmapImageRep getBitmapDataPlanes] copying data?
- From: Ken Thomases <email@hidden>
- Date: Mon, 21 Feb 2011 17:49:19 -0600
On Feb 21, 2011, at 5:07 PM, Jonathan Taylor wrote:
> So as far as my situation goes, what I'm after is an efficient way of starting from a path to some sort of raster image and obtaining a raw pixel buffer I can read. [Obviously if actually reading from disk then the disk will be the bottleneck, but it's often in the disk cache, in which case the extra data copy associated with [NSBitmapImageRep getBitmapDataPlanes] is a problem. I was rather liking the file-format-agnostic abilities of initWithContentsOfFile. Any thoughts?
What makes you think the data copy is "extra"?
If you read that AppKit release note, you'll see that NSImage may not be decoding the file contents right off the bat. For example, it mentions that "[i]f you initialize a NSImage from a JPEG file, then draw it in a PDF, you should get a PDF of the same file size as the original JPEG". In other words, NSImage is keeping the image data in its original JPEG-compressed format, not as a rasterized bitmap.
So, you may be seeing the one necessary/required data copy during decoding of the image, not anything extra.
Regards,
Ken
_______________________________________________
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