Fw: NSBitmapImageRep bitmapData and 16 bits per sample
Fw: NSBitmapImageRep bitmapData and 16 bits per sample
- Subject: Fw: NSBitmapImageRep bitmapData and 16 bits per sample
- From: "Geraldine Joffre" <email@hidden>
- Date: Sun, 8 Jun 2003 16:39:46 +0200
Hello Cocoa gurus,
My app needs to read a 16-bits image, process it and create a 16-bits image from the
processed data.
If I set bitsPerSample to 16 when allocating NSBitmapImageRep, the image produced has 16
bps as expected. However, it looks like the second byte of each sample is not used, the
image information being kept in the first byte only, which means that the image produced is
in reality an 8 bits image even though it has 16 bits per sample.
I guess that the problem is that I'm using the method [NSBitmapImageRep bitmapData] to
get a pointer I can work with to set the pixel values. This method returns a pointer in the
format unsigned char whereas I would need an unsigned short to create 16 bps values.
Is there a way to access pixel values without using the [NSBitmapImageRep
bitmapData] method? If not, what should I do to be able to access pixel values in
16bits format? Or should I rather use Quick Time API for 16-bits images?
Thanks for any help.
--
G. Joffre
http://www.multimediaphoto.com/photomatix
_______________________________________________
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.