Imaging library to display yuv data in C++ and Qt - c++

I was wondering is there any C++ imaging libraries so that I can take a yuv file and display it, I will be able to pass the resolution of the file and Ycbcr info(usually at 4:2:2) I need this to turn the yuv into jpegs if possible or to display it in rgb mode to be built on a QPixmap. If anyone could point me in the right direction I'd be most grateful.

I just looked around, did you tried the following ?
http://code.google.com/p/yuvtoolkit
http://code.google.com/p/yuvplayer

Related

Draw dicom raw data in qt

I'm trying to develop a tool to visualize dicom images
I'm using itk library but i have some problem drawing the data
I'm using gdcm library provided by itk library as a third party lib.
I'm reading the image correctly i retrieved the tags ... but when i retrieve the pixels data using
unsigned short buffer* = ImageFileReader<Image<unsigned short,2>>->GetOutput()->getBufferPointer();
and i put it in QPixmap or QImage i tried both,Qpixelmap when i do loadData i get false as a return value and using QImage, the app crashes !
Any help ? thank you
Look at this example, http://gdcm.sourceforge.net/html/ConvertToQImage_8cxx-example.html
Just use gdcm to read the image and convert it to qimage.
Keep in mind that dicom images are not an image format that qt can draw, you need a conversion step.

Problems rendering an image in gtk

I'm programming an application in c++ with a GUI in GTK3 that will show the images obtained from a genicam camera. I've got the official API of the camera that deals with it and extract returns an unsigned char* to the buffer where the image is contained.
The problem comes when I try to convert the image to a GTK format to render it in the GUI. I've tried with cairo and pixbuf, but I've problems in both of them, as the image is in MONO8 format, and pixbuf only deals with RGB. Cairo can deal with 8bit images, but only if they have an alpha channel, which is not the case.
Does someone know a way to approach this issue?
Thanks in advance

Importing and looping through a PNG image to check for transparency

I would like to write CPP code that is able to take in a PNG file, scan through its pixels and identify where the transparent pixels are.
I tried doing this with CIMG, but it didn't work out as CIMG only supports the RGB channels. Even after installing image magick, the 4th channel is not giving me the right values.
Anyone can suggest a library I could use?

reading indexed palette image in C++

My platform is Windows. I didn't expect reading indexed palette image to be this difficult in C++. In case you are not familiar with it, it's single channel image but expresses its pixel color with 256 indexed colors called palette.
I was using OpenCV but its imread just converts the file to a 3 channel image so I have no way to save it back to indexed palette image or compare it with another indexed palette image.
I tried to use Bitmap but for some reason, it does not read correct pixel values.
So right now, I am looking for a light library or code to read pixels from indexed palette file.
Using OpenCV to read or write a image from real cameras will lose and change the image information, so I prefer to use gdi+, which is more powerful in dealing with image format problems to solve your problem.
As comments on the question shows, I decided to have two methods, OpenCV for non-indexed-palette images and Bitmap (GDI+) for indexed palette images. Now everything is working perfect.

How can I draw a png ontop of another png?

How can I "draw"\"merge" a png top of another png (background) using libpng, while keeping the alpha section of the png being drawn on top of the backhround png. There does not seem to be any tutorials or anything mentioned in the documentation about it.
libpng is a library for loading images stored in the PNG file format. It is not a library for blitting images, compositing images, or anything of that nature. libpng's basic job is to take a file or memory image and turn it into an array of color values. What you're talking about is very much out of scope for libpng.
If you want to do this, you will have to do the image composition yourself manually. Or use a library that can do image composition (cairo, etc).