nn::jpeg::CTR::JpegMpDecoder::SetOutputBufferWidth Member Function

Syntax

#include <nn/jpeg.h>
void SetOutputBufferWidth(
     u32 width
);

Arguments

Name Description
in width Specifies the width (in pixels) of the output image buffer.
Specify 0 to have the decoding function automatically set the width according to the image size.
Any value specified in excess of MAX_DECODER_OUTPUT_BUFFER_WIDTH (65536) is ignored.

Return Values

None.

Description

Sets the width of the output image buffer.

Use this function when the image buffer to which the decoded results are output (for example the GPU texture buffer) has a larger image width than the image you want to decode.

If you specify the image width of the output image buffer, the decoding function (StartJpegDecoder, StartJpegDecoderShrink, or StartMpDecoderLR) outputs from the output buffer starting from the left. The whitespace portion of buffer content that is not output is not changed.

Call this function before calling the decoding function. The value specified by this function is cleared after the decoding function completes, regardless of whether the decoding function succeeded or failed. When decoding multiple times, you must call this function before each decoding function call. The value specified by this function is also cleared if you specify 0 for the width argument, or if you reinitialize the decoder object using the Initialize function.

If the image width specified by this function is smaller than the width required to output the decoded results, the decoding function will round up the width of the output image buffer. (Decoding fails if the results of rounding up exceed the number of bytes for the output image buffer as specified in the decoding function.)

If the pixel format specified by the decoding function (PixelFormat) is PIXEL_FORMAT_CTR_RGB565_BLOCK8, PIXEL_FORMAT_CTR_RGB8_BLOCK8, or PIXEL_FORMAT_CTR_RGBA8_BLOCK8, incorrect operations will result unless the argument width is a multiple of 8 (or rounded down to a multiple of 8).
When the format is PIXEL_FORMAT_YUYV8, the width argument must be a multiple of 2 (or rounded down to the nearest multiple of 2) for correct behavior.

Revision History

2010/06/14
Initial version.

CONFIDENTIAL