TMCCJPEGEncEncode

Syntax

#include <revolution/tmcc_jpeg.h>

s32 TMCCJPEGEncEncode(
        void *pWorkArea,
        void *pTex,
        u16 srcWidth,
        u16 srcHeight,
        GXTexFmt texFormat,
        u32 QFactor,
        void *pJpegBuffer,
        u32 jpegBufferSize,
        u32 *poutputSize
);

Arguments

*pWorkArea Configure the starting address of the work area.
*pTex Configure the starting address of the input texture data.
srcWidth Specify the effective image width of the input texture.
(When the texture size does not match the effective image region, fill the remaining parts with dummy data. A TMCC_JPEG_OPT_ERR error code is returned for input that exceeds the range of 1 to 65,535.)
srcHeight Specify the effective image height of the input texture.
(When the texture size does not match the effective image region, fill the remaining parts with dummy data. A TMCC_JPEG_OPT_ERR error code is returned for input that exceeds the range of 1 to 65,535.)
texFormat Specify the texture format.
(A TMCC_JPEG_TEXT_ERR error code is returned for input that is neither GX_TF_RGB565 nor GX_TF_RGBA8.)
QFactor Specify the quality factor.
(A TMCC_JPEG_OPT_ERR error code is returned for input that exceeds the range of 1 to 500.)
*pJpegBuffer Specify the starting address of the work memory for the output JPEG data.
jpegBufferSize Specify the size of the work memory for the output JPEG data.
(If it appears that the JPEG output size will exceed this size, a TMCC_JPEG_ENC_BUF_OVER error code is returned. Allocate and configure a work memory size of at least TMCC_JPEG_JPEGBUFFER_MINIMAM_SIZE bytes.)
*poutputSize Size of the JPEG output data.

Return Values

0 Function completed successfully.
Negative Abnormal exit (error code).

Description

Takes texture image data as input, JPEG-encodes it, and outputs compressed data.

See Also

Error Codes

Revision History

2009/10/19 Made changes to the description of the include file in line with integration into the Revolution SDK.
2008/03/11 Changed the type for the srcWidth and srcHeight arguments.
2007/02/02 Initial version.


CONFIDENTIAL