Re: - [NSBitmapImageRep tiffRepresentation] malloc error
Re: - [NSBitmapImageRep tiffRepresentation] malloc error
- Subject: Re: - [NSBitmapImageRep tiffRepresentation] malloc error
- From: Thomas Clement <email@hidden>
- Date: Mon, 15 Dec 2008 21:47:31 +0100
On Dec 15, 2008, at 6:39 PM, David Duncan wrote:
On Dec 13, 2008, at 6:08 AM, Thomas Clement wrote:
Looks like this is what I need.
Now I also need to read pixel values from images on disk. For the
same reason I'd like to avoid loading the entire image into memory.
Is it possible to access pixel values piece by piece? I can't find
how to do that using data providers.
There isn't a direct way to do this unfortunately, as the only way
to read from a data provider is to obtain the entire data block.
Please file a bug requesting a solution for this.
Will do.
The work around is to draw the part of the image you want to work
with. You can do this with either AppKit or Core Graphics using
NSBitmapImageRep or a bitmap context (created via
CGBitmapContextCreate).
Alright but how am I suppose to draw a part of the image without
loading the whole image from disk first?
Creating a NSBitmapImageRep requires creating a NSData with the whole
image.
I tried using CGBitmapContextCreate but I got a malloc error again
when calling CGContextDrawImage (passing a small rect to draw).
How should I do this?
Thanks!
Thomas
_______________________________________________
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