CGBitmapContextCreate fails for RGB
Why would CGBitmapContextCreate() fail when I pass an RGB buffer format?
it works when I pass RGBA.
Any idea?
thanks
it works when I pass RGBA.
Any idea?
thanks
Code:
//-----------------------------------------------------------------
RGBA call
size_t rowBytes = 128 * 4;
contextRef = CGBitmapContextCreate( imageRef->buffer,
128,
128,
8,
rowBytes,
colorSpecInfo,
kCGImageAlphaNoneSkipLast );
//-----------------------------------------------------------------
RGB call
size_t rowBytes = 128 * 3;
contextRef = CGBitmapContextCreate( imageRef->buffer,
128,
128,
8,
rowBytes,
colorSpecInfo,
kCGImageAlphaNone );
According to http://developer.apple.com/qa/qa2001/qa1037.html
you can't have 24 bit pixels. Only 8, 16 & 32 bits per pixel. (btw, kCGImageAlphaNone & kCGImageAlphaNoneSkipLast are equivalent)
you can't have 24 bit pixels. Only 8, 16 & 32 bits per pixel. (btw, kCGImageAlphaNone & kCGImageAlphaNoneSkipLast are equivalent)
That's critical info, I wonder why is not part of CG documentation?
thanks PowerMacX.
by the way I donloaded your game entry from 2004 Okugai, good job!.
thanks PowerMacX.
by the way I donloaded your game entry from 2004 Okugai, good job!.
It is part of the CG documentation. Look at the Supported Pixel Formats table in the discussion of CGBitmapContextCreate.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Trouble with CGBitmapContextCreate | TomorrowPlusX | 3 | 4,159 |
Apr 10, 2006 02:23 PM Last Post: TomorrowPlusX |
|
| SDL on Tiger fails to update display | Dan Compton | 2 | 2,523 |
Jan 9, 2006 08:18 AM Last Post: DanLab |
|
| glGenProgramsARB fails... | TomorrowPlusX | 6 | 5,413 |
Feb 15, 2005 12:25 AM Last Post: PowerMacX |
|

