Re: deserializeBytes question
Re: deserializeBytes question
- Subject: Re: deserializeBytes question
- From: Chris Kane <email@hidden>
- Date: Mon, 5 Nov 2001 13:46:32 -0800
-deserializeAlignedBytesLengthAtCursor: and related are for
deserializing things previously serialized with the -
serializeAlignedBytesLength: and other serialize* methods. Those
methods aren't for arbitrary serialization and deserialization.
I don't know anything about the TIFF representation format, but those
NSData/NSMutableData methods declared in NSSerialization.h won't help
you.
Whenever I have wanted a pixel at a time (in the past, not recently),
I've gone to the image representations in the NSImage. In all the cases
I've ever had, there's been an NSBitmapImageRep in there as one of them,
and if you get that, it'll give you the raw pixel bytes, pixel
width/height, bits per pixel and all that stuff. Without a TIFF parser,
I don't know if the TIFF representation is useful for anything other
than saving to a file or writing to the network.
Chris Kane
Cocoa Frameworks, Apple
On Wednesday, October 31, 2001, at 12:56 PM, eblueBeta wrote:
hey,
got a problem understanding the implementation of the deserialize
methods in the NSData and NSMutableData Objects.
I am actually trying to get the int values for each rgb pixel in a
tiff image rep.
so I get the NSdata object for the tiffImageRep,
then I set my Cursor to the address of the pointer to the bytes of the
Data Object, I am guessing that the counter needs to be that base
address of the first element in the byte buffer.
now I send this command:
myInt = [MyDataObject deserializeAlignedBytesLengthAtCursor:
cursor];
this gives me back an error:
2001-10-31 15:38:42.195 mitre[447] *** -[NSConcreteData
deserializeAlignedBytesLengthAtCursor:]: range {1296891946, 4} exceeds
data length 1399874
so my assumption at this point is that I don't understand deserializing.
the documentation of course is very spotty, so I don't know where to
begin figuring this out.