Re: NSBitmapImageContext from Word *
Re: NSBitmapImageContext from Word *
- Subject: Re: NSBitmapImageContext from Word *
- From: Greg Best <email@hidden>
- Date: Fri, 10 Mar 2006 02:28:15 -0800
I also see that NSBitmapImageRep says:
"The bps (bits per sample) argument is the number of bits used to
specify 1 pixel in a single component of the data. All components are
assumed to have the same bits per sample. bps should be one of these
values: 1, 2, 4, 8, 12, or 16."
so 5 bps, probably won't work. You probably need to do a bit more
work and break out the individual sample values into full 8 bit
values...
On Mar 9, 2006, at 5:19 PM, David Kopec wrote:
Hi everyone,
I'm attempting to put
WORD *WorkFrame;
which points to
WORD DoubleFrame[ 2 ][ NES_DISP_WIDTH * NES_DISP_HEIGHT ];
in which the pixels are stored like this:
Since Array WorkFrame stores the screen information (256x240) in
16-bit pallet format (5-5-5), it must be transformed and
displayed in the format of the target machine.
into an NSBitmapImageContext using the following:
NSBitmapImageRep *ir = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:(unsigned char **)WorkFrame
pixelsWide:NES_DISP_WIDTH pixelsHigh:NES_DISP_HEIGHT
bitsPerSample:5
samplesPerPixel:3 hasAlpha:NO isPlanar:NO
colorSpaceName:NSDeviceRGBColorSpace
bytesPerRow:NES_DISP_WIDTH*2 bitsPerPixel:16];
All I'm getting is blankness and "Inconsistent set of values to
create NSBitmapImageRep"
Any help much appreciated. Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden