[NSBitmapImageRep getBitmapDataPlanes] copying data?
[NSBitmapImageRep getBitmapDataPlanes] copying data?
- Subject: [NSBitmapImageRep getBitmapDataPlanes] copying data?
- From: Jonathan Taylor <email@hidden>
- Date: Mon, 21 Feb 2011 11:56:17 +0000
I am looking at the performance of my code, and have found that rather a lot of time is spent in [NSBitmapImageRep getBitmapDataPlanes]. This is rather disappointing because I had assumed this was a 'trivial' way of getting a pointer to the actual data store itself in the case of raster data. Investigation using shark appears to confirm that the call is making a copy of the data(?). Can anyone shed any light on what is going on and whether I can do anything about it?
The sequence I'm using (hope I haven't missed anything out) is:
NSImage *theImage = [[NSImage alloc] initWithContentsOfFile:fileName];
...
NSObject *imageRepresentation = [[image representations] objectAtIndex:imgRepresentationIndex];
bmp = (NSBitmapImageRep*)imageRepresentation;
...
const unsigned char *srcData = [bmp bitmapData];
The file is in fact a TIFF file, so it does contain raster data. Am I going about this the wrong way as a means of getting at the raw pixels stored in a file? Thanks for any suggestions.
Jonny_______________________________________________
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