January 22nd, 2013, 10:51 AM
Display an image in c
I'm new to image processing in C. I want to open and display an image (bmp and yuv format) using C/C++ without using any additional graphics libraries. I read somewhere that pointers can be used for this purpose but i didn't find any code. Can someone give a sample code and source?
January 22nd, 2013, 11:10 AM
January 22nd, 2013, 12:33 PM
> I read somewhere that pointers can be used for this purpose
The days when you could just point directly at video memory, write some bytes and see pixels on the screen are long gone.
> I want to open and display an image (bmp and yuv format) using C/C++ without using any additional graphics libraries
Whether you use a graphics library, or use the API of the OS, you're still going to be dependent on external code to see an image on screen.
Which compiler are you using? If your answer is "TurboC", then the first thing we're going to say is upgrade!
January 22nd, 2013, 06:37 PM
Any non-trivial C code is likly to use pointers - they ar e fundamental. Saying that you can use pointers to display images is about as useful as saying you can use bricks to build a house.
Wat do you mean by "without using any additional libraries"? Additional to what? The standard library has no support for graphics and modern operating systems necessarily control the graphical display through device drivers through which you must access the display, if only so you app plays nicely with others. So you will need at least access the display through OS libraries of some sort - for cross-platform support using a third-party library is beneficial. The "no libraries" constraint is pointless and counter productive. At some level at least you probably have no real alternative.
Once you have decided how to access the screen, assuming you are not at least going to use a library that already supports your chosen image format, you will need to at least understand that format. For that http://www.wotsit.org/ is your friend.