conveting jpeg in memory buffer to bitmap

Hi all. I’m in a robotics program (FIRST Robotics) and my team’s robot has a webcam attached to it. Using the API provided by the FIRST organization that runs this world-wide competitive program, the robot sends packets over a TCP connection to a particular port on a laptop in the same network which includes the latest image from the webcam encoded as a jpeg. This is displayed by dashboard software (also provided by FIRST) on the laptop so that the drivers of the laptop can have a live video feed.

The thing is, I don’t like the FIRST dashboard for several reasons. 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.
Hello slavik262,

When working with webcams a very good library is The Open Computer Vision Library (OPENCV). If you have already coded a lot of good stuff, and really don’t want try that library, you can go for some specific JPEG libraries such as OpenJPEG.
If you will end up using other image formats, and having to play a little with the images, I encourage you to try some image-processing library as Magick++.

Hope I have been of any help.
Topic archived. No new replies allowed.