StartJpegEncoder

nn::jpeg::CTR::JpegMpEncoder::StartJpegEncoder Member Function

Syntax

#include <nn/jpeg.h>

size_t StartJpegEncoder(
     u8 * dst,
     size_t limit,
     const void * src,
     u32 width,
     u32 height,
     u32 quality,
     PixelSampling dstPixelSampling,
     PixelFormat srcPixelFormat,
     bool addThumbnail
);

Parameters

Name Description
out dst Specifies the buffer that stores the encoded result.
in limit Specifies the size of dst in bytes. Encoding fails if this size is exceeded.
in src Specifies the buffer of image data to encode. Must be 4-byte aligned.
in width Specifies the image width in pixels (equal to or less than 65536).
in height Specifies the image height in pixels (equal to or less than 65536).
in quality Specifies the encoding quality.
Values can be set from 1-100, 100 being the highest quality and the largest size.
in dstPixelSampling Specifies the image's output format (its pixel sampling).
in srcPixelFormat Specifies the input pixel format of the image to encode.
in addThumbnail Specifies whether to add a thumbnail.

Return Values

If successful, returns the number of bytes of JPEG-format data that were generated. Returns 0 on failure.
Use the GetLastError function to get the reason for failure.

Description

Runs the JPEG encoder.

The widths and heights of images that this function can encode depend on the output format of the image (in other words, the dstPixelSampling argument).

Revision History

2010/04/14
Initial version.

CONFIDENTIAL