Hi there,
I'm decoding JPEG image with IJL_411 sampling format, my ijlRead() fails. The code is like:
jprops.JPGBytes = const_cast(Begin); //encoded MJPEG data buffer
jprops.JPGSizeBytes = len; // the length of encoded MJPEG data buffer
// Read the properties first to find out the color space of the JPEG.
if (ijlRead(&jprops, IJL_JBUFF_READPARAMS) != IJL_OK)
return false;
// Fail if the frame size changed.
if (jprops.JPGWidth!=m_width || jprops.JPGHeight!=m_height)
return false;
jprops.DIBWidth = m_width;
jprops.DIBHeight = m_height;
m_rgbbuffer.resize(m_width * m_height * 3);
jprops.DIBColor = IJL_BGR;
jprops.DIBChannels = 3;
jprops.DIBPadBytes = IJL_DIB_PAD_BYTES( jprops.DIBWidth, jprops.DIBChannels );
int size = (jprops.DIBWidth * jprops.DIBChannels + jprops.DIBPadBytes) * jprops.DIBHeight;
BYTE *data = new BYTE[ size ];
memset( data, 0, size );
jprops.DIBBytes = data;
if (ijlRead(&jprops, IJL_JBUFF_READWHOLEIMAGE) != IJL_OK)
return false; //fails here.
What I did wrong? Thanks for any help.
-cath