JPEGDecGetImageInfo

Syntax

#include <cafe/jpeg.h>

JPEGStatus
JPEGDecGetImageInfo(
    JPEGImageDim *pDestDim,
    u32          *pDestHeapSize,
    const void   *pJpegBuf,
    u32           jpegBufSize,
    s32           resolution);

Parameters

pDestDim The address of the JPEGImageDim object used to store the width, height, and number of color channels for the surface image to be obtained when decoding the given JPEG data at the specified compressed resolution level.
pDestHeapSize The address at which to store the size of the temporary buffer required to decode the given JPEG data.
pJpegBuf The start address of the buffer used to store the JPEG binary to be decoded.
jpegBufSize The size of pJpegBuf.
resolution The resolution compression level. The following values can be specified: 1, 2, 4, or 8. Both the width and the height of the output image are set to 1/resolution of the input JPEG data. The JPEG_STATUS_ARGS error code is returned if the input value is invalid.

Return Values

JPEG_STATUS_OK Function completed successfully.
Any other value Abnormal exit.

Description

Calculates the image information (width, height, and number of color channels) of the surface image to be obtained when decoding the JPEG binary given by the pJpegBuf argument at the specified compressed resolution level. It also calculates the size of the temporary buffer required by the JPEGDecDecode function in a similar manner. The information of the surface image after decoding are stored in pDestDim, while the size of the temporary buffer required for decoding is stored in pDestHeapSize.

Given JPEG buffer pJpegBuf will not be modified.

Do Not Call From

Multiple threads This function is not thread-safe.

See Also

JPEGDecDecodeImage
JPEGImageDim
JPEGStatus

Revision History

2013/06/03 Changed argument order of API and Added notion about constant argument.
2013/05/08 Automated cleanup pass.
2013/02/19 Replaced words 'texture' with 'surface'.
2012/03/07 Initial version.


CONFIDENTIAL