| View previous topic :: View next topic |
| Author |
Message |
biermana
Joined: 27 Jun 2005 Posts: 12
|
Posted: Mon Jun 27, 2005 3:28 pm Post subject: Pixel format for pgBitBlt call's byte array parameter |
|
|
Hi,
I searched docs, couldn't find the answer so posting question here...
In the function call:
void pgBitBlt(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d);
what is the pixel format for the byte array referenced by last parameter *d ?
Is is 32bpp rgb or 16bpp rgb or something else?
Thanks for the help.
Thanks,
Tony |
|
| Back to top |
|
 |
maddogjt1
Joined: 27 Jun 2005 Posts: 13
|
Posted: Mon Jun 27, 2005 3:36 pm Post subject: |
|
|
| I believe that it is 16 bpp BGR format XBBBBBGGGGGRRRRR but don't hold me to it. |
|
| Back to top |
|
 |
KprOfTime
Joined: 27 Jun 2005 Posts: 3
|
Posted: Mon Jun 27, 2005 3:40 pm Post subject: |
|
|
Yeah, that's the format as far as I can tell. I use this snippet to convert 24bpp RGB to the format the PSP VRAM uses:
| Code: | unsigned short gfxRGB(unsigned char r,unsigned char g,unsigned char b)
{
return ((b&0xf8)<<7)+((g&0xf8)<<2)+((r&0xf8)>>3)+0x8000;
} |
I got the code from somewhere on this forum, and it's helped me to write a function for loading BMPs for game graphics from the mem card, which is nice. |
|
| Back to top |
|
 |
ReKleSS

Joined: 18 Jun 2005 Posts: 73 Location: Melbourne, Australia
|
Posted: Mon Jun 27, 2005 4:38 pm Post subject: |
|
|
| I've been using bbbbbgggggrrrrrx as the format. It seems to work. Not sure where I found it thought, so I can't confirm if it's correct. |
|
| Back to top |
|
 |
inomine
Joined: 05 May 2005 Posts: 53
|
Posted: Mon Jun 27, 2005 6:24 pm Post subject: Re: Pixel format for pgBitBlt call's byte array parameter |
|
|
| biermana wrote: |
Is is 32bpp rgb or 16bpp rgb or something else?
|
For a start it's BGR (Blue, Green, Red) rather than the standard sequence of RGB. Secondly the mode is changeable, nem's defauls to 16 bits, there is also appear to be other modes which might well be 32 bit, but I am not sure if anyone has posted the information. |
|
| Back to top |
|
 |
|