nn::jpeg::CTR::JpegMpEncoder::SetInputBufferWidth Member Function

Syntax

#include <nn/jpeg.h>

void SetInputBufferWidth(
     u32 width
);

Arguments

Name Description
in width Specifies the width (in pixels) of the input image buffer.
Specify 0 to give priority to the value specified in the encoding function over this value.
Any value specified in excess of MAX_ENCODER_INPUT_BUFFER_WIDTH (65536) is ignored.

Return Values

None.

Description

Sets the width of the input image buffer.

Use this function when the image buffer (for example, the GPU texture buffer) has a larger image width than the image you want to encode.

If you specify the image width of the input image buffer, the encoding function processes the input buffer starting from the left and discards any area beyond the specified width. When creating a thumbnail to add, the scaling-down operation is likewise carried out after cropping in this way.

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

If the image width specified by the encoding function is larger than the value specified in this function, the encoding function value takes priority.

The width argument has the following restrictions depending on the input pixel format specified in the encoding function. (When encoding, round down to these respective multiples.)
Must be a multiple of 2 when the format is PIXEL_FORMAT_YUYV8. Must be a multiple of 8 for the formats PIXEL_FORMAT_CTR_RGB565_BLOCK8, PIXEL_FORMAT_CTR_RGB8_BLOCK8 or PIXEL_FORMAT_CTR_RGBA8_BLOCK8.

Revision History

2010/06/14
Initial version.

CONFIDENTIAL