Re: AVI Format using VFW
Donovan Parks <donovan.parks@gmail.com> wrote in message...
VFW = Video for Windows. A widely used API for accessing data streams
(commonly AVI files).
My question is about a C++ API call for converting data in BGR, bottom
line first format (common for bitmaps in Windows) to the more standard
RGB, top line first format. Alternatively, does anyone have a fast way
to blt data in BGR format to the screen?
I would imagine this is a common problem since Windows bitmaps are
effectively reverse of what most API's expect.
Thanks.
PS: Is this form not open to all C++ programming related questions? If
not, I apology and will post somewhere else.
Standard C++. Outside libraries, APIs, platform specific, etc., are
off-topic here. Those are best answered in an NG specific to those things.
Like: I use a car to go to the doctor. Should I ask medical questions in an
automotive NG?
FAQ http://www.parashift.com/c++-faq-lite
Real ugly, but...
{ using std::cout // for NG post
unsigned int grgb( 0x00010203 ); // your GRGB
cout<<"grgb="<<std::hex<<std::setfill('0')<<std::setw(8)
<<grgb<<std::dec<<std::endl;
unsigned char *pRev( reinterpret_cast<unsigned char*>( &grgb ) );
std::swap( pRev[0], pRev[2] ); // GRGB to GBGR
cout<<"grgb="<<std::hex<<std::setfill('0')<<std::setw(8)
<<grgb<<std::dec<<std::endl;
}
/* -output- [win98se/iP4]
grgb=00010203
grgb=00030201
*/
I'll let you work out the 'endians' for your platform(s).
--
Bob R
POVrookie