1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" />
7<title>StartMpEncoderFirst</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/jpeg/Overview.html">jpeg</a>::<a href="../../../../nn/jpeg/CTR/Overview.html">CTR</a>::<a href="../../../../nn/jpeg/CTR/JpegMpEncoder/Overview.html">JpegMpEncoder</a>::StartMpEncoderFirst</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/jpeg.h&gt;
14
15size_t StartMpEncoderFirst(
16     <a href="../../../../nn_types/u8.html">u8</a> * dst,
17     size_t limit,
18     const void * src,
19     <a href="../../../../nn_types/u32.html">u32</a> width,
20     <a href="../../../../nn_types/u32.html">u32</a> height,
21     <a href="../../../../nn_types/u32.html">u32</a> quality,
22     <a href="../../../../nn/jpeg/CTR/PixelSampling.html">PixelSampling</a> dstPixelSampling,
23     <a href="../../../../nn/jpeg/CTR/PixelFormat.html">PixelFormat</a> srcPixelFormat,
24     bool addThumbnail,
25     <a href="../../../../nn_types/u32.html">u32</a> numImages = 2,
26     <a href="../../../../nn/jpeg/CTR/MpTypeCode.html">MpTypeCode</a> typeCode = MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE,
27     bool addImageUidList = false,
28     bool addTotalFrames = false
29);
30</pre>
31    </div>
32<h2>Parameters</h2>
33    <div class="section">
34      <table class="arguments">
35        <thead>
36          <tr>
37            <td width="15" />
38<th>Name</th>
39<td>Description</td>
40          </tr>
41        </thead>
42        <tr>
43<td>out</td>
44<th>dst</th>
45<td>Specifies the buffer that stores the encoded result.<br />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.)</td>
46        </tr>
47        <tr>
48<td>in</td>
49<th>limit</th>
50<td>Specifies the size of <SPAN class="argument">dst</SPAN> in bytes. Encoding fails if this size is exceeded.<br />If the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderNext.html">StartMpEncoderNext</a></CODE> function fails before the specified total number of images are done encoding, it might be because this byte size is insufficient.</td>
51        </tr>
52        <tr>
53<td>in</td>
54<th>src</th>
55<td>Specifies the buffer of image data to encode. Must be 4-byte aligned.</td>
56        </tr>
57        <tr>
58<td>in</td>
59<th>width</th>
60<td>Specifies the image width in pixels (equal to or less than 65536).</td>
61        </tr>
62        <tr>
63<td>in</td>
64<th>height</th>
65<td>Specifies the image height in pixels (equal to or less than 65536).</td>
66        </tr>
67        <tr>
68<td>in</td>
69<th>quality</th>
70<td>Specifies the encoding quality.<br />Values can be set from 1-100, 100 being the highest quality and the largest size.</td>
71        </tr>
72        <tr>
73<td>in</td>
74<th>dstPixelSampling</th>
75<td>Specifies the image's output format (its pixel sampling).</td>
76        </tr>
77        <tr>
78<td>in</td>
79<th>srcPixelFormat</th>
80<td>Specifies the input pixel format of the image to encode.</td>
81        </tr>
82        <tr>
83<td>in</td>
84<th>addThumbnail</th>
85<td>Specifies whether to add a thumbnail.</td>
86        </tr>
87        <tr>
88<td>in</td>
89<th>numImages</th>
90<td>Specifies the total number of images included in one MPO.<br />If the MP type (given by the typeCode argument) is a stereoscopic image, this must be set to at least <CODE>2</CODE>.<br />For Baseline MP primary images, this must be set to no more than <CODE>3</CODE>.<br />The default value is <CODE>2</CODE>.</td>
91        </tr>
92        <tr>
93<td>in</td>
94<th>typeCode</th>
95<td>Specifies the MP type. Refer to Description for specifiable values. The default is <CODE>MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE</CODE> (stereoscopic image).</td>
96        </tr>
97        <tr>
98<td>in</td>
99<th>addImageUidList</th>
100<td>Specifies whether to append a unique ID list for individual images.<br />Specify <CODE>true</CODE> to append it, or <CODE>false</CODE> to not append it. The value(s) that are appended are the unique image IDs specified by the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetImageUid.html">SetImageUid</a></CODE> function immediately preceding the call to this function or the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderNext.html">StartMpEncoderNext</a></CODE> function.<br />The value is <CODE>NULL</CODE> (all bytes cleared to <CODE>0</CODE>) if <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetImageUid.html">SetImageUid</a></CODE> has not been called or if the image is the starting image.<br />The default value is <CODE>false</CODE>.</td>
101        </tr>
102        <tr>
103<td>in</td>
104<th>addTotalFrames</th>
105<td>Specifies whether to append the total number of frames taken.<br />Specify <CODE>true</CODE> to append it, or <CODE>false</CODE> to not append it. When the MP type (the value of the <SPAN class="argument">typeCode</SPAN> argument) is <CODE>MP_TYPE_CODE_BASELINE_MP_PRIMARY_IMAGE</CODE>, this specification is ignored and the total number of frames taken is not appended.<br />The value to append is usually the total number of images, but if <CODE>0</CODE> was specified as the individual image number in the call to <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpIndividualNum.html">SetMpIndividualNum</a></CODE> immediately preceding the call to this function or the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderNext.html">StartMpEncoderNext</a></CODE> function, then that image is not counted.<br />Starting from the second image, images of MP type <CODE>MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_1</CODE> or <CODE>MP_TYPE_CODE_LARGE_THUMBNAIL_IMAGE_CLASS_2</CODE> (images for monitor display) are not counted either.<br />The default value is <CODE>false</CODE>.</td>
106        </tr> </table>
107    </div>
108<h2>Return Values</h2>
109<div class="section">If the call is successful, the function returns the number of bytes in the generated MP0. (However, if the total number of images is greater than 1, the MP0 is not complete.) Returns <CODE>0</CODE> on failure. Use the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/GetLastError.html">GetLastError</a></CODE> function to get the reason for failure. </div>
110<h2>Description</h2>
111    <div class="section">
112<p>JPEG-encodes an image and stores it as the starting image in MP format.</p><p>This function specifies the total number of images included in one set of MP-format data (a <I>multi-picture object</I> or &quot;MPO&quot;) and encodes the starting image. Call the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderNext.html">StartMpEncoderNext</a></CODE> function to encode the second image and all subsequent images up to the total.</p><p>Depending on the encoding results of the successive calls to <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderNext.html">StartMpEncoderNext</a></CODE>, 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.</p><p>Unlike the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderLR.html">StartMpEncoderLR</a></CODE> function, when using this function you can register various types of data to each individual image by calling <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetUserMakerNote.html">SetUserMakerNote</a></CODE>, <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpTypeFlags.html">SetMpTypeFlags</a></CODE>, <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetDateTime.html">SetDateTime</a></CODE> or other functions. To register such data to the second or subsequent images, you must call those functions before calling the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderNext.html">StartMpEncoderNext</a></CODE> function.</p><p>The <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetThumbnailSize.html">SetThumbnailSize</a></CODE> and <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetInputBufferWidth.html">SetInputBufferWidth</a></CODE> 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 <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartMpEncoderNext.html">StartMpEncoderNext</a></CODE> function.</p><p>The widths and heights of images that this function can encode depend on the output format of the image (in other words, the <SPAN class="argument">dstPixelSampling</SPAN> argument). The same is true of the <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/StartJpegEncoder.html"><CODE>StartJpegEncoder</CODE></a> function.</p><p><UL> <LI> Any of the following values can be specified for the <CODE>typeCode</CODE> argument.</p><p><UL> <LI> <span>MP_TYPE_CODE_MULTI_VIEW_DISPARITY_IMAGE</span> (stereoscopic image)<LI> <span>MP_TYPE_CODE_MULTI_VIEW_PANORAMA_IMAGE</span> (panoramic image)<LI> <span>MP_TYPE_CODE_MULTI_VIEW_MULTI_ANGLE_IMAGE</span> (multi-angle image)<LI> <span>MP_TYPE_CODE_UNDEFINED</span> (undefined type)<LI> <span>MP_TYPE_CODE_BASELINE_MP_PRIMARY_IMAGE</span> (Baseline MP primary image)</LI></UL></p><p>Specify <CODE>MP_TYPE_CODE_BASELINE_MP_PRIMARY_IMAGE</CODE> (Baseline MP primary image) to use the Baseline MP primary image format. Specify any other value to use the Extended MP format.<br /></p><p></LI></UL></p><p>MP Attribute IFDs are not stored in the Baseline MP format, so the following functions have no effect.</p><p><UL> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpIndividualNum.html"><CODE>SetMpIndividualNum</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpPanOrientation.html"><CODE>SetMpPanOrientation</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpPanOverlapH.html"><CODE>SetMpPanOverlapH</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpPanOverlapV.html"><CODE>SetMpPanOverlapV</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpBaseViewpointNum.html"><CODE>SetMpBaseViewpointNum</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpConvergenceAngle.html"><CODE>SetMpConvergenceAngle</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpBaselineLength.html"><CODE>SetMpBaselineLength</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpVerticalDivergence.html"><CODE>SetMpVerticalDivergence</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpAxisDistanceX.html"><CODE>SetMpAxisDistanceX</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpAxisDistanceY.html"><CODE>SetMpAxisDistanceY</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpAxisDistanceZ.html"><CODE>SetMpAxisDistanceZ</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpYawAngle.html"><CODE>SetMpYawAngle</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpPitchAngle.html"><CODE>SetMpPitchAngle</CODE></a> <LI> <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/SetMpRollAngle.html"><CODE>SetMpRollAngle</CODE></a> </LI></UL></p><!-- write here --></div>
113<h2>Revision History</h2>
114    <div class="section">
115      <dl class="history">
116        <dt>2010/10/22</dt>
117<dd>Made revisions to make descriptions easier to understand.
118        </dd>
119        <dt>2010/06/14</dt>
120<dd>Initial version.<br />
121        </dd>
122      </dl>
123    </div>
124  <hr><p>CONFIDENTIAL</p></body>
125</html>
126