Reformat TurboJPEG C API documentation to improve ease of maintenance and to make it more consistent with the javadoc formatting; fix minor error in tjCompressFromYUV() prototype.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1344 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
@@ -232,9 +232,9 @@ Functions</h2></td></tr>
|
|||||||
<tr class="memitem:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67">tjCompressFromYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
<tr class="memitem:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67">tjCompressFromYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||||
<tr class="memdesc:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="mdescLeft"> </td><td class="mdescRight">Compress a YUV planar image into a JPEG image. <a href="#ga0b931126c7a615ddc3bbd0cca6698d67">More...</a><br/></td></tr>
|
<tr class="memdesc:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="mdescLeft"> </td><td class="mdescRight">Compress a YUV planar image into a JPEG image. <a href="#ga0b931126c7a615ddc3bbd0cca6698d67">More...</a><br/></td></tr>
|
||||||
<tr class="separator:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memSeparator" colspan="2"> </td></tr>
|
<tr class="separator:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
<tr class="memitem:gab87b2b19ee8bdd8dba395b74d66a4835"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gab87b2b19ee8bdd8dba395b74d66a4835">tjCompressFromYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char **srcBufs, int width, int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
<tr class="memitem:gaa89a1982cb4556b12ae7af4439991af6"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6">tjCompressFromYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char **srcPlanes, int width, int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||||
<tr class="memdesc:gab87b2b19ee8bdd8dba395b74d66a4835"><td class="mdescLeft"> </td><td class="mdescRight">Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. <a href="#gab87b2b19ee8bdd8dba395b74d66a4835">More...</a><br/></td></tr>
|
<tr class="memdesc:gaa89a1982cb4556b12ae7af4439991af6"><td class="mdescLeft"> </td><td class="mdescRight">Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. <a href="#gaa89a1982cb4556b12ae7af4439991af6">More...</a><br/></td></tr>
|
||||||
<tr class="separator:gab87b2b19ee8bdd8dba395b74d66a4835"><td class="memSeparator" colspan="2"> </td></tr>
|
<tr class="separator:gaa89a1982cb4556b12ae7af4439991af6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
<tr class="memitem:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b">tjBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>
|
<tr class="memitem:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b">tjBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>
|
||||||
<tr class="memdesc:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="mdescLeft"> </td><td class="mdescRight">The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. <a href="#gaccc5bca7f12fcdcc302e6e1c6d4b311b">More...</a><br/></td></tr>
|
<tr class="memdesc:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="mdescLeft"> </td><td class="mdescRight">The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. <a href="#gaccc5bca7f12fcdcc302e6e1c6d4b311b">More...</a><br/></td></tr>
|
||||||
<tr class="separator:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memSeparator" colspan="2"> </td></tr>
|
<tr class="separator:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
@@ -849,8 +849,8 @@ Variables</h2></td></tr>
|
|||||||
<p>The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, and it is thus possible for a very high-quality JPEG image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent a very rare corner case, but since there is no way to predict the size of a JPEG image prior to compression, the corner case has to be handled.</p>
|
<p>The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, and it is thus possible for a very high-quality JPEG image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent a very rare corner case, but since there is no way to predict the size of a JPEG image prior to compression, the corner case has to be handled.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">width</td><td>width of the image (in pixels) </td></tr>
|
<tr><td class="paramname">width</td><td>width of the image (in pixels)</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height of the image (in pixels) </td></tr>
|
<tr><td class="paramname">height</td><td>height of the image (in pixels)</td></tr>
|
||||||
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -898,9 +898,9 @@ Variables</h2></td></tr>
|
|||||||
<p>The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. </p>
|
<p>The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. </p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">width</td><td>width of the image (in pixels) </td></tr>
|
<tr><td class="paramname">width</td><td>width of the image (in pixels)</td></tr>
|
||||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the image is padded to the nearest multiple of this number of bytes (must be a power of 2.) </td></tr>
|
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height of the image (in pixels) </td></tr>
|
<tr><td class="paramname">height</td><td>height of the image (in pixels)</td></tr>
|
||||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -990,21 +990,21 @@ Variables</h2></td></tr>
|
|||||||
<p>Compress an RGB, grayscale, or CMYK image into a JPEG image. </p>
|
<p>Compress an RGB, grayscale, or CMYK image into a JPEG image. </p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed </td></tr>
|
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image </td></tr>
|
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||||
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image </td></tr>
|
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||||
<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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
|
||||||
</ol>
|
</ol>
|
||||||
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed. </td></tr>
|
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_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 an unsigned long variable that holds the size of the JPEG image 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.) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image 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.)</td></tr>
|
||||||
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best) </td></tr>
|
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1088,20 +1088,20 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>Compress a YUV planar image into a JPEG image. </p>
|
<p>Compress a YUV planar image into a JPEG image. </p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) </td></tr>
|
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">pad</td><td>the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then <code>pad</code> should be set to 4. </td></tr>
|
<tr><td class="paramname">pad</td><td>the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||||
<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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
|
||||||
</ol>
|
</ol>
|
||||||
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed. </td></tr>
|
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_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 an unsigned long variable that holds the size of the JPEG image 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.) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image 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.)</td></tr>
|
||||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best) </td></tr>
|
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1110,7 +1110,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="anchor" id="gab87b2b19ee8bdd8dba395b74d66a4835"></a>
|
<a class="anchor" id="gaa89a1982cb4556b12ae7af4439991af6"></a>
|
||||||
<div class="memitem">
|
<div class="memitem">
|
||||||
<div class="memproto">
|
<div class="memproto">
|
||||||
<table class="memname">
|
<table class="memname">
|
||||||
@@ -1124,7 +1124,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<td class="paramkey"></td>
|
<td class="paramkey"></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="paramtype">unsigned char ** </td>
|
<td class="paramtype">unsigned char ** </td>
|
||||||
<td class="paramname"><em>srcBufs</em>, </td>
|
<td class="paramname"><em>srcPlanes</em>, </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="paramkey"></td>
|
<td class="paramkey"></td>
|
||||||
@@ -1185,20 +1185,20 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. </p>
|
<p>Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. </p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.) </td></tr>
|
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.)</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective component widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image. </td></tr>
|
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective component widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||||
<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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
|
||||||
</ol>
|
</ol>
|
||||||
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed. </td></tr>
|
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_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 an unsigned long variable that holds the size of the JPEG image 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.) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image 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.)</td></tr>
|
||||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best) </td></tr>
|
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1283,15 +1283,15 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) </td></tr>
|
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||||
<tr><td class="paramname">pad</td><td>Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.) </td></tr>
|
<tr><td class="paramname">pad</td><td>Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>
|
||||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer. </td></tr>
|
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images </td></tr>
|
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
|
||||||
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images </td></tr>
|
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
|
||||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1376,15 +1376,15 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.) </td></tr>
|
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.)</td></tr>
|
||||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective component widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to decode a subregion of a larger YUV planar image. </td></tr>
|
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective component widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to decode a subregion of a larger YUV planar image.</td></tr>
|
||||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer. </td></tr>
|
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images </td></tr>
|
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
|
||||||
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images </td></tr>
|
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
|
||||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1462,14 +1462,14 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>Decompress a JPEG image to an RGB, grayscale, or CMYK image. </p>
|
<p>Decompress a JPEG image to an RGB, grayscale, or CMYK image. </p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress </td></tr>
|
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The <code>dstBuf</code> pointer may also be used to decompress into a specific region of a larger buffer. </td></tr>
|
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The <code>dstBuf</code> pointer may also be used to decompress into a specific region of a larger buffer.</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. </td></tr>
|
<tr><td class="paramname">width</td><td>desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size.</td></tr>
|
||||||
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this is <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this is <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. </td></tr>
|
<tr><td class="paramname">height</td><td>desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size.</td></tr>
|
||||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1535,12 +1535,12 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>Retrieve information about a JPEG image without decompressing it. </p>
|
<p>Retrieve information about a JPEG image without decompressing it. </p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing a JPEG image </td></tr>
|
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing a JPEG image</td></tr>
|
||||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image </td></tr>
|
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image </td></tr>
|
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image</td></tr>
|
||||||
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when compressing the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when compressing the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||||
<tr><td class="paramname">jpegColorspace</td><td>pointer to an integer variable that will receive one of the JPEG colorspace constants, indicating the colorspace of the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG colorspaces</a>.)</td></tr>
|
<tr><td class="paramname">jpegColorspace</td><td>pointer to an integer variable that will receive one of the JPEG colorspace constants, indicating the colorspace of the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG colorspaces</a>.)</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1613,13 +1613,13 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress </td></tr>
|
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) </td></tr>
|
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4. </td></tr>
|
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1692,13 +1692,13 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress </td></tr>
|
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||||
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {scaled component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.) </td></tr>
|
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {scaled component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.)</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the scaled component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective scaled component widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to decompress the JPEG image into a subregion of a larger YUV planar image. </td></tr>
|
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the scaled component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective scaled component widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to decompress the JPEG image into a subregion of a larger YUV planar image.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG. </td></tr>
|
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1808,15 +1808,15 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded </td></tr>
|
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image </td></tr>
|
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||||
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image </td></tr>
|
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) </td></tr>
|
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4. </td></tr>
|
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
|
||||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format. </td></tr>
|
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -1901,15 +1901,15 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded </td></tr>
|
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
|
||||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image </td></tr>
|
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||||
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image </td></tr>
|
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) </td></tr>
|
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||||
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.) </td></tr>
|
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Each plane should be at least <b><em>{component stride} * {component height}</em></b> bytes in size. (See below for a description of stride, and refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of component height.)</td></tr>
|
||||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective component widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to encode an RGB or grayscale image into a subregion of a larger YUV planar image. </td></tr>
|
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the component width for the plane. If <code>stride</code> is NULL, then the strides for all planes will be set to their respective component widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to encode an RGB or grayscale image into a subregion of a larger YUV planar image.</td></tr>
|
||||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format. </td></tr>
|
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -2109,18 +2109,18 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
|||||||
<p>Lossless transforms work by moving the raw coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
|
<p>Lossless transforms work by moving the raw coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG transformer instance </td></tr>
|
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG transformer instance</td></tr>
|
||||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to transform </td></tr>
|
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to transform</td></tr>
|
||||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||||
<tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate </td></tr>
|
<tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate</td></tr>
|
||||||
<tr><td class="paramname">dstBufs</td><td>pointer to an array of n image 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 buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
<tr><td class="paramname">dstBufs</td><td>pointer to an array of n image 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 buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</a> with the transformed or cropped width and height. This should ensure that the buffer never has to be re-allocated (setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</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#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</a> with the transformed or cropped width and height. This should ensure that the buffer never has to be re-allocated (setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
|
||||||
</ol>
|
</ol>
|
||||||
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed. </td></tr>
|
If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_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 unsigned long 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 JPEG image (in bytes.) </td></tr>
|
<tr><td class="paramname">dstSizes</td><td>pointer to an array of n unsigned long 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 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 output 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 output image.</td></tr>
|
||||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ var searchData=
|
|||||||
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
||||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
||||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
||||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gab87b2b19ee8bdd8dba395b74d66a4835',1,'turbojpeg.h']]],
|
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]],
|
||||||
['tjcs',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],
|
['tjcs',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],
|
||||||
['tjcs_5fcmyk',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],
|
['tjcs_5fcmyk',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],
|
||||||
['tjcs_5fgray',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],
|
['tjcs_5fgray',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ var searchData=
|
|||||||
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
||||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
||||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
||||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gab87b2b19ee8bdd8dba395b74d66a4835',1,'turbojpeg.h']]],
|
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]],
|
||||||
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
|
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
|
||||||
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]],
|
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]],
|
||||||
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
|
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
|
||||||
|
|||||||
@@ -129,11 +129,11 @@ Data Fields</h2></td></tr>
|
|||||||
<p>This allows for custom filters or other transformations to be applied in the frequency domain.</p>
|
<p>This allows for custom filters or other transformations to be applied in the frequency domain.</p>
|
||||||
<dl class="params"><dt>Parameters</dt><dd>
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
<table class="params">
|
<table class="params">
|
||||||
<tr><td class="paramname">coeffs</td><td>pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.) </td></tr>
|
<tr><td class="paramname">coeffs</td><td>pointer to an array of transformed DCT coefficients. (NOTE: this pointer is not guaranteed to be valid once the callback returns, so applications wishing to hand off the DCT coefficients to another function or library should make a copy of them within the body of the callback.)</td></tr>
|
||||||
<tr><td class="paramname">arrayRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the array pointed to by <code>coeffs</code> as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array. </td></tr>
|
<tr><td class="paramname">arrayRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the array pointed to by <code>coeffs</code> as well as its offset relative to the component plane. TurboJPEG implementations may choose to split each component plane into multiple DCT coefficient arrays and call the callback function once for each array.</td></tr>
|
||||||
<tr><td class="paramname">planeRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the component plane to which <code>coeffs</code> belongs </td></tr>
|
<tr><td class="paramname">planeRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure containing the width and height of the component plane to which <code>coeffs</code> belongs</td></tr>
|
||||||
<tr><td class="paramname">componentID</td><td>ID number of the component plane to which <code>coeffs</code> belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1, and 2 in typical JPEG images.) </td></tr>
|
<tr><td class="paramname">componentID</td><td>ID number of the component plane to which <code>coeffs</code> belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1, and 2 in typical JPEG images.)</td></tr>
|
||||||
<tr><td class="paramname">transformID</td><td>ID number of the transformed image to which <code>coeffs</code> belongs. This is the same as the index of the transform in the <code>transforms</code> array that was passed to <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a>. </td></tr>
|
<tr><td class="paramname">transformID</td><td>ID number of the transformed image to which <code>coeffs</code> belongs. This is the same as the index of the transform in the <code>transforms</code> array that was passed to <a class="el" href="group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a>.</td></tr>
|
||||||
<tr><td class="paramname">transform</td><td>a pointer to a <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structure that specifies the parameters and/or cropping region for this transform</td></tr>
|
<tr><td class="paramname">transform</td><td>a pointer to a <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structure that specifies the parameters and/or cropping region for this transform</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
750
turbojpeg.h
750
turbojpeg.h
@@ -550,26 +550,29 @@ typedef struct tjtransform
|
|||||||
* to be applied in the frequency domain.
|
* to be applied in the frequency domain.
|
||||||
*
|
*
|
||||||
* @param coeffs pointer to an array of transformed DCT coefficients. (NOTE:
|
* @param coeffs pointer to an array of transformed DCT coefficients. (NOTE:
|
||||||
* this pointer is not guaranteed to be valid once the callback
|
* this pointer is not guaranteed to be valid once the callback returns, so
|
||||||
* returns, so applications wishing to hand off the DCT coefficients
|
* applications wishing to hand off the DCT coefficients to another function
|
||||||
* to another function or library should make a copy of them within
|
* or library should make a copy of them within the body of the callback.)
|
||||||
* the body of the callback.)
|
*
|
||||||
* @param arrayRegion #tjregion structure containing the width and height of
|
* @param arrayRegion #tjregion structure containing the width and height of
|
||||||
* the array pointed to by <tt>coeffs</tt> as well as its offset
|
* the array pointed to by <tt>coeffs</tt> as well as its offset relative to
|
||||||
* relative to the component plane. TurboJPEG implementations may
|
* the component plane. TurboJPEG implementations may choose to split each
|
||||||
* choose to split each component plane into multiple DCT coefficient
|
* component plane into multiple DCT coefficient arrays and call the callback
|
||||||
* arrays and call the callback function once for each array.
|
* function once for each array.
|
||||||
|
*
|
||||||
* @param planeRegion #tjregion structure containing the width and height of
|
* @param planeRegion #tjregion structure containing the width and height of
|
||||||
* the component plane to which <tt>coeffs</tt> belongs
|
* the component plane to which <tt>coeffs</tt> belongs
|
||||||
|
*
|
||||||
* @param componentID ID number of the component plane to which
|
* @param componentID ID number of the component plane to which
|
||||||
* <tt>coeffs</tt> belongs (Y, Cb, and Cr have, respectively, ID's of
|
* <tt>coeffs</tt> belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1,
|
||||||
* 0, 1, and 2 in typical JPEG images.)
|
* and 2 in typical JPEG images.)
|
||||||
|
*
|
||||||
* @param transformID ID number of the transformed image to which
|
* @param transformID ID number of the transformed image to which
|
||||||
* <tt>coeffs</tt> belongs. This is the same as the index of the
|
* <tt>coeffs</tt> belongs. This is the same as the index of the transform
|
||||||
* transform in the <tt>transforms</tt> array that was passed to
|
* in the <tt>transforms</tt> array that was passed to #tjTransform().
|
||||||
* #tjTransform().
|
*
|
||||||
* @param transform a pointer to a #tjtransform structure that specifies the
|
* @param transform a pointer to a #tjtransform structure that specifies the
|
||||||
* parameters and/or cropping region for this transform
|
* parameters and/or cropping region for this transform
|
||||||
*
|
*
|
||||||
* @return 0 if the callback was successful, or -1 if an error occurred.
|
* @return 0 if the callback was successful, or -1 if an error occurred.
|
||||||
*/
|
*/
|
||||||
@@ -616,46 +619,56 @@ DLLEXPORT tjhandle DLLCALL tjInitCompress(void);
|
|||||||
* Compress an RGB, grayscale, or CMYK image into a JPEG image.
|
* Compress an RGB, grayscale, or CMYK image into a JPEG image.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
||||||
|
*
|
||||||
* @param srcBuf pointer to an image buffer containing RGB, grayscale, or
|
* @param srcBuf pointer to an image buffer containing RGB, grayscale, or
|
||||||
* CMYK pixels to be compressed
|
* CMYK pixels to be compressed
|
||||||
|
*
|
||||||
* @param width width (in pixels) of the source image
|
* @param width width (in pixels) of the source image
|
||||||
|
*
|
||||||
* @param pitch bytes per line of the source image. Normally, this should be
|
* @param pitch bytes per line of the source image. Normally, this should be
|
||||||
* <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded,
|
* <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or
|
||||||
* or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of
|
* <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image
|
||||||
* the image is padded to the nearest 32-bit boundary, as is the case
|
* is padded to the nearest 32-bit boundary, as is the case for Windows
|
||||||
* for Windows bitmaps. You can also be clever and use this parameter
|
* bitmaps. You can also be clever and use this parameter to skip lines, etc.
|
||||||
* to skip lines, etc. Setting this parameter to 0 is the equivalent of
|
* Setting this parameter to 0 is the equivalent of setting it to
|
||||||
* setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
* <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
||||||
|
*
|
||||||
* @param height height (in pixels) of the source image
|
* @param height height (in pixels) of the source image
|
||||||
|
*
|
||||||
* @param pixelFormat pixel format of the source image (see @ref TJPF
|
* @param pixelFormat pixel format of the source image (see @ref TJPF
|
||||||
* "Pixel formats".)
|
* "Pixel formats".)
|
||||||
|
*
|
||||||
* @param jpegBuf address of a pointer to an image buffer that will receive the
|
* @param jpegBuf address of a pointer to an image buffer that will receive the
|
||||||
* JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer
|
* JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer
|
||||||
* to accommodate the size of the JPEG image. Thus, you can choose to:
|
* to accommodate the size of the JPEG image. Thus, you can choose to:
|
||||||
* -# pre-allocate the JPEG buffer with an arbitrary size using
|
* -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
|
||||||
* #tjAlloc() and let TurboJPEG grow the buffer as needed,
|
* let TurboJPEG grow the buffer as needed,
|
||||||
* -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the
|
* -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer
|
||||||
* buffer for you, or
|
* for you, or
|
||||||
* -# pre-allocate the buffer to a "worst case" size determined by
|
* -# pre-allocate the buffer to a "worst case" size determined by calling
|
||||||
* calling #tjBufSize(). This should ensure that the buffer never has
|
* #tjBufSize(). This should ensure that the buffer never has to be
|
||||||
* to be re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
|
* re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
|
||||||
* .
|
* .
|
||||||
* If you choose option 1, <tt>*jpegSize</tt> should be set to the
|
* If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your
|
||||||
* size of your pre-allocated buffer. In any case, unless you have
|
* pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
|
||||||
* set #TJFLAG_NOREALLOC, you should always check <tt>*jpegBuf</tt> upon
|
* you should always check <tt>*jpegBuf</tt> upon return from this function, as
|
||||||
* return from this function, as it may have changed.
|
* it may have changed.
|
||||||
|
*
|
||||||
* @param jpegSize pointer to an unsigned long variable that holds the size of
|
* @param jpegSize pointer to an unsigned long variable that holds the size of
|
||||||
* the JPEG image buffer. If <tt>*jpegBuf</tt> points to a
|
* the JPEG image buffer. If <tt>*jpegBuf</tt> points to a pre-allocated
|
||||||
* pre-allocated buffer, then <tt>*jpegSize</tt> should be set to the
|
* buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.
|
||||||
* size of the buffer. Upon return, <tt>*jpegSize</tt> will contain the
|
* Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in
|
||||||
* size of the JPEG image (in bytes.)
|
* bytes.)
|
||||||
|
*
|
||||||
* @param jpegSubsamp the level of chrominance subsampling to be used when
|
* @param jpegSubsamp the level of chrominance subsampling to be used when
|
||||||
* generating the JPEG image (see @ref TJSAMP
|
* generating the JPEG image (see @ref TJSAMP
|
||||||
* "Chrominance subsampling options".)
|
* "Chrominance subsampling options".)
|
||||||
|
*
|
||||||
* @param jpegQual the image quality of the generated JPEG image (1 = worst,
|
* @param jpegQual the image quality of the generated JPEG image (1 = worst,
|
||||||
100 = best)
|
* 100 = best)
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -668,47 +681,56 @@ DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,
|
|||||||
* Compress a YUV planar image into a JPEG image.
|
* Compress a YUV planar image into a JPEG image.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
||||||
|
*
|
||||||
* @param srcBuf pointer to an image buffer containing a YUV planar image to be
|
* @param srcBuf pointer to an image buffer containing a YUV planar image to be
|
||||||
* compressed. The size of this buffer should match the value returned
|
* compressed. The size of this buffer should match the value returned by
|
||||||
* by #tjBufSizeYUV2() for the given image width, height, padding, and
|
* #tjBufSizeYUV2() for the given image width, height, padding, and level of
|
||||||
* level of chrominance subsampling. The Y, U (Cb), and V (Cr) image
|
* chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be
|
||||||
* planes should be stored sequentially in the source buffer (refer to
|
* stored sequentially in the source buffer (refer to @ref YUVnotes
|
||||||
* @ref YUVnotes "YUV Image Format Notes".)
|
* "YUV Image Format Notes".)
|
||||||
|
*
|
||||||
* @param width width (in pixels) of the source image. If the width is not an
|
* @param width width (in pixels) of the source image. If the width is not an
|
||||||
* even multiple of the MCU block width (see #tjMCUWidth), then an
|
* even multiple of the MCU block width (see #tjMCUWidth), then an intermediate
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* buffer copy will be performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param pad the line padding used in the source image. For instance, if each
|
* @param pad the line padding used in the source image. For instance, if each
|
||||||
* line in each plane of the YUV image is padded to the nearest multiple
|
* line in each plane of the YUV image is padded to the nearest multiple of 4
|
||||||
* of 4 bytes, then <tt>pad</tt> should be set to 4.
|
* bytes, then <tt>pad</tt> should be set to 4.
|
||||||
|
*
|
||||||
* @param height height (in pixels) of the source image. If the height is not
|
* @param height height (in pixels) of the source image. If the height is not
|
||||||
* an even multiple of the MCU block height (see #tjMCUHeight), then an
|
* an even multiple of the MCU block height (see #tjMCUHeight), then an
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* intermediate buffer copy will be performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param subsamp the level of chrominance subsampling used in the source
|
* @param subsamp the level of chrominance subsampling used in the source
|
||||||
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
||||||
|
*
|
||||||
* @param jpegBuf address of a pointer to an image buffer that will receive the
|
* @param jpegBuf address of a pointer to an image buffer that will receive the
|
||||||
* JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer
|
* JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to
|
||||||
* to accommodate the size of the JPEG image. Thus, you can choose to:
|
* accommodate the size of the JPEG image. Thus, you can choose to:
|
||||||
* -# pre-allocate the JPEG buffer with an arbitrary size using
|
* -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
|
||||||
* #tjAlloc() and let TurboJPEG grow the buffer as needed,
|
* let TurboJPEG grow the buffer as needed,
|
||||||
* -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the
|
* -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer
|
||||||
* buffer for you, or
|
* for you, or
|
||||||
* -# pre-allocate the buffer to a "worst case" size determined by
|
* -# pre-allocate the buffer to a "worst case" size determined by calling
|
||||||
* calling #tjBufSize(). This should ensure that the buffer never has
|
* #tjBufSize(). This should ensure that the buffer never has to be
|
||||||
* to be re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
|
* re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
|
||||||
* .
|
* .
|
||||||
* If you choose option 1, <tt>*jpegSize</tt> should be set to the
|
* If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your
|
||||||
* size of your pre-allocated buffer. In any case, unless you have
|
* pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
|
||||||
* set #TJFLAG_NOREALLOC, you should always check <tt>*jpegBuf</tt> upon
|
* you should always check <tt>*jpegBuf</tt> upon return from this function, as
|
||||||
* return from this function, as it may have changed.
|
* it may have changed.
|
||||||
|
*
|
||||||
* @param jpegSize pointer to an unsigned long variable that holds the size of
|
* @param jpegSize pointer to an unsigned long variable that holds the size of
|
||||||
* the JPEG image buffer. If <tt>*jpegBuf</tt> points to a
|
* the JPEG image buffer. If <tt>*jpegBuf</tt> points to a pre-allocated
|
||||||
* pre-allocated buffer, then <tt>*jpegSize</tt> should be set to the
|
* buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.
|
||||||
* size of the buffer. Upon return, <tt>*jpegSize</tt> will contain the
|
* Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in
|
||||||
* size of the JPEG image (in bytes.)
|
* bytes.)
|
||||||
|
*
|
||||||
* @param jpegQual the image quality of the generated JPEG image (1 = worst,
|
* @param jpegQual the image quality of the generated JPEG image (1 = worst,
|
||||||
100 = best)
|
* 100 = best)
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -721,58 +743,66 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
|
|||||||
* Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image.
|
* Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
||||||
|
*
|
||||||
* @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
* @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
||||||
* (or just a Y plane, if compressing a grayscale image) that contain a
|
* (or just a Y plane, if compressing a grayscale image) that contain a YUV
|
||||||
* YUV image to be compressed. These planes can be contiguous or
|
* image to be compressed. These planes can be contiguous or non-contiguous in
|
||||||
* non-contiguous in memory. Each plane should be at least
|
* memory. Each plane should be at least
|
||||||
* <b><i>{component stride} * {component height}</i></b> bytes in size.
|
* <b><i>{component stride} * {component height}</i></b> bytes in size. (See
|
||||||
* (See below for a description of stride, and refer to @ref YUVnotes
|
* below for a description of stride, and refer to @ref YUVnotes
|
||||||
* "YUV Image Format Notes" for a description of component height.)
|
* "YUV Image Format Notes" for a description of component height.)
|
||||||
|
*
|
||||||
* @param width width (in pixels) of the source image. If the width is not an
|
* @param width width (in pixels) of the source image. If the width is not an
|
||||||
* even multiple of the MCU block width (see #tjMCUWidth), then an
|
* even multiple of the MCU block width (see #tjMCUWidth), then an intermediate
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* buffer copy will be performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param strides an array of integers, each specifying the number of bytes per
|
* @param strides an array of integers, each specifying the number of bytes per
|
||||||
* line in the corresponding plane of the YUV source image. Setting the
|
* line in the corresponding plane of the YUV source image. Setting the stride
|
||||||
* stride for any plane to 0 is the same as setting it to the component
|
* for any plane to 0 is the same as setting it to the component width for the
|
||||||
* width for the plane. If <tt>stride</tt> is NULL, then the strides
|
* plane. If <tt>stride</tt> is NULL, then the strides for all planes will be
|
||||||
* for all planes will be set to their respective component widths. You
|
* set to their respective component widths. You can adjust the strides in
|
||||||
* can adjust the strides in order to specify an arbitrary amount of
|
* order to specify an arbitrary amount of line padding in each plane or to
|
||||||
* line padding in each plane or to create a JPEG image from a subregion
|
* create a JPEG image from a subregion of a larger YUV planar image.
|
||||||
* of a larger YUV planar image.
|
*
|
||||||
* @param height height (in pixels) of the source image. If the height is not
|
* @param height height (in pixels) of the source image. If the height is not
|
||||||
* an even multiple of the MCU block height (see #tjMCUHeight), then an
|
* an even multiple of the MCU block height (see #tjMCUHeight), then an
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* intermediate buffer copy will be performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param subsamp the level of chrominance subsampling used in the source
|
* @param subsamp the level of chrominance subsampling used in the source
|
||||||
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
||||||
|
*
|
||||||
* @param jpegBuf address of a pointer to an image buffer that will receive the
|
* @param jpegBuf address of a pointer to an image buffer that will receive the
|
||||||
* JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer
|
* JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to
|
||||||
* to accommodate the size of the JPEG image. Thus, you can choose to:
|
* accommodate the size of the JPEG image. Thus, you can choose to:
|
||||||
* -# pre-allocate the JPEG buffer with an arbitrary size using
|
* -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
|
||||||
* #tjAlloc() and let TurboJPEG grow the buffer as needed,
|
* let TurboJPEG grow the buffer as needed,
|
||||||
* -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the
|
* -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the buffer
|
||||||
* buffer for you, or
|
* for you, or
|
||||||
* -# pre-allocate the buffer to a "worst case" size determined by
|
* -# pre-allocate the buffer to a "worst case" size determined by calling
|
||||||
* calling #tjBufSize(). This should ensure that the buffer never has
|
* #tjBufSize(). This should ensure that the buffer never has to be
|
||||||
* to be re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
|
* re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
|
||||||
* .
|
* .
|
||||||
* If you choose option 1, <tt>*jpegSize</tt> should be set to the
|
* If you choose option 1, <tt>*jpegSize</tt> should be set to the size of your
|
||||||
* size of your pre-allocated buffer. In any case, unless you have
|
* pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC,
|
||||||
* set #TJFLAG_NOREALLOC, you should always check <tt>*jpegBuf</tt> upon
|
* you should always check <tt>*jpegBuf</tt> upon return from this function, as
|
||||||
* return from this function, as it may have changed.
|
* it may have changed.
|
||||||
|
*
|
||||||
* @param jpegSize pointer to an unsigned long variable that holds the size of
|
* @param jpegSize pointer to an unsigned long variable that holds the size of
|
||||||
* the JPEG image buffer. If <tt>*jpegBuf</tt> points to a
|
* the JPEG image buffer. If <tt>*jpegBuf</tt> points to a pre-allocated
|
||||||
* pre-allocated buffer, then <tt>*jpegSize</tt> should be set to the
|
* buffer, then <tt>*jpegSize</tt> should be set to the size of the buffer.
|
||||||
* size of the buffer. Upon return, <tt>*jpegSize</tt> will contain the
|
* Upon return, <tt>*jpegSize</tt> will contain the size of the JPEG image (in
|
||||||
* size of the JPEG image (in bytes.)
|
* bytes.)
|
||||||
|
*
|
||||||
* @param jpegQual the image quality of the generated JPEG image (1 = worst,
|
* @param jpegQual the image quality of the generated JPEG image (1 = worst,
|
||||||
100 = best)
|
* 100 = best)
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
|
DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
|
||||||
unsigned char **srcBufs, int width, int *strides, int height, int subsamp,
|
unsigned char **srcPlanes, int width, int *strides, int height, int subsamp,
|
||||||
unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags);
|
unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags);
|
||||||
|
|
||||||
|
|
||||||
@@ -788,10 +818,12 @@ DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
|
|||||||
* handled.
|
* handled.
|
||||||
*
|
*
|
||||||
* @param width width of the image (in pixels)
|
* @param width width of the image (in pixels)
|
||||||
|
*
|
||||||
* @param height height of the image (in pixels)
|
* @param height height of the image (in pixels)
|
||||||
|
*
|
||||||
* @param jpegSubsamp the level of chrominance subsampling to be used when
|
* @param jpegSubsamp the level of chrominance subsampling to be used when
|
||||||
* generating the JPEG image (see @ref TJSAMP
|
* generating the JPEG image (see @ref TJSAMP
|
||||||
* "Chrominance subsampling options".)
|
* "Chrominance subsampling options".)
|
||||||
*
|
*
|
||||||
* @return the maximum size of the buffer (in bytes) required to hold the
|
* @return the maximum size of the buffer (in bytes) required to hold the
|
||||||
* image, or -1 if the arguments are out of bounds.
|
* image, or -1 if the arguments are out of bounds.
|
||||||
@@ -805,11 +837,14 @@ DLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,
|
|||||||
* the given parameters.
|
* the given parameters.
|
||||||
*
|
*
|
||||||
* @param width width of the image (in pixels)
|
* @param width width of the image (in pixels)
|
||||||
|
*
|
||||||
* @param pad the width of each line in each plane of the image is padded to
|
* @param pad the width of each line in each plane of the image is padded to
|
||||||
* the nearest multiple of this number of bytes (must be a power of 2.)
|
* the nearest multiple of this number of bytes (must be a power of 2.)
|
||||||
|
*
|
||||||
* @param height height of the image (in pixels)
|
* @param height height of the image (in pixels)
|
||||||
|
*
|
||||||
* @param subsamp level of chrominance subsampling in the image (see
|
* @param subsamp level of chrominance subsampling in the image (see
|
||||||
* @ref TJSAMP "Chrominance subsampling options".)
|
* @ref TJSAMP "Chrominance subsampling options".)
|
||||||
*
|
*
|
||||||
* @return the size of the buffer (in bytes) required to hold the image, or
|
* @return the size of the buffer (in bytes) required to hold the image, or
|
||||||
* -1 if the arguments are out of bounds.
|
* -1 if the arguments are out of bounds.
|
||||||
@@ -825,36 +860,44 @@ DLLEXPORT unsigned long DLLCALL tjBufSizeYUV2(int width, int pad, int height,
|
|||||||
* process.
|
* process.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
||||||
|
*
|
||||||
* @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
|
* @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
|
||||||
* to be encoded
|
* to be encoded
|
||||||
|
*
|
||||||
* @param width width (in pixels) of the source image
|
* @param width width (in pixels) of the source image
|
||||||
|
*
|
||||||
* @param pitch bytes per line of the source image. Normally, this should be
|
* @param pitch bytes per line of the source image. Normally, this should be
|
||||||
* <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded,
|
* <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or
|
||||||
* or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of
|
* <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image
|
||||||
* the image is padded to the nearest 32-bit boundary, as is the case
|
* is padded to the nearest 32-bit boundary, as is the case for Windows
|
||||||
* for Windows bitmaps. You can also be clever and use this parameter
|
* bitmaps. You can also be clever and use this parameter to skip lines, etc.
|
||||||
* to skip lines, etc. Setting this parameter to 0 is the equivalent of
|
* Setting this parameter to 0 is the equivalent of setting it to
|
||||||
* setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
* <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
||||||
|
*
|
||||||
* @param height height (in pixels) of the source image
|
* @param height height (in pixels) of the source image
|
||||||
|
*
|
||||||
* @param pixelFormat pixel format of the source image (see @ref TJPF
|
* @param pixelFormat pixel format of the source image (see @ref TJPF
|
||||||
* "Pixel formats".)
|
* "Pixel formats".)
|
||||||
|
*
|
||||||
* @param dstBuf pointer to an image buffer that will receive the YUV image.
|
* @param dstBuf pointer to an image buffer that will receive the YUV image.
|
||||||
* Use #tjBufSizeYUV2() to determine the appropriate size for this
|
* Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based
|
||||||
* buffer based on the image width, height, padding, and level of
|
* on the image width, height, padding, and level of chrominance subsampling.
|
||||||
* chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will
|
* The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the
|
||||||
* be stored sequentially in the buffer (refer to @ref YUVnotes
|
* buffer (refer to @ref YUVnotes "YUV Image Format Notes".)
|
||||||
* "YUV Image Format Notes".)
|
*
|
||||||
* @param pad the width of each line in each plane of the YUV image will be
|
* @param pad the width of each line in each plane of the YUV image will be
|
||||||
* padded to the nearest multiple of this number of bytes (must be a
|
* padded to the nearest multiple of this number of bytes (must be a power of
|
||||||
* power of 2.) To generate images suitable for X Video, <tt>pad</tt>
|
* 2.) To generate images suitable for X Video, <tt>pad</tt> should be set to
|
||||||
* should be set to 4.
|
* 4.
|
||||||
|
*
|
||||||
* @param subsamp the level of chrominance subsampling to be used when
|
* @param subsamp the level of chrominance subsampling to be used when
|
||||||
* generating the YUV image (see @ref TJSAMP
|
* generating the YUV image (see @ref TJSAMP
|
||||||
* "Chrominance subsampling options".) To generate images suitable for
|
* "Chrominance subsampling options".) To generate images suitable for X
|
||||||
* X Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420. This
|
* Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420. This produces an
|
||||||
* produces an image compatible with the I420 (AKA "YUV420P") format.
|
* image compatible with the I420 (AKA "YUV420P") format.
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -870,41 +913,49 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle,
|
|||||||
* compression process.
|
* compression process.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
* @param handle a handle to a TurboJPEG compressor or transformer instance
|
||||||
|
*
|
||||||
* @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
|
* @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
|
||||||
* to be encoded
|
* to be encoded
|
||||||
|
*
|
||||||
* @param width width (in pixels) of the source image
|
* @param width width (in pixels) of the source image
|
||||||
|
*
|
||||||
* @param pitch bytes per line of the source image. Normally, this should be
|
* @param pitch bytes per line of the source image. Normally, this should be
|
||||||
* <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded,
|
* <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded, or
|
||||||
* or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of
|
* <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of the image
|
||||||
* the image is padded to the nearest 32-bit boundary, as is the case
|
* is padded to the nearest 32-bit boundary, as is the case for Windows
|
||||||
* for Windows bitmaps. You can also be clever and use this parameter
|
* bitmaps. You can also be clever and use this parameter to skip lines, etc.
|
||||||
* to skip lines, etc. Setting this parameter to 0 is the equivalent of
|
* Setting this parameter to 0 is the equivalent of setting it to
|
||||||
* setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
* <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
||||||
|
*
|
||||||
* @param height height (in pixels) of the source image
|
* @param height height (in pixels) of the source image
|
||||||
|
*
|
||||||
* @param pixelFormat pixel format of the source image (see @ref TJPF
|
* @param pixelFormat pixel format of the source image (see @ref TJPF
|
||||||
* "Pixel formats".)
|
* "Pixel formats".)
|
||||||
|
*
|
||||||
* @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
* @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
||||||
* (or just a Y plane, if generating a grayscale image) that will
|
* (or just a Y plane, if generating a grayscale image) that will receive the
|
||||||
* receive the encoded image. These planes can be contiguous or
|
* encoded image. These planes can be contiguous or non-contiguous in memory.
|
||||||
* non-contiguous in memory. Each plane should be at least
|
* Each plane should be at least
|
||||||
* <b><i>{component stride} * {component height}</i></b> bytes in size.
|
* <b><i>{component stride} * {component height}</i></b> bytes in size.
|
||||||
* (See below for a description of stride, and refer to @ref YUVnotes
|
* (See below for a description of stride, and refer to @ref YUVnotes
|
||||||
* "YUV Image Format Notes" for a description of component height.)
|
* "YUV Image Format Notes" for a description of component height.)
|
||||||
|
*
|
||||||
* @param strides an array of integers, each specifying the number of bytes per
|
* @param strides an array of integers, each specifying the number of bytes per
|
||||||
* line in the corresponding plane of the output image. Setting the
|
* line in the corresponding plane of the output image. Setting the stride for
|
||||||
* stride for any plane to 0 is the same as setting it to the component
|
* any plane to 0 is the same as setting it to the component width for the
|
||||||
* width for the plane. If <tt>stride</tt> is NULL, then the strides
|
* plane. If <tt>stride</tt> is NULL, then the strides for all planes will be
|
||||||
* for all planes will be set to their respective component widths. You
|
* set to their respective component widths. You can adjust the strides in
|
||||||
* can adjust the strides in order to add an arbitrary amount of line
|
* order to add an arbitrary amount of line padding to each plane or to encode
|
||||||
* padding to each plane or to encode an RGB or grayscale image into a
|
* an RGB or grayscale image into a subregion of a larger YUV planar image.
|
||||||
* subregion of a larger YUV planar image.
|
*
|
||||||
* @param subsamp the level of chrominance subsampling to be used when
|
* @param subsamp the level of chrominance subsampling to be used when
|
||||||
* generating the YUV image (see @ref TJSAMP
|
* generating the YUV image (see @ref TJSAMP
|
||||||
* "Chrominance subsampling options".) To generate images suitable for
|
* "Chrominance subsampling options".) To generate images suitable for X
|
||||||
* X Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420. This
|
* Video, <tt>subsamp</tt> should be set to @ref TJSAMP_420. This produces an
|
||||||
* produces an image compatible with the I420 (AKA "YUV420P") format.
|
* image compatible with the I420 (AKA "YUV420P") format.
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -926,18 +977,24 @@ DLLEXPORT tjhandle DLLCALL tjInitDecompress(void);
|
|||||||
* Retrieve information about a JPEG image without decompressing it.
|
* Retrieve information about a JPEG image without decompressing it.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
||||||
|
*
|
||||||
* @param jpegBuf pointer to a buffer containing a JPEG image
|
* @param jpegBuf pointer to a buffer containing a JPEG image
|
||||||
|
*
|
||||||
* @param jpegSize size of the JPEG image (in bytes)
|
* @param jpegSize size of the JPEG image (in bytes)
|
||||||
|
*
|
||||||
* @param width pointer to an integer variable that will receive the width (in
|
* @param width pointer to an integer variable that will receive the width (in
|
||||||
* pixels) of the JPEG image
|
* pixels) of the JPEG image
|
||||||
|
*
|
||||||
* @param height pointer to an integer variable that will receive the height
|
* @param height pointer to an integer variable that will receive the height
|
||||||
* (in pixels) of the JPEG image
|
* (in pixels) of the JPEG image
|
||||||
|
*
|
||||||
* @param jpegSubsamp pointer to an integer variable that will receive the
|
* @param jpegSubsamp pointer to an integer variable that will receive the
|
||||||
* level of chrominance subsampling used when compressing the JPEG image
|
* level of chrominance subsampling used when compressing the JPEG image (see
|
||||||
* (see @ref TJSAMP "Chrominance subsampling options".)
|
* @ref TJSAMP "Chrominance subsampling options".)
|
||||||
|
*
|
||||||
* @param jpegColorspace pointer to an integer variable that will receive one
|
* @param jpegColorspace pointer to an integer variable that will receive one
|
||||||
* of the JPEG colorspace constants, indicating the colorspace of the
|
* of the JPEG colorspace constants, indicating the colorspace of the JPEG
|
||||||
* JPEG image (see @ref TJCS "JPEG colorspaces".)
|
* image (see @ref TJCS "JPEG colorspaces".)
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -951,7 +1008,7 @@ DLLEXPORT int DLLCALL tjDecompressHeader3(tjhandle handle,
|
|||||||
* this implementation of TurboJPEG supports.
|
* this implementation of TurboJPEG supports.
|
||||||
*
|
*
|
||||||
* @param numscalingfactors pointer to an integer variable that will receive
|
* @param numscalingfactors pointer to an integer variable that will receive
|
||||||
* the number of elements in the list
|
* the number of elements in the list
|
||||||
*
|
*
|
||||||
* @return a pointer to a list of fractional scaling factors, or NULL if an
|
* @return a pointer to a list of fractional scaling factors, or NULL if an
|
||||||
* error is encountered (see #tjGetErrorStr().)
|
* error is encountered (see #tjGetErrorStr().)
|
||||||
@@ -963,42 +1020,48 @@ DLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors);
|
|||||||
* Decompress a JPEG image to an RGB, grayscale, or CMYK image.
|
* Decompress a JPEG image to an RGB, grayscale, or CMYK image.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
||||||
|
*
|
||||||
* @param jpegBuf pointer to a buffer containing the JPEG image to decompress
|
* @param jpegBuf pointer to a buffer containing the JPEG image to decompress
|
||||||
|
*
|
||||||
* @param jpegSize size of the JPEG image (in bytes)
|
* @param jpegSize size of the JPEG image (in bytes)
|
||||||
|
*
|
||||||
* @param dstBuf pointer to an image buffer that will receive the decompressed
|
* @param dstBuf pointer to an image buffer that will receive the decompressed
|
||||||
* image. This buffer should normally be <tt>pitch * scaledHeight</tt>
|
* image. This buffer should normally be <tt>pitch * scaledHeight</tt> bytes
|
||||||
* bytes in size, where <tt>scaledHeight</tt> can be determined by
|
* in size, where <tt>scaledHeight</tt> can be determined by calling
|
||||||
* calling #TJSCALED() with the JPEG image height and one of the scaling
|
* #TJSCALED() with the JPEG image height and one of the scaling factors
|
||||||
* factors returned by #tjGetScalingFactors(). The <tt>dstBuf</tt>
|
* returned by #tjGetScalingFactors(). The <tt>dstBuf</tt> pointer may also be
|
||||||
* pointer may also be used to decompress into a specific region of a
|
* used to decompress into a specific region of a larger buffer.
|
||||||
* larger buffer.
|
*
|
||||||
* @param width desired width (in pixels) of the destination image. If this is
|
* @param width desired width (in pixels) of the destination image. If this is
|
||||||
* different than the width of the JPEG image being decompressed, then
|
* different than the width of the JPEG image being decompressed, then
|
||||||
* TurboJPEG will use scaling in the JPEG decompressor to generate the
|
* TurboJPEG will use scaling in the JPEG decompressor to generate the largest
|
||||||
* largest possible image that will fit within the desired width. If
|
* possible image that will fit within the desired width. If <tt>width</tt> is
|
||||||
* <tt>width</tt> is set to 0, then only the height will be considered
|
* set to 0, then only the height will be considered when determining the
|
||||||
* when determining the scaled image size.
|
* scaled image size.
|
||||||
|
*
|
||||||
* @param pitch bytes per line of the destination image. Normally, this is
|
* @param pitch bytes per line of the destination image. Normally, this is
|
||||||
* <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt> if the decompressed
|
* <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt> if the decompressed image
|
||||||
* image is unpadded, else <tt>#TJPAD(scaledWidth *
|
* is unpadded, else <tt>#TJPAD(scaledWidth * #tjPixelSize[pixelFormat])</tt>
|
||||||
* #tjPixelSize[pixelFormat])</tt> if each line of the decompressed
|
* if each line of the decompressed image is padded to the nearest 32-bit
|
||||||
* image is padded to the nearest 32-bit boundary, as is the case for
|
* boundary, as is the case for Windows bitmaps. (NOTE: <tt>scaledWidth</tt>
|
||||||
* Windows bitmaps. (NOTE: <tt>scaledWidth</tt> can be determined by
|
* can be determined by calling #TJSCALED() with the JPEG image width and one
|
||||||
* calling #TJSCALED() with the JPEG image width and one of the scaling
|
* of the scaling factors returned by #tjGetScalingFactors().) You can also be
|
||||||
* factors returned by #tjGetScalingFactors().) You can also be clever
|
* clever and use the pitch parameter to skip lines, etc. Setting this
|
||||||
* and use the pitch parameter to skip lines, etc. Setting this
|
* parameter to 0 is the equivalent of setting it to
|
||||||
* parameter to 0 is the equivalent of setting it to
|
* <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt>.
|
||||||
* <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt>.
|
*
|
||||||
* @param height desired height (in pixels) of the destination image. If this
|
* @param height desired height (in pixels) of the destination image. If this
|
||||||
* is different than the height of the JPEG image being decompressed,
|
* is different than the height of the JPEG image being decompressed, then
|
||||||
* then TurboJPEG will use scaling in the JPEG decompressor to generate
|
* TurboJPEG will use scaling in the JPEG decompressor to generate the largest
|
||||||
* the largest possible image that will fit within the desired height.
|
* possible image that will fit within the desired height. If <tt>height</tt>
|
||||||
* If <tt>height</tt> is set to 0, then only the width will be
|
* is set to 0, then only the width will be considered when determining the
|
||||||
* considered when determining the scaled image size.
|
* scaled image size.
|
||||||
|
*
|
||||||
* @param pixelFormat pixel format of the destination image (see @ref
|
* @param pixelFormat pixel format of the destination image (see @ref
|
||||||
* TJPF "Pixel formats".)
|
* TJPF "Pixel formats".)
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -1013,36 +1076,42 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,
|
|||||||
* image is generated instead of an RGB image.
|
* image is generated instead of an RGB image.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
||||||
|
*
|
||||||
* @param jpegBuf pointer to a buffer containing the JPEG image to decompress
|
* @param jpegBuf pointer to a buffer containing the JPEG image to decompress
|
||||||
|
*
|
||||||
* @param jpegSize size of the JPEG image (in bytes)
|
* @param jpegSize size of the JPEG image (in bytes)
|
||||||
|
*
|
||||||
* @param dstBuf pointer to an image buffer that will receive the YUV image.
|
* @param dstBuf pointer to an image buffer that will receive the YUV image.
|
||||||
* Use #tjBufSizeYUV2() to determine the appropriate size for this
|
* Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based
|
||||||
* buffer based on the image width, height, padding, and level of
|
* on the image width, height, padding, and level of subsampling. The Y,
|
||||||
* subsampling. The Y, U (Cb), and V (Cr) image planes will be stored
|
* U (Cb), and V (Cr) image planes will be stored sequentially in the buffer
|
||||||
* sequentially in the buffer (refer to @ref YUVnotes
|
* (refer to @ref YUVnotes "YUV Image Format Notes".)
|
||||||
* "YUV Image Format Notes".)
|
*
|
||||||
* @param width desired width (in pixels) of the YUV image. If this is
|
* @param width desired width (in pixels) of the YUV image. If this is
|
||||||
* different than the width of the JPEG image being decompressed, then
|
* different than the width of the JPEG image being decompressed, then
|
||||||
* TurboJPEG will use scaling in the JPEG decompressor to generate the
|
* TurboJPEG will use scaling in the JPEG decompressor to generate the largest
|
||||||
* largest possible image that will fit within the desired width. If
|
* possible image that will fit within the desired width. If <tt>width</tt> is
|
||||||
* <tt>width</tt> is set to 0, then only the height will be considered
|
* set to 0, then only the height will be considered when determining the
|
||||||
* when determining the scaled image size. If the scaled width is not
|
* scaled image size. If the scaled width is not an even multiple of the MCU
|
||||||
* an even multiple of the MCU block width (see #tjMCUWidth), then an
|
* block width (see #tjMCUWidth), then an intermediate buffer copy will be
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param pad the width of each line in each plane of the YUV image will be
|
* @param pad the width of each line in each plane of the YUV image will be
|
||||||
* padded to the nearest multiple of this number of bytes (must be a
|
* padded to the nearest multiple of this number of bytes (must be a power of
|
||||||
* power of 2.) To generate images suitable for X Video, <tt>pad</tt>
|
* 2.) To generate images suitable for X Video, <tt>pad</tt> should be set to
|
||||||
* should be set to 4.
|
* 4.
|
||||||
|
*
|
||||||
* @param height desired height (in pixels) of the YUV image. If this is
|
* @param height desired height (in pixels) of the YUV image. If this is
|
||||||
* different than the height of the JPEG image being decompressed, then
|
* different than the height of the JPEG image being decompressed, then
|
||||||
* TurboJPEG will use scaling in the JPEG decompressor to generate the
|
* TurboJPEG will use scaling in the JPEG decompressor to generate the largest
|
||||||
* largest possible image that will fit within the desired height. If
|
* possible image that will fit within the desired height. If <tt>height</tt>
|
||||||
* <tt>height</tt> is set to 0, then only the width will be considered
|
* is set to 0, then only the width will be considered when determining the
|
||||||
* when determining the scaled image size. If the scaled height is not
|
* scaled image size. If the scaled height is not an even multiple of the MCU
|
||||||
* an even multiple of the MCU block height (see #tjMCUHeight), then an
|
* block height (see #tjMCUHeight), then an intermediate buffer copy will be
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -1057,42 +1126,47 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
|||||||
* conversion step, so a planar YUV image is generated instead of an RGB image.
|
* conversion step, so a planar YUV image is generated instead of an RGB image.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
||||||
|
*
|
||||||
* @param jpegBuf pointer to a buffer containing the JPEG image to decompress
|
* @param jpegBuf pointer to a buffer containing the JPEG image to decompress
|
||||||
|
*
|
||||||
* @param jpegSize size of the JPEG image (in bytes)
|
* @param jpegSize size of the JPEG image (in bytes)
|
||||||
|
*
|
||||||
* @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
* @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
||||||
* (or just a Y plane, if decompressing a grayscale image) that will
|
* (or just a Y plane, if decompressing a grayscale image) that will receive
|
||||||
* receive the YUV image. These planes can be contiguous or
|
* the YUV image. These planes can be contiguous or non-contiguous in memory.
|
||||||
* non-contiguous in memory. Each plane should be at least
|
* Each plane should be at least
|
||||||
* <b><i>{component stride} * {scaled component height}</i></b> bytes in
|
* <b><i>{component stride} * {scaled component height}</i></b> bytes in size.
|
||||||
* size. (See below for a description of stride, and refer to @ref
|
* (See below for a description of stride, and refer to @ref YUVnotes
|
||||||
* YUVnotes "YUV Image Format Notes" for a description of component
|
* "YUV Image Format Notes" for a description of component height.)
|
||||||
* height.)
|
*
|
||||||
* @param width desired width (in pixels) of the YUV image. If this is
|
* @param width desired width (in pixels) of the YUV image. If this is
|
||||||
* different than the width of the JPEG image being decompressed, then
|
* different than the width of the JPEG image being decompressed, then
|
||||||
* TurboJPEG will use scaling in the JPEG decompressor to generate the
|
* TurboJPEG will use scaling in the JPEG decompressor to generate the largest
|
||||||
* largest possible image that will fit within the desired width. If
|
* possible image that will fit within the desired width. If <tt>width</tt> is
|
||||||
* <tt>width</tt> is set to 0, then only the height will be considered
|
* set to 0, then only the height will be considered when determining the
|
||||||
* when determining the scaled image size. If the scaled width is not
|
* scaled image size. If the scaled width is not an even multiple of the MCU
|
||||||
* an even multiple of the MCU block width (see #tjMCUWidth), then an
|
* block width (see #tjMCUWidth), then an intermediate buffer copy will be
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param strides an array of integers, each specifying the number of bytes per
|
* @param strides an array of integers, each specifying the number of bytes per
|
||||||
* line in the corresponding plane of the output image. Setting the
|
* line in the corresponding plane of the output image. Setting the stride for
|
||||||
* stride for any plane to 0 is the same as setting it to the scaled
|
* any plane to 0 is the same as setting it to the scaled component width for
|
||||||
* component width for the plane. If <tt>stride</tt> is NULL, then the
|
* the plane. If <tt>stride</tt> is NULL, then the strides for all planes will
|
||||||
* strides for all planes will be set to their respective scaled
|
* be set to their respective scaled component widths. You can adjust the
|
||||||
* component widths. You can adjust the strides in order to add an
|
* strides in order to add an arbitrary amount of line padding to each plane or
|
||||||
* arbitrary amount of line padding to each plane or to decompress the
|
* to decompress the JPEG image into a subregion of a larger YUV planar image.
|
||||||
* JPEG image into a subregion of a larger YUV planar image.
|
*
|
||||||
* @param height desired height (in pixels) of the YUV image. If this is
|
* @param height desired height (in pixels) of the YUV image. If this is
|
||||||
* different than the height of the JPEG image being decompressed, then
|
* different than the height of the JPEG image being decompressed, then
|
||||||
* TurboJPEG will use scaling in the JPEG decompressor to generate the
|
* TurboJPEG will use scaling in the JPEG decompressor to generate the largest
|
||||||
* largest possible image that will fit within the desired height. If
|
* possible image that will fit within the desired height. If <tt>height</tt>
|
||||||
* <tt>height</tt> is set to 0, then only the width will be considered
|
* is set to 0, then only the width will be considered when determining the
|
||||||
* when determining the scaled image size. If the scaled height is not
|
* scaled image size. If the scaled height is not an even multiple of the MCU
|
||||||
* an even multiple of the MCU block height (see #tjMCUHeight), then an
|
* block height (see #tjMCUHeight), then an intermediate buffer copy will be
|
||||||
* intermediate buffer copy will be performed within TurboJPEG.
|
* performed within TurboJPEG.
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -1108,36 +1182,43 @@ DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,
|
|||||||
* process.
|
* process.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
||||||
|
*
|
||||||
* @param srcBuf pointer to an image buffer containing a YUV planar image to be
|
* @param srcBuf pointer to an image buffer containing a YUV planar image to be
|
||||||
* decoded. The size of this buffer should match the value returned
|
* decoded. The size of this buffer should match the value returned by
|
||||||
* by #tjBufSizeYUV2() for the given image width, height, padding, and
|
* #tjBufSizeYUV2() for the given image width, height, padding, and level of
|
||||||
* level of chrominance subsampling. The Y, U (Cb), and V (Cr) image
|
* chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be
|
||||||
* planes should be stored sequentially in the source buffer (refer to
|
* stored sequentially in the source buffer (refer to @ref YUVnotes
|
||||||
* @ref YUVnotes "YUV Image Format Notes".)
|
* "YUV Image Format Notes".)
|
||||||
|
*
|
||||||
* @param pad Use this parameter to specify that the width of each line in each
|
* @param pad Use this parameter to specify that the width of each line in each
|
||||||
* plane of the YUV source image is padded to the nearest multiple of
|
* plane of the YUV source image is padded to the nearest multiple of this
|
||||||
* this number of bytes (must be a power of 2.)
|
* number of bytes (must be a power of 2.)
|
||||||
|
*
|
||||||
* @param subsamp the level of chrominance subsampling used in the YUV source
|
* @param subsamp the level of chrominance subsampling used in the YUV source
|
||||||
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
||||||
|
*
|
||||||
* @param dstBuf pointer to an image buffer that will receive the decoded
|
* @param dstBuf pointer to an image buffer that will receive the decoded
|
||||||
* image. This buffer should normally be <tt>pitch * height</tt>
|
* image. This buffer should normally be <tt>pitch * height</tt> bytes in
|
||||||
* bytes in size, but the <tt>dstBuf</tt> pointer can also be used to
|
* size, but the <tt>dstBuf</tt> pointer can also be used to decode into a
|
||||||
* decode into a specific region of a larger buffer.
|
* specific region of a larger buffer.
|
||||||
|
*
|
||||||
* @param width width (in pixels) of the source and destination images
|
* @param width width (in pixels) of the source and destination images
|
||||||
|
*
|
||||||
* @param pitch bytes per line of the destination image. Normally, this should
|
* @param pitch bytes per line of the destination image. Normally, this should
|
||||||
* be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination
|
* be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination image is
|
||||||
* image is unpadded, or <tt>#TJPAD(width *
|
* unpadded, or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line
|
||||||
* #tjPixelSize[pixelFormat])</tt> if each line of the destination
|
* of the destination image should be padded to the nearest 32-bit boundary, as
|
||||||
* image should be padded to the nearest 32-bit boundary, as is the case
|
* is the case for Windows bitmaps. You can also be clever and use the pitch
|
||||||
* for Windows bitmaps. You can also be clever and use the pitch
|
* parameter to skip lines, etc. Setting this parameter to 0 is the equivalent
|
||||||
* parameter to skip lines, etc. Setting this parameter to 0 is the
|
* of setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
||||||
* equivalent of setting it to <tt>width *
|
*
|
||||||
* #tjPixelSize[pixelFormat]</tt>.
|
|
||||||
* @param height height (in pixels) of the source and destination images
|
* @param height height (in pixels) of the source and destination images
|
||||||
|
*
|
||||||
* @param pixelFormat pixel format of the destination image (see @ref TJPF
|
* @param pixelFormat pixel format of the destination image (see @ref TJPF
|
||||||
* "Pixel formats".)
|
* "Pixel formats".)
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -1153,42 +1234,48 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
|||||||
* decompression process.
|
* decompression process.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
* @param handle a handle to a TurboJPEG decompressor or transformer instance
|
||||||
|
*
|
||||||
* @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
* @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes
|
||||||
* (or just a Y plane, if decoding a grayscale image) that contain a
|
* (or just a Y plane, if decoding a grayscale image) that contain a YUV image
|
||||||
* YUV image to be decoded. These planes can be contiguous or
|
* to be decoded. These planes can be contiguous or non-contiguous in memory.
|
||||||
* non-contiguous in memory. Each plane should be at least
|
* Each plane should be at least
|
||||||
* <b><i>{component stride} * {component height}</i></b> bytes in size.
|
* <b><i>{component stride} * {component height}</i></b> bytes in size.
|
||||||
* (See below for a description of stride, and refer to @ref YUVnotes
|
* (See below for a description of stride, and refer to @ref YUVnotes
|
||||||
* "YUV Image Format Notes" for a description of component height.)
|
* "YUV Image Format Notes" for a description of component height.)
|
||||||
|
*
|
||||||
* @param strides an array of integers, each specifying the number of bytes per
|
* @param strides an array of integers, each specifying the number of bytes per
|
||||||
* line in the corresponding plane of the YUV source image. Setting the
|
* line in the corresponding plane of the YUV source image. Setting the stride
|
||||||
* stride for any plane to 0 is the same as setting it to the component
|
* for any plane to 0 is the same as setting it to the component width for the
|
||||||
* width for the plane. If <tt>stride</tt> is NULL, then the strides
|
* plane. If <tt>stride</tt> is NULL, then the strides for all planes will be
|
||||||
* for all planes will be set to their respective component widths. You
|
* set to their respective component widths. You can adjust the strides in
|
||||||
* can adjust the strides in order to specify an arbitrary amount of
|
* order to specify an arbitrary amount of line padding in each plane or to
|
||||||
* line padding in each plane or to decode a subregion of a larger YUV
|
* decode a subregion of a larger YUV planar image.
|
||||||
* planar image.
|
*
|
||||||
* @param subsamp the level of chrominance subsampling used in the YUV source
|
* @param subsamp the level of chrominance subsampling used in the YUV source
|
||||||
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
* image (see @ref TJSAMP "Chrominance subsampling options".)
|
||||||
|
*
|
||||||
* @param dstBuf pointer to an image buffer that will receive the decoded
|
* @param dstBuf pointer to an image buffer that will receive the decoded
|
||||||
* image. This buffer should normally be <tt>pitch * height</tt>
|
* image. This buffer should normally be <tt>pitch * height</tt> bytes in
|
||||||
* bytes in size, but the <tt>dstBuf</tt> pointer can also be used to
|
* size, but the <tt>dstBuf</tt> pointer can also be used to decode into a
|
||||||
* decode into a specific region of a larger buffer.
|
* specific region of a larger buffer.
|
||||||
|
*
|
||||||
* @param width width (in pixels) of the source and destination images
|
* @param width width (in pixels) of the source and destination images
|
||||||
|
*
|
||||||
* @param pitch bytes per line of the destination image. Normally, this should
|
* @param pitch bytes per line of the destination image. Normally, this should
|
||||||
* be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination
|
* be <tt>width * #tjPixelSize[pixelFormat]</tt> if the destination image is
|
||||||
* image is unpadded, or <tt>#TJPAD(width *
|
* unpadded, or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line
|
||||||
* #tjPixelSize[pixelFormat])</tt> if each line of the destination
|
* of the destination image should be padded to the nearest 32-bit boundary, as
|
||||||
* image should be padded to the nearest 32-bit boundary, as is the case
|
* is the case for Windows bitmaps. You can also be clever and use the pitch
|
||||||
* for Windows bitmaps. You can also be clever and use the pitch
|
* parameter to skip lines, etc. Setting this parameter to 0 is the equivalent
|
||||||
* parameter to skip lines, etc. Setting this parameter to 0 is the
|
* of setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.
|
||||||
* equivalent of setting it to <tt>width *
|
*
|
||||||
* #tjPixelSize[pixelFormat]</tt>.
|
|
||||||
* @param height height (in pixels) of the source and destination images
|
* @param height height (in pixels) of the source and destination images
|
||||||
|
*
|
||||||
* @param pixelFormat pixel format of the destination image (see @ref TJPF
|
* @param pixelFormat pixel format of the destination image (see @ref TJPF
|
||||||
* "Pixel formats".)
|
* "Pixel formats".)
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -1220,38 +1307,43 @@ DLLEXPORT tjhandle DLLCALL tjInitTransform(void);
|
|||||||
* source coefficients multiple times.
|
* source coefficients multiple times.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG transformer instance
|
* @param handle a handle to a TurboJPEG transformer instance
|
||||||
|
*
|
||||||
* @param jpegBuf pointer to a buffer containing the JPEG image to transform
|
* @param jpegBuf pointer to a buffer containing the JPEG image to transform
|
||||||
|
*
|
||||||
* @param jpegSize size of the JPEG image (in bytes)
|
* @param jpegSize size of the JPEG image (in bytes)
|
||||||
|
*
|
||||||
* @param n the number of transformed JPEG images to generate
|
* @param n the number of transformed JPEG images to generate
|
||||||
|
*
|
||||||
* @param dstBufs pointer to an array of n image buffers. <tt>dstBufs[i]</tt>
|
* @param dstBufs pointer to an array of n image buffers. <tt>dstBufs[i]</tt>
|
||||||
* will receive a JPEG image that has been transformed using the
|
* will receive a JPEG image that has been transformed using the parameters in
|
||||||
* parameters in <tt>transforms[i]</tt>. TurboJPEG has the ability to
|
* <tt>transforms[i]</tt>. TurboJPEG has the ability to reallocate the JPEG
|
||||||
* reallocate the JPEG buffer to accommodate the size of the JPEG image.
|
* buffer to accommodate the size of the JPEG image. Thus, you can choose to:
|
||||||
* Thus, you can choose to:
|
* -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and
|
||||||
* -# pre-allocate the JPEG buffer with an arbitrary size using
|
* let TurboJPEG grow the buffer as needed,
|
||||||
* #tjAlloc() and let TurboJPEG grow the buffer as needed,
|
* -# set <tt>dstBufs[i]</tt> to NULL to tell TurboJPEG to allocate the buffer
|
||||||
* -# set <tt>dstBufs[i]</tt> to NULL to tell TurboJPEG to allocate the
|
* for you, or
|
||||||
* buffer for you, or
|
* -# pre-allocate the buffer to a "worst case" size determined by calling
|
||||||
* -# pre-allocate the buffer to a "worst case" size determined by
|
* #tjBufSize() with the transformed or cropped width and height. This should
|
||||||
* calling #tjBufSize() with the transformed or cropped width and
|
* ensure that the buffer never has to be re-allocated (setting
|
||||||
* height. This should ensure that the buffer never has to be
|
* #TJFLAG_NOREALLOC guarantees this.)
|
||||||
* re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)
|
* .
|
||||||
* .
|
* If you choose option 1, <tt>dstSizes[i]</tt> should be set to the size of
|
||||||
* If you choose option 1, <tt>dstSizes[i]</tt> should be set to
|
* your pre-allocated buffer. In any case, unless you have set
|
||||||
* the size of your pre-allocated buffer. In any case, unless you have
|
* #TJFLAG_NOREALLOC, you should always check <tt>dstBufs[i]</tt> upon return
|
||||||
* set #TJFLAG_NOREALLOC, you should always check <tt>dstBufs[i]</tt>
|
* from this function, as it may have changed.
|
||||||
* upon return from this function, as it may have changed.
|
*
|
||||||
* @param dstSizes pointer to an array of n unsigned long variables that will
|
* @param dstSizes pointer to an array of n unsigned long variables that will
|
||||||
* receive the actual sizes (in bytes) of each transformed JPEG image.
|
* receive the actual sizes (in bytes) of each transformed JPEG image. If
|
||||||
* If <tt>dstBufs[i]</tt> points to a pre-allocated buffer, then
|
* <tt>dstBufs[i]</tt> points to a pre-allocated buffer, then
|
||||||
* <tt>dstSizes[i]</tt> should be set to the size of the buffer. Upon
|
* <tt>dstSizes[i]</tt> should be set to the size of the buffer. Upon return,
|
||||||
* return, <tt>dstSizes[i]</tt> will contain the size of the JPEG image
|
* <tt>dstSizes[i]</tt> will contain the size of the JPEG image (in bytes.)
|
||||||
* (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
|
* which specifies the transform parameters and/or cropping region for the
|
||||||
* the corresponding transformed output image.
|
* corresponding transformed output image.
|
||||||
|
*
|
||||||
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
* @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP
|
||||||
* "flags".
|
* "flags".
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -1264,7 +1356,7 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle handle, unsigned char *jpegBuf,
|
|||||||
* Destroy a TurboJPEG compressor, decompressor, or transformer instance.
|
* Destroy a TurboJPEG compressor, decompressor, or transformer instance.
|
||||||
*
|
*
|
||||||
* @param handle a handle to a TurboJPEG compressor, decompressor or
|
* @param handle a handle to a TurboJPEG compressor, decompressor or
|
||||||
* transformer instance
|
* transformer instance
|
||||||
*
|
*
|
||||||
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
* @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)
|
||||||
*/
|
*/
|
||||||
@@ -1280,7 +1372,7 @@ DLLEXPORT int DLLCALL tjDestroy(tjhandle handle);
|
|||||||
* @param bytes the number of bytes to allocate
|
* @param bytes the number of bytes to allocate
|
||||||
*
|
*
|
||||||
* @return a pointer to a newly-allocated buffer with the specified number of
|
* @return a pointer to a newly-allocated buffer with the specified number of
|
||||||
* bytes
|
* bytes
|
||||||
*
|
*
|
||||||
* @sa tjFree()
|
* @sa tjFree()
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user