forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pixel format for pgBitBlt call's byte array parameter

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
biermana



Joined: 27 Jun 2005
Posts: 12

PostPosted: Mon Jun 27, 2005 3:28 pm    Post subject: Pixel format for pgBitBlt call's byte array parameter Reply with quote

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
View user's profile Send private message
maddogjt1



Joined: 27 Jun 2005
Posts: 13

PostPosted: Mon Jun 27, 2005 3:36 pm    Post subject: Reply with quote

I believe that it is 16 bpp BGR format XBBBBBGGGGGRRRRR but don't hold me to it.
Back to top
View user's profile Send private message
KprOfTime



Joined: 27 Jun 2005
Posts: 3

PostPosted: Mon Jun 27, 2005 3:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
ReKleSS



Joined: 18 Jun 2005
Posts: 73
Location: Melbourne, Australia

PostPosted: Mon Jun 27, 2005 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
inomine



Joined: 05 May 2005
Posts: 53

PostPosted: Mon Jun 27, 2005 6:24 pm    Post subject: Re: Pixel format for pgBitBlt call's byte array parameter Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group