Hi image manipulation experts,
ofImage
has the option of writing to an ofBuffer
using saveImage()
. I’m doing this so that I can prepare a compressed image to send over UDP:
cameraImage.saveImage(cameraSendBuffer, OF_IMAGE_QUALITY_HIGH);
I know that there is data in cameraImage
because I’m drawing it to screen. However, I’ve no idea what to expect to find in cameraSendBuffer
or how to query the data. I don’t know how much data has been written and I’m not sure whether it has been written as a jpeg or another compression format.
I need a char *
and a length
value so that I can send the compressed data. I also need to know if this is indeed jpeg format, so that I can pick it up at the other end. Can anyone help work this out?
Additional notes:
I’ve seen some solutions using FreeImage but they’re pretty confusing.
I’ve tried allocating the buffer with some space. It is not clear whether or not this is necessary. Doesn’t seem to help. If I don’t allocate then I get a size of zero after the operation. If I do allocate I get the allocated size after the operation.