Doc: Wordsmithing

This commit is contained in:
DRC
2025-11-10 18:49:38 -05:00
parent 466c344878
commit 9e17440a15
2 changed files with 58 additions and 64 deletions

View File

@@ -1302,8 +1302,8 @@ scalingFactor)</code>. </p>
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li> <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li> <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol> </ol>
If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr> Unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
<tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr> <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Otherwise, <code>*jpegSize</code> is ignored. If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is also ignored. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.)</td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
@@ -1387,8 +1387,8 @@ If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the si
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li> <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li> <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol> </ol>
If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr> Unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
<tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr> <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Otherwise, <code>*jpegSize</code> is ignored. If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is also ignored. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.)</td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
@@ -1472,8 +1472,8 @@ If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the si
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li> <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li> <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol> </ol>
If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr> Unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
<tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr> <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Otherwise, <code>*jpegSize</code> is ignored. If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is also ignored. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.)</td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
@@ -1550,8 +1550,8 @@ If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the si
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li> <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li> <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol> </ol>
If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr> Unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
<tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr> <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Otherwise, <code>*jpegSize</code> is ignored. If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is also ignored. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.)</td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
@@ -1628,8 +1628,8 @@ If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the si
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li> <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li> <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> and adding the return value to the size of the ICC profile (if any) that was previously associated with the TurboJPEG instance (see <a class="el" href="group___turbo_j_p_e_g.html#ga5852aa6e9ee3a457798a1741642dec40" title="Embed an ICC (International Color Consortium) color management profile in JPEG images generated by su...">tj3SetICCProfile()</a>.) This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol> </ol>
If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr> Unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
<tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr> <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Otherwise, <code>*jpegSize</code> is ignored. If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is also ignored. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.)</td></tr>
</table> </table>
</dd> </dd>
</dl> </dl>
@@ -3294,10 +3294,10 @@ If you choose option 1 or 3, then <code>*jpegSize</code> should be set to the si
<tr><td class="paramname">dstBufs</td><td>pointer to an array of n byte buffers. <code>dstBufs[i]</code> will receive a JPEG image that has been transformed using the parameters in <code>transforms[i]</code>. TurboJPEG has the ability to reallocate the JPEG destination buffer to accommodate the size of the transformed JPEG image. Thus, you can choose to:<ol type="1"> <tr><td class="paramname">dstBufs</td><td>pointer to an array of n byte buffers. <code>dstBufs[i]</code> will receive a JPEG image that has been transformed using the parameters in <code>transforms[i]</code>. TurboJPEG has the ability to reallocate the JPEG destination buffer to accommodate the size of the transformed JPEG image. Thus, you can choose to:<ol type="1">
<li>pre-allocate the JPEG destination buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga1a2c96d8b47530b6e6050ba6f10b7c57" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li> <li>pre-allocate the JPEG destination buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga1a2c96d8b47530b6e6050ba6f10b7c57" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
<li>set <code>dstBufs[i]</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li> <li>set <code>dstBufs[i]</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga1c13482ad590fefe34f30a43ba110d60" title="The maximum size of the buffer (in bytes) required to hold a JPEG image transformed with the given tr...">tj3TransformBufSize()</a>. Under normal circumstances, this should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.) Note, however, that there are some rare cases (such as transforming images with a large amount of embedded Exif data) in which the transformed JPEG image will be larger than the worst-case size, and <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> cannot be used in those cases unless the embedded data is discarded using <a class="el" href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8" title="Do not copy any extra markers (including Exif and ICC profile data) from the source image to the dest...">TJXOPT_COPYNONE</a> or <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a259b376e3ea795834c5cdccd7a3fdeb1" title="Marker copying behavior [decompression, lossless transformation].">TJPARAM_SAVEMARKERS</a>.</li> <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga1c13482ad590fefe34f30a43ba110d60" title="The maximum size of the buffer (in bytes) required to hold a JPEG image transformed with the given tr...">tj3TransformBufSize()</a>. Under normal circumstances, this should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be. However, if the source image has a large amount of embedded Exif data, then the transformed JPEG image may be larger than the worst-case size. <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> cannot be used in that case unless the embedded data is discarded using <a class="el" href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8" title="Do not copy any extra markers (including Exif and ICC profile data) from the source image to the dest...">TJXOPT_COPYNONE</a> or <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a259b376e3ea795834c5cdccd7a3fdeb1" title="Marker copying behavior [decompression, lossless transformation].">TJPARAM_SAVEMARKERS</a>.)</li>
</ol> </ol>
If you choose option 1 or 3, then <code>dstSizes[i]</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed.</td></tr> Unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed.</td></tr>
<tr><td class="paramname">dstSizes</td><td>pointer to an array of n size_t variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Upon return, <code>dstSizes[i]</code> will contain the size of the transformed JPEG image (in bytes.)</td></tr> <tr><td class="paramname">dstSizes</td><td>pointer to an array of n size_t variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Otherwise, <code>dstSizes[i]</code> is ignored. Upon return, <code>dstSizes[i]</code> will contain the size of the transformed JPEG image (in bytes.)</td></tr>
<tr><td class="paramname">transforms</td><td>pointer to an array of n <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed JPEG image.</td></tr> <tr><td class="paramname">transforms</td><td>pointer to an array of n <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed JPEG image.</td></tr>
</table> </table>
</dd> </dd>

