[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to make BITMAPINFO from YUV 4:2:0

Posted on 2000-05-14
10
Medium Priority
?
400 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
Independent Software Vendors: 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

Industry Leaders: 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!

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

650 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