nn::jpeg::CTR::JpegMpEncoder::StartJpegEncoder Member Function#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
);
| 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. |
0 on failure.GetLastError function to get the reason for failure. 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).
PIXEL_SAMPLING_YUV444 is specified, the width and height of the image must both be multiples of 8.PIXEL_SAMPLING_YUV420 is specified, the width and height of the image must both be multiples of 16.PIXEL_SAMPLING_YUV422 is specified, the height must be a multiple of 8 and the width a multiple of 16. CONFIDENTIAL