AVI Format using VFW

D

Donovan Parks

Hello,

I am using VFW to extract image data from an AVI stream. Despite my
best efforts, I can't seem to get the data to come out in RGB format.
It always comes out in BGR format and mirrored along the horizontal.
Is it possible to get the data in a more "standard" format?

Failing this, is there an efficient way to convert this data to a
"standard" format? This must be a common problem since most API's
require data to be in RGB format.

Guess my real question here is, what is the standard way to handle
image data from an AVI stream. I need to blt the data to a window so I
need to change it to RGB.

Thanks,
Donovan
 
I

Ian Collins

Donovan said:
Hello,

I am using VFW to extract image data from an AVI stream.

What ever VFW is, it isn't topical here. You'll have more luck
somewhere where it is.
 
B

BobR

Ian Collins said:
What ever VFW is, it isn't topical here. You'll have more luck
somewhere where it is.

Veteran's of Foreign Wars.

Or, ms's Video For Windows.
( I can't get it to work on GNU!! <G>)
 
D

Donovan Parks

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.
 
J

Jack Klein

VFW = Video for Windows. A widely used API for accessing data streams
(commonly AVI files).

That's nice, but the Windows API is NOT defined by, supported by, or
part of the C++ language. It is a non-standard, third-party
extension, and is off-topic here, as are all such.
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?

No, your question is about an API library call, not about the C++
language. The C++ language does not even require a 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.

Questions about Windows API are appropriate in Windows programming
groups, is an excellent one,
or in compiler-specific support groups for your particular Windows
compiler.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
 
B

BobR

Donovan Parks said:
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top