StartJpegDecoder

nn::jpeg::CTR::JpegMpDecoder::StartJpegDecoder Member Function

Syntax

#include <nn/jpeg.h>

size_t StartJpegDecoder(
     void * dst,
     size_t dstSize,
     const u8 * src,
     size_t srcSize,
     u32 maxWidth,
     u32 maxHeight,
     PixelFormat dstPixelFormat,
     bool decodeThumbnail
);

Parameters

Name Description
out dst Specifies the buffer that stores the decoded result.
Must be 4-byte aligned.
Must be 128-byte aligned if you are accessing the output buffer directly as a GPU texture. (No check is made when using this function.)
in dstSize Specifies the size of dst in bytes.
Specify the return value of GetDstBufferSize.
in src Specifies the JPEG data to decode.
in srcSize Specifies the size of src in bytes.
in maxWidth Specifies the maximum width (in pixels) of an image that can be decoded (equal to or less than 65536). After decoding successfully completes, use the GetLastWidth function to get the actual image width and the GetLastOutputBufferWidth function to get the buffer width.
in maxHeight Specifies the maximum height (in pixels) of an image that can be decoded (equal to or less than 65536). After decoding successfully completes, use the GetLastHeight function to get the actual image height and the GetLastOutputBufferHeight function to get the buffer height.
in dstPixelFormat Specifies the output pixel format.
in decodeThumbnail Specify true to decode the thumbnail.
Specify false to decode the primary image.

Return Values

On success, returns the size (in bytes) of the buffer storing the decoded result.
Returns 0 on failure.
Use the GetLastError function to get the reason for failure.

Description

Runs the JPEG decoder.

Processing takes longer if the image size is not a multiple of 8 or 16 pixels.
Depending on the pixel sampling format, images that meet certain conditions can be decoded faster.

If JPEG_DECODER_OPTION_MATCH_WIDTH_HEIGHT is specified using SetOption, the values of arguments maxWidth and maxHeight must match, otherwise decoding will fail.

Revision History

2010/10/21
Added a description of SetOption.
2010/04/14
Initial version.

CONFIDENTIAL