?
Solved

How to make BITMAPINFO from YUV 4:2:0

Posted on 2000-05-14
10
Medium Priority
?
393 Views
Last Modified: 2012-06-21
Dear All,

 If i have a YUV 4:2:0 raw data file, how can i convert it into BITMAPINFO data? Any example or simple codes?

Thank you very much

LittleBoy
0
Comment
Question by:littleboy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 2808213
All I can tell you is that it isn't simple at all. I probably have the code somewhere in the library but since it is tightly linked with my own source I cannot show it to you. But simple it is not.
0
 

Author Comment

by:littleboy
ID: 2808338
Dear CJ S

 Thanks for your comment, however, can you tell me more hint, for example, it is better to convert the RGB raw data to BITMAPINFO or convert the YUV raw data to BITMAPINFO??
 So, as you said, it is not simple, but what is the difficult part? Writing the headers? or what?

Thanks a lot.

Littleboy
0
 

Author Comment

by:littleboy
ID: 2808383
Dear CJ S

 Thanks for your comment, however, can you tell me more hint, for example, it is better to convert the RGB raw data to BITMAPINFO or convert the YUV raw data to BITMAPINFO??
 So, as you said, it is not simple, but what is the difficult part? Writing the headers? or what?

Thanks a lot.

Littleboy
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Accepted Solution

by:
CJ_S earned 540 total points
ID: 2808516
Well,
I have written a few image transformation thingies. And am currently doing the JFIF JPEG.

Depending on how your YUV Raw image is set up you can decide what way to choose. The easiest way to convert raw data is to RGB values (unsigned char r, g , b). These values can then be put in like a DIB-section which is also a BITMAPINFO.

Of course you have to find yourself the way the image is set up. First you'll find the header.....but how long will it be? A BITMAPINFOHEADER will always be 42 (if i recall right), and other images will (most of the times) have a speciall marker (like the JPEG 0xFF). With right after the marker a Length attribute of how long that header is.

It just totally depends how the image is set up....try to find that out, and read the image information. Then transform those values to readable RGB for your program.

Good luck,
CJ
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2808568
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2826565
littleboy???
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2826600
yes??????

oh, damn you mean the other guy

HAHAHAHA.....sorry
0
 

Expert Comment

by:mj@f544695
ID: 2827742
If you just need code to do this,
try ImageMagick at http://www.imagemagick.org.

--Mark Johnson
0
 

Author Comment

by:littleboy
ID: 2827993
Dear All,
 
 Thanks all, however, the intel page contains the MMX method of converting YUV to RGB only, in fact, what I need most is to convert RGB into BITMAPINFO. However, by the help of CS_J, I gain some ideas on how to do that.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2828413
Thank you, if you need more specific help about a few things you can email me at
cj@infolder.com
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question