nn::jpeg::CTR::JpegMpEncoder::StartMpEncoderFirst Member Function#include <nn/jpeg.h>
size_t StartMpEncoderFirst(
u8 * dst,
size_t limit,
const void * src,
u32 width,
u32 height,
u32 quality,
PixelSampling dstPixelSampling,
PixelFormat srcPixelFormat,
bool addThumbnail,
u32 numImages = 2,
MpTypeCode typeCode = MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE,
bool addImageUidList = false,
bool addTotalFrames = false
);
| Name | Description | |
|---|---|---|
| out | dst | Specifies the buffer that stores the encoded result. Do not destroy this buffer until after encoding completes for the specified total number of images. (You can destroy the buffer if encoding has been cancelled.) |
| in | limit | Specifies the size of dst in bytes. Encoding fails if this size is exceeded. If the StartMpEncoderNext function fails before the specified total number of images are done encoding, it might be because this byte size is insufficient. |
| 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. |
| in | numImages | Specifies the total number of images included in one MPO. If the MP type (given by the argument typeCode) is a stereoscopic image, this must be set to at least 2.For Baseline MP primary images, this must be set to no more than 3.The default value is 2. |
| in | typeCode | Specifies the MP type. Refer to Description for specifiable values. The default is MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE (stereoscopic image). |
| in | addImageUidList | Specifies whether to append an unique ID list for individual images. Specify true to append it, or false to not append it. The value(s) that are appended are the unique image IDs specified by the SetImageUid function immediately preceding the call to this function or the StartMpEncoderNext function.The value is NULL (all bytes cleared to 0) if SetImageUid has not been called or if the image is the starting image.The default value is false. |
| in | addTotalFrames | Specifies whether to append the total number of frames taken. Specify true to append it, or false to not append it. When the MP type (the value of the typeCode argument) is MP_TYPE_CODE_BASELINE_MP_PRIMARY_IMAGE, this specification is ignored and the total number of frames taken is not appended.The value to append is usually the total number of images, but if 0 was specified as the individual image number in the call to SetMpIndividualNum immediately preceding the call to this function or the StartMpEncoderNext function, then that image is not counted.Starting from the second image, images of MP type MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_1 or MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_2 (images for monitor display) are not counted either.The default value is false. |
0 on failure. Use the GetLastError function to get the reason for failure. JPEG-encodes an image and stores it as the starting image in MP format.
This function specifies the total number of images included in one set of MP-format data (a multi-picture object or "MPO") and encodes the starting image. Call the StartMpEncoderNext function to encode the second image and all subsequent images up to the total.
Depending on the encoding results of the successive calls to StartMpEncoderNext, the APP2 for the starting image encoded by this function (including the MP Index IFD, MP entries, and MP Attribute IFD) might be overwritten. If the encoding function fails before encoding is complete for the specified total number of images, or if encoding is cancelled, encoding must be redone from the starting image.
Unlike the StartMpEncoderLR function, when using this function you can register various types of data to each individual image by calling SetUserMakerNote, SetMpTypeFlags, SetDateTime or other functions. To register such data to the second or subsequent images, you must call those functions before calling the StartMpEncoderNext function.
The SetThumbnailSize and SetInputBufferWidth function arguments can also be specified separately for each image. To specify these values for the second or subsequent images, you must call those functions before calling the StartMpEncoderNext function.
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). The same is true of the StartJpegEncoder function.
Specify MP_TYPE_CODE_BASELINE_MP_PRIMARY_IMAGE (Baseline MP primary image) to use the Baseline MP primary image format. Specify any other value to use the Extended MP format.
MP Attribute IFDs are not stored in the Baseline MP format, so the following functions have no effect.
CONFIDENTIAL