NSBitmapImageRep problems
NSBitmapImageRep problems
- Subject: NSBitmapImageRep problems
- From: Per Ejeklint <email@hidden>
- Date: Thu, 11 Oct 2001 22:35:59 +0200
Hi all,
this is my first post and I'm a rookie on Cocoa so please be gentle with
me! :)
I'm trying to get some raw RGB-data to display but have stuck on
NSBitmapImageRep. The data has 12 bits for each colour, stuffed in arrays
made-up like this:
unsigned short *rgbPlanar[3];
rgbPlanar[0] = malloc(800*600*sizeof(unsigned short));
rgbPlanar[1] = malloc(800*600*sizeof(unsigned short));
rgbPlanar[2] = malloc(800*600*sizeof(unsigned short));
I then try to create an image representation like this.
tmpImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: rgbPlanar
pixelsWide: 2176
pixelsHigh: 1448
bitsPerSample: 12
samplesPerPixel: 3
hasAlpha: NO
isPlanar: YES
colorSpaceName: NSDeviceRGBColorSpace
bytesPerRow: 0
bitsPerPixel: 16];
but NSBitmapImageRep barfs on me and says: "Inconsistent set of values to
create NSBitmapImageRep"
It works OK if I truncate data to 8-bit RGB values but then I lose lots
of image data. Am I way off here of have I missed something? I can't
figure out from the documentation if there are limitations I've exceeded.
Maybe there is no support for more-than-8-bit-RGBs?
/Per
--------------------------------------------
Per Ejeklint, OOPix AB,
http://www.oopix.se
@work: +46 8 440 7396, @road +46 70 609 7396
--------------------------------------------