jpeg conversion for dashboard software

For those of you who don’t know, displaying camera images on a laptop dashboard works by sending packets over a TCP connection which includes the latest image encoded as a jpeg.

I’m making a custom dashboard program, and I’m going to implement a video feed. I have the networking figured out, but the problem is the jpeg format of the incoming images. The rendering library I’m using for drawing the dashboard can display images based off of a jpeg file, but it would be a horrendous waste of resources to continually save the jpeg data from the packets to a file and read it back in. Alternatively, it can draw images straight from a memory buffer, but the image must be in a standard bitmap format (16-bit A1R5G5B5 or R5G6B5, 24-bit R8G8B8, etc.). I need a C or C++ library of some sort that can convert a jpeg data stored in a memory buffer to a bitmap format (I’d assume R8G8B8 would be the most common).

Does anybody have such a library? I’d really prefer not to create my own jpeg decoder, as I don’t really have the time to dedicate that much time to coding just a single aspect of our robot system.

I’m not sure what language or platform you are using, but two approaches you might try.

Try to use NIIMAQ.dll. This is how the LabVIEW, Java, and C/C++ code is doing it on the robot, and how LV is doing it on the dashboard. I can’t be certain, but I believe that the Windows host library probably has the entrypoint for decoding to a buffer that is easily called using C parameter conventions.

Second approach would be to download the JPEG consortium code. This is where most of the JPEG decoders come from anyway, and internally, it is definitely stream based and you can point the stream to a buffer rather than a file.

Greg McKaskle

Thanks. I’ll investigate those right away!

If you’re curious, I’m using Irrlicht, a graphics engine for C++. It’s multi-platform, but I’m doing the networking in Winsock, so I’m developing for Windows.