#include <cafe/jpeg.h> JPEGStatus JPEGEncEncodeSurface( void *pDestBuf, u32 destBufSize, u32 *pActualDestSize, const u32 *pTexBuf, const JPEGImageDim *pTexDim, s32 quality, void *pWorkArea, u32 workAreaSize);
|pDestBuf||The start address of the buffer used to store the JPEG binary to be encoded. Be sure to specify a large enough buffer if you do not know the size of the JPEG data to be encoded.|
|destBufSize||The size of pDestBuf.|
|pActualDestSize||The size of the JPEG binary to be encoded.|
The start address of the buffer used to store the surface image to be encoded. The format of the surface image must conform to the
The address of the
The compressed image quality in the range from
|pWorkArea||The start address of the temporary buffer used to decode JPEG binary.|
|workAreaSize||The size of pWorkArea.|
||Function completed successfully.|
|Any other value||Abnormal exit.|
Encodes the surface image accepted as input and outputs the corresponding JPEG binary.
When encoding surface image brought from GX2 rendering system, the surface must be tiled with
and have no padding and no swizzling. In a case where surface image to be encoded is configured with different specifications, the surface must be converted to fit above constraints of JPEG encoder
GX2CopySurface by specifying
GX2Surface. As this API converts tilling mode
GX2_TILE_MODE_LINEAR_SPECIAL using CPU, not GPU, this conversion should be slower than one to other tilling mode. It is given that the surface
buffer pTexBuf and its dimension pTexDim will not be modified.
For more information, refer to the
GX2Surface related pages listed in the See Also section of this topic.
|Multiple threads||This function is not thread-safe.|
2013/06/03 Changed argument order of API and Added notion about constant arguments.
2013/05/08 Automated cleanup pass.
2013/05/06 Link GX2 related references in the See Also section.
2013/02/19 Replaced words 'texture' with 'surface'. Appended description for use with GX2.
2011/08/08 Initial version.