On Dec 12, 2008, at 11:28 PM, David Duncan wrote:

On Dec 12, 2008, at 12:50 PM, Thomas Clement wrote:

The image was 14340 x 14173 (8-bit RGB with no alpha).

Also I got these messages in the console:
kernel[0]: (default pager): [KERNEL]: no space in available paging segments
malloc: *** mmap(size=1073741824) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Attempt to allocate 1073741824 bytes for NS/CFData failed

Yup, your running into malloc() and VM space issues.

What approach should I take to handle large images?


I don't think there is an equivalent to this in AppKit, but you can do this using Core Graphics & ImageIO. The MassiveImage sample demonstrates how you can stream very large images (up to 32k x 32k iirc) to disk.

<http://developer.apple.com/samplecode/MassiveImage/index.html>

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.


Thanks to you and Nick for the help!
Thomas

_______________________________________________

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