nn::jpeg::CTR::JpegMpDecoder::StartJpegDecoder Member Function#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
);
| 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. |
0 on failure.GetLastError function to get the reason for failure. 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.
PIXEL_SAMPLING_YUV444, the width and height of the image must both be multiples of 8.PIXEL_SAMPLING_YUV420, the width and height of the image must both be multiples of 16.PIXEL_SAMPLING_YUV422, the height must be a multiple of 8, and the width must be a multiple of 16.If JPEG_DECODER_OPTION_MATCH_WIDTH_HEIGHT is specified using SetOption, the values of arguments maxWidth and maxHeight must match, otherwise decoding will fail.
SetOption.CONFIDENTIAL