Re: Avoiding Cached ImageReps?
Re: Avoiding Cached ImageReps?
- Subject: Re: Avoiding Cached ImageReps?
- From: Fritz Anderson <email@hidden>
- Date: Sun, 7 Jul 2002 18:15:59 -0500
- Resent-date: Sun, 7 Jul 2002 18:19:52 -0500
- Resent-from: Fritz Anderson <email@hidden>
- Resent-message-id: <email@hidden g>
- Resent-to: email@hidden
A veteran suggested, off-line, that I try the NSImage instance method setDataRetained:, which certainly seemed to be the right thing, but I tried it several different ways over the past day or two with no luck.
However, using setDataRetained: on a different machine, with a different configuration, showed that setDataRetained: solved my problem: I can use the image-manipulation facilities of Cocoa up to the point where working at the bitmap level becomes absolutely necessary, and still hope to retrieve my data. (Special thanks to Tom Waters for pointing out that getting a bitmap from the TIFFRepresentation guarantees this would be possible in any event.)
In other words, the specific problem I wrote about may have been caused by peculiarities of my development box that would not show up in the field. In other words, my bug. Probably.
Still, my veteran (I assume he doesn't want to be named) says that setDataRetained: has not historically (as in over the span of NeXTStep) been reliable for recovering a bit representation. Does anyone know if this is still the case?
-- F
On Sunday, July 7, 2002, at 04:46 PM, Fritz Anderson wrote:
I'm working on a simple bitmap-analysis program. The user pulls in images though NSImage and then selecting parts of the images for further work. The application attempts to obtain the underlying bitmap data through NSBitmapImageRep.
It seems that as soon as I lock focus on the image, the contained representation becomes an NSCachedImageRep, and the underlying bitmap is forever out of my reach. This means I can't use much of Cocoa (or at least much of NSImage and its cousins) to do the convenience and human-interface work leading up to my bitmap-level image processing.
Now, I recognize that there are good performance reasons (which Apple has promised will soon become even better) to want to turn buffers over to hardware. I also know that much (_but not all_) low-level graphics work is unsuited to Cocoa-level programming.
It just seems to me that once I entrust data to Cocoa, I ought to be able to trust Cocoa to give me my data back. (I swear I'm not trying to generate unauthorized re-dithers of trademarked or copyrighted mice, if that's the issue.)
Is there some way to achieve this? Or, if Cocoa is not the higher-than-POSIX level for reading, presenting, and moving images, can someone point me in the right direction in, for instance, Core Graphics?
--
Fritz Anderson - Consulting Programmer - Chicago, IL
Mail: <email@hidden>
Resume: <
http://resume.manoverboard.org>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.