View File

@@ -1497,17 +1497,16 @@ DLLEXPORT int tj3SetICCProfile(tjhandle handle, unsigned char *iccBuf,
* #tj3SetICCProfile().) This should ensure that the buffer never has to be * #tj3SetICCProfile().) This should ensure that the buffer never has to be
* re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.) * re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.)
* . * .
* If you choose option 1 or 3, then `*jpegSize` should be set to the size of * Unless you have set #TJPARAM_NOREALLOC, you should always check `*jpegBuf`
* your pre-allocated buffer. In any case, unless you have set * upon return from this function, as it may have changed.
* #TJPARAM_NOREALLOC, you should always check `*jpegBuf` upon return from this
* function, as it may have changed.
* *
* @param jpegSize pointer to a size_t variable that holds the size of the JPEG * @param jpegSize pointer to a size_t variable that holds the size of the JPEG
* buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize` * buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize`
* should be set to the size of the buffer. Upon return, `*jpegSize` will * should be set to the size of the buffer. Otherwise, `*jpegSize` is
* contain the size of the JPEG image (in bytes.) If `*jpegBuf` points to a * ignored. If `*jpegBuf` points to a JPEG buffer that is being reused from a
* JPEG buffer that is being reused from a previous call to one of the JPEG * previous call to one of the JPEG compression functions, then `*jpegSize` is
* compression functions, then `*jpegSize` is ignored. * also ignored. Upon return, `*jpegSize` will contain the size of the JPEG
* image (in bytes.)
* *
* @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr() * @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr()
* and #tj3GetErrorCode().) * and #tj3GetErrorCode().)
@@ -1558,17 +1557,16 @@ DLLEXPORT int tj3Compress8(tjhandle handle, const unsigned char *srcBuf,
* #tj3SetICCProfile().) This should ensure that the buffer never has to be * #tj3SetICCProfile().) This should ensure that the buffer never has to be
* re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.) * re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.)
* . * .
* If you choose option 1 or 3, then `*jpegSize` should be set to the size of * Unless you have set #TJPARAM_NOREALLOC, you should always check `*jpegBuf`
* your pre-allocated buffer. In any case, unless you have set * upon return from this function, as it may have changed.
* #TJPARAM_NOREALLOC, you should always check `*jpegBuf` upon return from this
* function, as it may have changed.
* *
* @param jpegSize pointer to a size_t variable that holds the size of the JPEG * @param jpegSize pointer to a size_t variable that holds the size of the JPEG
* buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize` * buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize`
* should be set to the size of the buffer. Upon return, `*jpegSize` will * should be set to the size of the buffer. Otherwise, `*jpegSize` is
* contain the size of the JPEG image (in bytes.) If `*jpegBuf` points to a * ignored. If `*jpegBuf` points to a JPEG buffer that is being reused from a
* JPEG buffer that is being reused from a previous call to one of the JPEG * previous call to one of the JPEG compression functions, then `*jpegSize` is
* compression functions, then `*jpegSize` is ignored. * also ignored. Upon return, `*jpegSize` will contain the size of the JPEG
* image (in bytes.)
* *
* @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr() * @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr()
* and #tj3GetErrorCode().) * and #tj3GetErrorCode().)
@@ -1620,17 +1618,16 @@ DLLEXPORT int tj3Compress12(tjhandle handle, const short *srcBuf, int width,
* #tj3SetICCProfile().) This should ensure that the buffer never has to be * #tj3SetICCProfile().) This should ensure that the buffer never has to be
* re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.) * re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.)
* . * .
* If you choose option 1 or 3, then `*jpegSize` should be set to the size of * Unless you have set #TJPARAM_NOREALLOC, you should always check `*jpegBuf`
* your pre-allocated buffer. In any case, unless you have set * upon return from this function, as it may have changed.
* #TJPARAM_NOREALLOC, you should always check `*jpegBuf` upon return from this
* function, as it may have changed.
* *
* @param jpegSize pointer to a size_t variable that holds the size of the JPEG * @param jpegSize pointer to a size_t variable that holds the size of the JPEG
* buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize` * buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize`
* should be set to the size of the buffer. Upon return, `*jpegSize` will * should be set to the size of the buffer. Otherwise, `*jpegSize` is
* contain the size of the JPEG image (in bytes.) If `*jpegBuf` points to a * ignored. If `*jpegBuf` points to a JPEG buffer that is being reused from a
* JPEG buffer that is being reused from a previous call to one of the JPEG * previous call to one of the JPEG compression functions, then `*jpegSize` is
* compression functions, then `*jpegSize` is ignored. * also ignored. Upon return, `*jpegSize` will contain the size of the JPEG
* image (in bytes.)
* *
* @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr() * @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr()
* and #tj3GetErrorCode().) * and #tj3GetErrorCode().)
@@ -1686,17 +1683,16 @@ DLLEXPORT int tj3Compress16(tjhandle handle, const unsigned short *srcBuf,
* #tj3SetICCProfile().) This should ensure that the buffer never has to be * #tj3SetICCProfile().) This should ensure that the buffer never has to be
* re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.) * re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.)
* . * .
* If you choose option 1 or 3, then `*jpegSize` should be set to the size of * Unless you have set #TJPARAM_NOREALLOC, you should always check `*jpegBuf`
* your pre-allocated buffer. In any case, unless you have set * upon return from this function, as it may have changed.
* #TJPARAM_NOREALLOC, you should always check `*jpegBuf` upon return from this
* function, as it may have changed.
* *
* @param jpegSize pointer to a size_t variable that holds the size of the JPEG * @param jpegSize pointer to a size_t variable that holds the size of the JPEG
* buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize` * buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize`
* should be set to the size of the buffer. Upon return, `*jpegSize` will * should be set to the size of the buffer. Otherwise, `*jpegSize` is
* contain the size of the JPEG image (in bytes.) If `*jpegBuf` points to a * ignored. If `*jpegBuf` points to a JPEG buffer that is being reused from a
* JPEG buffer that is being reused from a previous call to one of the JPEG * previous call to one of the JPEG compression functions, then `*jpegSize` is
* compression functions, then `*jpegSize` is ignored. * also ignored. Upon return, `*jpegSize` will contain the size of the JPEG
* image (in bytes.)
* *
* @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr() * @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr()
* and #tj3GetErrorCode().) * and #tj3GetErrorCode().)
@@ -1749,17 +1745,16 @@ DLLEXPORT int tj3CompressFromYUVPlanes8(tjhandle handle,
* #tj3SetICCProfile().) This should ensure that the buffer never has to be * #tj3SetICCProfile().) This should ensure that the buffer never has to be
* re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.) * re-allocated. (Setting #TJPARAM_NOREALLOC guarantees that it won't be.)
* . * .
* If you choose option 1 or 3, then `*jpegSize` should be set to the size of * Unless you have set #TJPARAM_NOREALLOC, you should always check `*jpegBuf`
* your pre-allocated buffer. In any case, unless you have set * upon return from this function, as it may have changed.
* #TJPARAM_NOREALLOC, you should always check `*jpegBuf` upon return from this
* function, as it may have changed.
* *
* @param jpegSize pointer to a size_t variable that holds the size of the JPEG * @param jpegSize pointer to a size_t variable that holds the size of the JPEG
* buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize` * buffer. If `*jpegBuf` points to a pre-allocated buffer, then `*jpegSize`
* should be set to the size of the buffer. Upon return, `*jpegSize` will * should be set to the size of the buffer. Otherwise, `*jpegSize` is
* contain the size of the JPEG image (in bytes.) If `*jpegBuf` points to a * ignored. If `*jpegBuf` points to a JPEG buffer that is being reused from a
* JPEG buffer that is being reused from a previous call to one of the JPEG * previous call to one of the JPEG compression functions, then `*jpegSize` is
* compression functions, then `*jpegSize` is ignored. * also ignored. Upon return, `*jpegSize` will contain the size of the JPEG
* image (in bytes.)
* *
* @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr() * @return 0 if successful, or -1 if an error occurred (see #tj3GetErrorStr()
* and #tj3GetErrorCode().) * and #tj3GetErrorCode().)
@@ -2316,22 +2311,21 @@ DLLEXPORT size_t tj3TransformBufSize(tjhandle handle,
* -# pre-allocate the buffer to a "worst case" size determined by calling * -# pre-allocate the buffer to a "worst case" size determined by calling
* #tj3TransformBufSize(). Under normal circumstances, this should ensure that * #tj3TransformBufSize(). Under normal circumstances, this should ensure that
* the buffer never has to be re-allocated. (Setting #TJPARAM_NOREALLOC * the buffer never has to be re-allocated. (Setting #TJPARAM_NOREALLOC
* guarantees that it won't be.) Note, however, that there are some rare cases * guarantees that it won't be. However, if the source image has a large
* (such as transforming images with a large amount of embedded Exif data) in * amount of embedded Exif data, then the transformed JPEG image may be larger
* which the transformed JPEG image will be larger than the worst-case size, * than the worst-case size. #TJPARAM_NOREALLOC cannot be used in that case
* and #TJPARAM_NOREALLOC cannot be used in those cases unless the embedded * unless the embedded data is discarded using #TJXOPT_COPYNONE or
* data is discarded using #TJXOPT_COPYNONE or #TJPARAM_SAVEMARKERS. * #TJPARAM_SAVEMARKERS.)
* . * .
* If you choose option 1 or 3, then `dstSizes[i]` should be set to the size of * Unless you have set #TJPARAM_NOREALLOC, you should always check `dstBufs[i]`
* your pre-allocated buffer. In any case, unless you have set * upon return from this function, as it may have changed.
* #TJPARAM_NOREALLOC, you should always check `dstBufs[i]` upon return from
* this function, as it may have changed.
* *
* @param dstSizes pointer to an array of n size_t variables that will receive * @param dstSizes pointer to an array of n size_t variables that will receive
* the actual sizes (in bytes) of each transformed JPEG image. If `dstBufs[i]` * the actual sizes (in bytes) of each transformed JPEG image. If `dstBufs[i]`
* points to a pre-allocated buffer, then `dstSizes[i]` should be set to the * points to a pre-allocated buffer, then `dstSizes[i]` should be set to the
* size of the buffer. Upon return, `dstSizes[i]` will contain the size of the * size of the buffer. Otherwise, `dstSizes[i]` is ignored. Upon return,
* transformed JPEG image (in bytes.) * `dstSizes[i]` will contain the size of the transformed JPEG image (in
* bytes.)
* *
* @param transforms pointer to an array of n #tjtransform structures, each of * @param transforms pointer to an array of n #tjtransform structures, each of
* which specifies the transform parameters and/or cropping region for the * which specifies the transform parameters and/or cropping region for the