StartMpDecoderLR

nn::jpeg::CTR::JpegMpDecoder::StartMpDecoderLR Member Function

Syntax

#include <nn/jpeg.h>

size_t StartMpDecoderLR(
     void * dstL,
     void * dstR,
     size_t dstSize,
     const u8 * src,
     size_t srcSize,
     u32 maxWidth,
     u32 maxHeight,
     PixelFormat dstPixelFormat
);

Parameters

Name Description
out dstL Specifies the buffer for storing the decoded result of the starting image.
The alignment of this buffer must match the output pixel format specified by the dstPixelFormat argument.
out dstR Specifies the buffer for storing the decoded result of the next individual image.
The alignment of this buffer must match the output pixel format specified by the dstPixelFormat argument.
in dstSize Specifies the size of dstL and dstR in bytes.
This value indicates the size of a single image, not the total size of the two images.
Specify the return value of GetDstBufferSize.
in src Specifies the MP-format 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, you can use the GetLastWidth function to get the actual image width and the GetLastOutputBufferWidth function to get the buffer width (for one image).
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, you can use the GetLastHeight function to get the actual image height and the GetLastOutputBufferHeight function to get the buffer height (for one image).
in dstPixelFormat Specifies the output pixel format.

Return Values

On success, returns the size (in bytes) of the buffer storing the decoded result.
This value indicates the size of a single image, not the total size of the two images.
Returns 0 on failure.
Use the GetLastError function to get the reason for failure.

Description

Runs the JPEG decoder on a pair of images stored in MP format.

Much as for the StartJpegDecoder function, processing takes longer if the image size is not a multiple of 8 or 16 pixels. The same is true of the alignment of the dst argument.

The MP type (MpTypeCode) of the image data stored in MP format is looked up in MP entry storage order, and only two stereoscopic images are decoded. The lookup does not check if the first stereoscopic image found is for the left eye, however, nor if the next image is for the right eye.

This function requires that both primary images are the same size. After this function completes successfully, call the GetLastWidth and GetLastHeight functions to get the primary image's dimensions. If the sizes do not match, decoding fails. The function also fails if fewer than 2 primary images could be decoded. Thumbnails are not decoded.

If JPEG_DECODER_OPTION_MATCH_WIDTH_HEIGHT is specified using SetOption, the values of arguments maxWidth and maxHeight must match, otherwise decoding will fail. Even if this option is not specified, the size of the two primary images must match as mentioned above.

After successful decoding, this function decodes the EXIF information for two stereoscopic images in the order that the MP entries are stored.
When the following functions are used to obtain EXIF information, what they obtain is the EXIF information for the last image decoded (stored as the second MP entry).

The following functions also work without causing problems, but we do not recommend using them.

To get the EXIF information for each image, decode each individually without using this function, or use the ExtractExif function.

Revision History

2011/03/03
Added GetLastDateTimePointer to the list of functions that retrieve Exif data.
2010/10/21
Added a description of SetOption.
2010/04/14
Initial version.

CONFIDENTIAL