[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to make BITMAPINFO from YUV 4:2:0

Posted on 2000-05-14
10
Medium Priority
?
403 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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

830 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