Re: NSBitmapImageRep problems
Re: NSBitmapImageRep problems
- Subject: Re: NSBitmapImageRep problems
- From: Nat! <email@hidden>
- Date: Fri, 12 Oct 2001 01:16:42 +0200
On Donnerstag, Oktober 11, 2001, at 11:39 Uhr, Per Ejeklint wrote:
>
--- Ac Dixit John C. Randolph 01-10-11:
>
>
>
>
> On Thursday, October 11, 2001, at 01:35 PM, Per Ejeklint wrote:
>
>> tmpImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:
>
>> rgbPlanar
>
>> pixelsWide: 2176
>
>> pixelsHigh: 1448
>
>> bitsPerSample: 12
>
>> samplesPerPixel: 3
>
>> hasAlpha: NO
>
>> isPlanar: YES
>
>> colorSpaceName: NSDeviceRGBColorSpace
>
>> bytesPerRow: 0
>
>> bitsPerPixel: 16];
>
>
>
> I can see one inconsistency here. If you have 12 bits per
>
> sample, then
>
> you have 36 bits per pixel, not 16.
>
>
Well, bitsPerPixel is probably a misleading name. The
>
documentation says:
>
"NSBitmapImageRep supports only a limited number of pixelBits values
>
(other than the default): for RGB images with 12 bps (bits per sample),
>
pixelBits may be 16; for RGB images with 24 bps, pixelBits may be 32."
>
>
> You might also want to just pass nil as the dataPlanes parameter, and
>
> let NSBitmapImageRep set it up for you.
>
>
Doesn't help. I've tried allsorts of combinations.
>
>
I probably have to face that NSBitmapImageRep will not go further
>
than 8
>
bits per sample RGB. :-/
>
>
Thanks John and Brian!
>
I tried a little test which just ran through the parameters of
NSBitmapImageRep and checked what gets accepted at what not (Mac OS
X 10.1):
NSDeviceCMYKColorSpace: bitsPerSample:2 samplesPerPixel:4
bitsPerPixel:8 hasAlpha:NO isPlanar:NO
NSDeviceCMYKColorSpace: bitsPerSample:4 samplesPerPixel:4
bitsPerPixel:16 hasAlpha:NO isPlanar:NO
NSDeviceCMYKColorSpace: bitsPerSample:4 samplesPerPixel:5
bitsPerPixel:20 hasAlpha:YES isPlanar:NO
NSDeviceCMYKColorSpace: bitsPerSample:8 samplesPerPixel:4
bitsPerPixel:8 hasAlpha:NO isPlanar:YES
NSDeviceCMYKColorSpace: bitsPerSample:8 samplesPerPixel:4
bitsPerPixel:32 hasAlpha:NO isPlanar:NO
NSDeviceCMYKColorSpace: bitsPerSample:8 samplesPerPixel:5
bitsPerPixel:8 hasAlpha:YES isPlanar:YES
NSDeviceCMYKColorSpace: bitsPerSample:8 samplesPerPixel:5
bitsPerPixel:40 hasAlpha:YES isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:2 samplesPerPixel:4
bitsPerPixel:8 hasAlpha:YES isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:4 samplesPerPixel:3
bitsPerPixel:12 hasAlpha:NO isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:4 samplesPerPixel:3
bitsPerPixel:16 hasAlpha:NO isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:4 samplesPerPixel:3
bitsPerPixel:16 hasAlpha:NO isPlanar:YES
NSDeviceRGBColorSpace: bitsPerSample:4 samplesPerPixel:4
bitsPerPixel:16 hasAlpha:YES isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:4 samplesPerPixel:4
bitsPerPixel:16 hasAlpha:YES isPlanar:YES
NSDeviceRGBColorSpace: bitsPerSample:8 samplesPerPixel:3
bitsPerPixel:8 hasAlpha:NO isPlanar:YES
NSDeviceRGBColorSpace: bitsPerSample:8 samplesPerPixel:3
bitsPerPixel:24 hasAlpha:NO isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:8 samplesPerPixel:3
bitsPerPixel:32 hasAlpha:NO isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:8 samplesPerPixel:3
bitsPerPixel:32 hasAlpha:NO isPlanar:YES
NSDeviceRGBColorSpace: bitsPerSample:8 samplesPerPixel:4
bitsPerPixel:8 hasAlpha:YES isPlanar:YES
NSDeviceRGBColorSpace: bitsPerSample:8 samplesPerPixel:4
bitsPerPixel:32 hasAlpha:YES isPlanar:NO
NSDeviceRGBColorSpace: bitsPerSample:8 samplesPerPixel:4
bitsPerPixel:32 hasAlpha:YES isPlanar:YES
NSDeviceBlackColorSpace: bitsPerSample:4 samplesPerPixel:2
bitsPerPixel:8 hasAlpha:YES isPlanar:NO
NSDeviceBlackColorSpace: bitsPerSample:8 samplesPerPixel:1
bitsPerPixel:8 hasAlpha:NO isPlanar:NO
NSDeviceBlackColorSpace: bitsPerSample:8 samplesPerPixel:1
bitsPerPixel:8 hasAlpha:NO isPlanar:YES
NSDeviceBlackColorSpace: bitsPerSample:8 samplesPerPixel:2
bitsPerPixel:8 hasAlpha:YES isPlanar:YES
NSDeviceBlackColorSpace: bitsPerSample:8 samplesPerPixel:2
bitsPerPixel:16 hasAlpha:YES isPlanar:NO
NSDeviceBlackColorSpace: bitsPerSample:12 samplesPerPixel:1
bitsPerPixel:12 hasAlpha:NO isPlanar:NO
NSDeviceBlackColorSpace: bitsPerSample:12 samplesPerPixel:1
bitsPerPixel:12 hasAlpha:NO isPlanar:YES
NSDeviceBlackColorSpace: bitsPerSample:12 samplesPerPixel:2
bitsPerPixel:12 hasAlpha:YES isPlanar:YES
NSDeviceBlackColorSpace: bitsPerSample:12 samplesPerPixel:2
bitsPerPixel:24 hasAlpha:YES isPlanar:NO
So 12 bits per sample seems to be possible (but no colors :))
Nat!
------------------------------------------------------
Some people drink deep from the fountains of life, and
some just gargle. -- DLR