nn::jpeg::CTR::JpegMpEncoder::StartMpEncoderNext Member Function#include <nn/jpeg.h>
size_t StartMpEncoderNext(
const void * src,
u32 width,
u32 height,
u32 quality,
PixelSampling dstPixelSampling,
PixelFormat srcPixelFormat,
bool addThumbnail,
MpTypeCode typeCode = MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE,
bool omitPixelDimensions = false
);
| Name | Description | |
|---|---|---|
| in | src | Specifies the buffer of image data to encode. Must be 4-byte aligned. |
| in | width | Specifies the image width in pixels. (Up to 65536) |
| in | height | Specifies the image height in pixels. (Up to 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 | typeCode | Specifies the MP type. Can take any of the following values: MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE (stereoscopic image) MP_TYPE_CODE_MULTI_VIEW_PANORAMA_IMAGE (panorama image) MP_TYPE_CODE_MULTI_VIEW_MULTI_ANGLE_IMAGE (multi-angle image) MP_TYPE_CODE_UNDEFINED (undefined type) MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_1 or MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_2 (image for display on monitor) Except in the case of images for monitor display, the type specified here must be the same as the MP type at the starting the image. The default is MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE (stereoscopic image). |
| in | omitPixelDimensions | When the MP type (the value of the typeCode argument) is MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_1 or MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_2 (image for monitor display), you must specify whether to omit recording the effective image size (PixelXDimension, PixelYDimension) to APP1.This specification is ignored for other MP types, since the size must be recorded. Specify true to omit recording, or false to record. The default value is FALSE. |
0 on failure. Use the GetLastError function to get the reason for failure. JPEG-encodes an image and appends it to the encoded results from the immediately previous call to either StartMpEncoderFirst or this function.
If that previous operation failed, this function also fails. (Encoding must be redone from the starting image.)
If the total number of images specified in the StartMpEncoderFirst function is greater than 1, to complete the multi-picture object (MPO) this function must be called (total number of images - 1) number of times. Calling more than the required number of times will result in failure. If the function fails before encoding is complete or if encoding is cancelled, there is no further need to call this function.
Initializing the encoder object partway through encoding will prevent subsequent encoding results from being appended, so do not call the Initialize function before calling this function.
This function's encoding results are appended to the encoding results for the immediately previous image, within the limits of the buffer and byte size specified in the StartMpEncoderFirst function. The data is padded so that the byte offset from the start of the buffer to the location where data is appended is a multiple of 2. Consequently, there is sometimes 1 byte of zeros inserted between the EOI marker of the previous individual image and the SOI marker for this individual image. No padding is added after appending.
Any data registered using SetUserMakerNote, SetMpTypeFlags, SetDateTime or other functions, and any values specified in the SetThumbnailSize or SetInputBufferWidth functions are cleared after this function completes, regardless of whether this function succeeded or failed. When encoding multiple times, you must call these functions before encoding each image.
When the starting image MP type is MP_TYPE_CODE_BASELINE_MP_PRIMARY_IMAGE, the baseline MP format is used so the MP attribute IFD is not stored. Just as with StartMpEncoderFirst, calling functions to record the MP attribute IFD has no effect.
When the MP type is MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_1 or MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_2 (images for monitor display), only the following tags are recorded to APP1. You cannot use the GetMpRegionsToBuildJpegData function to rebuild JPEG data, therefore, right after encoding images for monitor display. From IFD0: Exif IFD Pointer, MakerNote in the Exif Private Tag (when MakerNote is registered), PixelXDimension(*), PixelYDimension(*), ImageUniqueID (when unique image ID is registered). From IFD1: JPEGInterchangeFormat (when adding thumbnail), and JPEGInterchangeFormatLength (when adding thumbnail). (*) The MP format standard recommends that these tags not be recorded if the images are the same as the original monitor images. The application must check whether the size of the images for encoding (the width and height arguments) are the same as the original monitor images. These are not recorded if the omitPixelDimensions argument is set to TRUE.
CONFIDENTIAL