Various doc tweaks
- "Optimized baseline entropy coding" = "Huffman table optimization" "Optimized baseline entropy coding" was meant to emphasize that the feature is only useful when generating baseline (single-scan lossy 8-bit-per-sample Huffman-coded) JPEG images, because it is automatically enabled when generating Huffman-coded progressive (multi-scan), 12-bit-per-sample, and lossless JPEG images. However, Huffman table optimization isn't actually an integral part of those non-baseline modes. You can forego Huffman table optimization with 12-bit data precision if you supply your own Huffman tables. The spec doesn't require it with progressive or lossless mode, either, although our implementation does. Furthermore, "baseline" describes more than just the type of entropy coding used. It was incorrect to say that optimized "baseline" entropy coding is automatically enabled for Huffman-coded progressive, 12-bit-per-sample, and lossless JPEG images, since those are clearly not baseline images. - "Progressive entropy coding" = "Progressive JPEG" "Progressive" describes more than just the type of entropy coding used. (In fact, both Huffman-coded and arithmetic-coded images can be progressive.) - Mention that TJPARAM_OPTIMIZE/TJ.PARAM_OPTIMIZE can be used with lossless transformation as well. - General wordsmithing - Formatting tweaks
This commit is contained in:
28
ChangeLog.md
28
ChangeLog.md
@@ -69,10 +69,10 @@ easier to detect actual security issues, should they arise in the future.
|
||||
`TJ.PARAM_MAXMEMORY` in the TurboJPEG Java API) and a corresponding TJBench
|
||||
option (`-maxmemory`) for specifying the maximum amount of memory (in
|
||||
megabytes) that will be allocated for intermediate buffers, which are used with
|
||||
progressive JPEG compression and decompression, optimized baseline entropy
|
||||
coding, lossless JPEG compression, and lossless transformation. The new
|
||||
parameter and option serve the same purpose as the `max_memory_to_use` field in
|
||||
the `jpeg_memory_mgr` struct in the libjpeg API, the `JPEGMEM` environment
|
||||
progressive JPEG compression and decompression, Huffman table optimization,
|
||||
lossless JPEG compression, and lossless transformation. The new parameter and
|
||||
option serve the same purpose as the `max_memory_to_use` field in the
|
||||
`jpeg_memory_mgr` struct in the libjpeg API, the `JPEGMEM` environment
|
||||
variable, and the cjpeg/djpeg/jpegtran `-maxmemory` option.
|
||||
|
||||
3. Introduced a new parameter (`TJPARAM_MAXPIXELS` in the TurboJPEG C API and
|
||||
@@ -210,11 +210,10 @@ through pointer arguments.
|
||||
- `TJFLAG_LIMITSCANS`/`TJ.FLAG_LIMITSCANS` has been reimplemented as an
|
||||
API parameter (`TJPARAM_SCANLIMIT`/`TJ.PARAM_SCANLIMIT`) that allows the number
|
||||
of scans to be specified.
|
||||
- Optimized baseline entropy coding (the computation of optimal Huffman
|
||||
tables, as opposed to using the default Huffman tables) can now be specified,
|
||||
using a new API parameter (`TJPARAM_OPTIMIZE`/`TJ.PARAM_OPTIMIZE`), a new
|
||||
transform option (`TJXOPT_OPTIMIZE`/`TJTransform.OPT_OPTIMIZE`), and a new
|
||||
TJBench option (`-optimize`.)
|
||||
- Huffman table optimization can now be specified using a new API
|
||||
parameter (`TJPARAM_OPTIMIZE`/`TJ.PARAM_OPTIMIZE`), a new transform option
|
||||
(`TJXOPT_OPTIMIZE`/`TJTransform.OPT_OPTIMIZE`), and a new TJBench option
|
||||
(`-optimize`.)
|
||||
- Arithmetic entropy coding can now be specified or queried, using a new
|
||||
API parameter (`TJPARAM_ARITHMETIC`/`TJ.PARAM_ARITHMETIC`), a new transform
|
||||
option (`TJXOPT_ARITHMETIC`/`TJTransform.OPT_ARITHMETIC`), and a new TJBench
|
||||
@@ -1041,12 +1040,11 @@ encounters a warning from the underlying libjpeg API (the default behavior is
|
||||
to allow the operation to complete unless a fatal error is encountered.)
|
||||
|
||||
5. Introduced a new flag in the TurboJPEG C and Java APIs (`TJFLAG_PROGRESSIVE`
|
||||
and `TJ.FLAG_PROGRESSIVE`, respectively) that causes the library to use
|
||||
progressive entropy coding in JPEG images generated by compression and
|
||||
transform operations. Additionally, a new transform option
|
||||
(`TJXOPT_PROGRESSIVE` in the C API and `TJTransform.OPT_PROGRESSIVE` in the
|
||||
Java API) has been introduced, allowing progressive entropy coding to be
|
||||
enabled for selected transforms in a multi-transform operation.
|
||||
and `TJ.FLAG_PROGRESSIVE`, respectively) that causes compression and transform
|
||||
operations to generate progressive JPEG images. Additionally, a new transform
|
||||
option (`TJXOPT_PROGRESSIVE` in the C API and `TJTransform.OPT_PROGRESSIVE` in
|
||||
the Java API) has been introduced, allowing progressive JPEG images to be
|
||||
generated by selected transforms in a multi-transform operation.
|
||||
|
||||
6. Introduced a new transform option in the TurboJPEG API (`TJXOPT_COPYNONE` in
|
||||
the C API and `TJTransform.OPT_COPYNONE` in the Java API) that allows the
|
||||
|
||||
@@ -117,31 +117,31 @@ Macros</h2></td></tr>
|
||||
<tr class="memdesc:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="mdescLeft"> </td><td class="mdescRight">The number of transform operations. <br /></td></tr>
|
||||
<tr class="separator:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga50e03cb5ed115330e212417429600b00" id="r_ga50e03cb5ed115330e212417429600b00"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">TJXOPT_PERFECT</a></td></tr>
|
||||
<tr class="memdesc:ga50e03cb5ed115330e212417429600b00"><td class="mdescLeft"> </td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect. <br /></td></tr>
|
||||
<tr class="memdesc:ga50e03cb5ed115330e212417429600b00"><td class="mdescLeft"> </td><td class="mdescRight">This option causes <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect. <br /></td></tr>
|
||||
<tr class="separator:ga50e03cb5ed115330e212417429600b00"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga319826b7eb1583c0595bbe7b95428709" id="r_ga319826b7eb1583c0595bbe7b95428709"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709">TJXOPT_TRIM</a></td></tr>
|
||||
<tr class="memdesc:ga319826b7eb1583c0595bbe7b95428709"><td class="mdescLeft"> </td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to discard any partial MCU blocks that cannot be transformed. <br /></td></tr>
|
||||
<tr class="memdesc:ga319826b7eb1583c0595bbe7b95428709"><td class="mdescLeft"> </td><td class="mdescRight">Discard any partial MCU blocks that cannot be transformed. <br /></td></tr>
|
||||
<tr class="separator:ga319826b7eb1583c0595bbe7b95428709"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga9c771a757fc1294add611906b89ab2d2" id="r_ga9c771a757fc1294add611906b89ab2d2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">TJXOPT_CROP</a></td></tr>
|
||||
<tr class="memdesc:ga9c771a757fc1294add611906b89ab2d2"><td class="mdescLeft"> </td><td class="mdescRight">This option will enable lossless cropping. <br /></td></tr>
|
||||
<tr class="memdesc:ga9c771a757fc1294add611906b89ab2d2"><td class="mdescLeft"> </td><td class="mdescRight">Enable lossless cropping. <br /></td></tr>
|
||||
<tr class="separator:ga9c771a757fc1294add611906b89ab2d2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga3acee7b48ade1b99e5588736007c2589" id="r_ga3acee7b48ade1b99e5588736007c2589"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589">TJXOPT_GRAY</a></td></tr>
|
||||
<tr class="memdesc:ga3acee7b48ade1b99e5588736007c2589"><td class="mdescLeft"> </td><td class="mdescRight">This option will discard the color data in the source image and produce a grayscale destination image. <br /></td></tr>
|
||||
<tr class="memdesc:ga3acee7b48ade1b99e5588736007c2589"><td class="mdescLeft"> </td><td class="mdescRight">Discard the color data in the source image, and generate a grayscale destination image. <br /></td></tr>
|
||||
<tr class="separator:ga3acee7b48ade1b99e5588736007c2589"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gafbf992bbf6e006705886333703ffab31" id="r_gafbf992bbf6e006705886333703ffab31"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31">TJXOPT_NOOUTPUT</a></td></tr>
|
||||
<tr class="memdesc:gafbf992bbf6e006705886333703ffab31"><td class="mdescLeft"> </td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from outputting a JPEG image for this particular transform. <br /></td></tr>
|
||||
<tr class="memdesc:gafbf992bbf6e006705886333703ffab31"><td class="mdescLeft"> </td><td class="mdescRight">Do not generate a destination image. <br /></td></tr>
|
||||
<tr class="separator:gafbf992bbf6e006705886333703ffab31"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gad2371c80674584ecc1a7d75e564cf026" id="r_gad2371c80674584ecc1a7d75e564cf026"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026">TJXOPT_PROGRESSIVE</a></td></tr>
|
||||
<tr class="memdesc:gad2371c80674584ecc1a7d75e564cf026"><td class="mdescLeft"> </td><td class="mdescRight">This option will enable progressive entropy coding in the JPEG image generated by this particular transform. <br /></td></tr>
|
||||
<tr class="memdesc:gad2371c80674584ecc1a7d75e564cf026"><td class="mdescLeft"> </td><td class="mdescRight">Generate a progressive destination image instead of a single-scan destination image. <br /></td></tr>
|
||||
<tr class="separator:gad2371c80674584ecc1a7d75e564cf026"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga153b468cfb905d0de61706c838986fe8" id="r_ga153b468cfb905d0de61706c838986fe8"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8">TJXOPT_COPYNONE</a></td></tr>
|
||||
<tr class="memdesc:ga153b468cfb905d0de61706c838986fe8"><td class="mdescLeft"> </td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image. <br /></td></tr>
|
||||
<tr class="memdesc:ga153b468cfb905d0de61706c838986fe8"><td class="mdescLeft"> </td><td class="mdescRight">Do not copy any extra markers (including EXIF and ICC profile data) from the source image to the destination image. <br /></td></tr>
|
||||
<tr class="separator:ga153b468cfb905d0de61706c838986fe8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaecaaa3b7e2af812592c015d83207f010" id="r_gaecaaa3b7e2af812592c015d83207f010"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010">TJXOPT_ARITHMETIC</a></td></tr>
|
||||
<tr class="memdesc:gaecaaa3b7e2af812592c015d83207f010"><td class="mdescLeft"> </td><td class="mdescRight">This option will enable arithmetic entropy coding in the JPEG image generated by this particular transform. <br /></td></tr>
|
||||
<tr class="memdesc:gaecaaa3b7e2af812592c015d83207f010"><td class="mdescLeft"> </td><td class="mdescRight">Enable arithmetic entropy coding in the destination image. <br /></td></tr>
|
||||
<tr class="separator:gaecaaa3b7e2af812592c015d83207f010"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6bedf37aa9e1122f3ec9f7302ca59117" id="r_ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117">TJXOPT_OPTIMIZE</a></td></tr>
|
||||
<tr class="memdesc:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="mdescLeft"> </td><td class="mdescRight">This option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform. <br /></td></tr>
|
||||
<tr class="memdesc:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="mdescLeft"> </td><td class="mdescRight">Enable Huffman table optimization for the destination image. <br /></td></tr>
|
||||
<tr class="separator:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga84878bb65404204743aa18cac02781df" id="r_ga84878bb65404204743aa18cac02781df"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df">TJSCALED</a>(dimension, scalingFactor)</td></tr>
|
||||
<tr class="memdesc:ga84878bb65404204743aa18cac02781df"><td class="mdescLeft"> </td><td class="mdescRight">Compute the scaled value of <code>dimension</code> using the given scaling factor. <br /></td></tr>
|
||||
@@ -563,8 +563,8 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will enable arithmetic entropy coding in the JPEG image generated by this particular transform. </p>
|
||||
<p>Arithmetic entropy coding will generally improve compression relative to Huffman entropy coding (the default), but it will reduce decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="This option will enable progressive entropy coding in the JPEG image generated by this particular tra...">TJXOPT_PROGRESSIVE</a>. </p>
|
||||
<p>Enable arithmetic entropy coding in the destination image. </p>
|
||||
<p>Arithmetic entropy coding generally improves compression relative to Huffman entropy coding (the default), but it reduces decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="Generate a progressive destination image instead of a single-scan destination image.">TJXOPT_PROGRESSIVE</a>. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -580,7 +580,7 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image. </p>
|
||||
<p>Do not copy any extra markers (including EXIF and ICC profile data) from the source image to the destination image. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -596,7 +596,7 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will enable lossless cropping. </p>
|
||||
<p>Enable lossless cropping. </p>
|
||||
<p>See <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> for more information. </p>
|
||||
|
||||
</div>
|
||||
@@ -613,7 +613,7 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will discard the color data in the source image and produce a grayscale destination image. </p>
|
||||
<p>Discard the color data in the source image, and generate a grayscale destination image. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -629,7 +629,7 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from outputting a JPEG image for this particular transform. </p>
|
||||
<p>Do not generate a destination image. </p>
|
||||
<p>(This can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) </p>
|
||||
|
||||
</div>
|
||||
@@ -646,8 +646,8 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform. </p>
|
||||
<p>Optimized baseline entropy coding will improve compression slightly (generally 5% or less.) </p>
|
||||
<p>Enable Huffman table optimization for the destination image. </p>
|
||||
<p>Huffman table optimization improves compression slightly (generally 5% or less.) </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -663,8 +663,8 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect. </p>
|
||||
<p>Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used (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> and <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>.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image. </p>
|
||||
<p>This option causes <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect. </p>
|
||||
<p>Lossless transforms operate on MCU blocks, the size of which depends on the level of chrominance subsampling used (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> and <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>.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -680,8 +680,8 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will enable progressive entropy coding in the JPEG image generated by this particular transform. </p>
|
||||
<p>Progressive entropy coding will generally improve compression relative to baseline entropy coding (the default), but it will reduce decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="This option will enable optimized baseline entropy coding in the JPEG image generated by this particu...">TJXOPT_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a> is also specified. </p>
|
||||
<p>Generate a progressive destination image instead of a single-scan destination image. </p>
|
||||
<p>Progressive JPEG images generally have better compression ratios than single-scan JPEG images (much better if the image has large areas of solid color), but progressive JPEG decompression is considerably slower than single-scan JPEG decompression. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="Enable arithmetic entropy coding in the destination image.">TJXOPT_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="Enable Huffman table optimization for the destination image.">TJXOPT_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="Enable arithmetic entropy coding in the destination image.">TJXOPT_ARITHMETIC</a> is also specified. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -697,7 +697,7 @@ scalingFactor)</code>. </p>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to discard any partial MCU blocks that cannot be transformed. </p>
|
||||
<p>Discard any partial MCU blocks that cannot be transformed. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -750,19 +750,19 @@ scalingFactor)</code>. </p>
|
||||
<p>JPEG colorspaces. </p>
|
||||
<table class="fieldtable">
|
||||
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555" name="gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555"></a>TJCS_RGB </td><td class="fielddoc"><p>RGB colorspace. </p>
|
||||
<p>When compressing the JPEG image, the R, G, and B components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. RGB JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, but they cannot be compressed from or decompressed to planar YUV images. </p>
|
||||
<p>When generating the JPEG image, the R, G, and B components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. RGB JPEG images can be generated from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, but they cannot be generated from or decompressed to planar YUV images. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" name="gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75"></a>TJCS_YCbCr </td><td class="fielddoc"><p>YCbCr colorspace. </p>
|
||||
<p>YCbCr is not an absolute colorspace but rather a mathematical transformation of RGB designed solely for storage and transmission. YCbCr images must be converted to RGB before they can actually be displayed. In the YCbCr colorspace, the Y (luminance) component represents the black & white portion of the original image, and the Cb and Cr (chrominance) components represent the color portion of the original image. Originally, the analog equivalent of this transformation allowed the same signal to drive both black & white and color televisions, but JPEG images use YCbCr primarily because it allows the color data to be optionally subsampled for the purposes of reducing network or disk usage. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats. YCbCr JPEG images can also be compressed from and decompressed to planar YUV images. </p>
|
||||
<p>YCbCr is not an absolute colorspace but rather a mathematical transformation of RGB designed solely for storage and transmission. YCbCr images must be converted to RGB before they can be displayed. In the YCbCr colorspace, the Y (luminance) component represents the black & white portion of the original image, and the Cb and Cr (chrominance) components represent the color portion of the original image. Historically, the analog equivalent of this transformation allowed the same signal to be displayed to both black & white and color televisions, but JPEG images use YCbCr primarily because it allows the color data to be optionally subsampled in order to reduce network and disk usage. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images can be generated from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats. YCbCr JPEG images can also be generated from and decompressed to planar YUV images. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a" name="gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a"></a>TJCS_GRAY </td><td class="fielddoc"><p>Grayscale colorspace. </p>
|
||||
<p>The JPEG image retains only the luminance data (Y component), and any color data from the source image is discarded. Grayscale JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, or they can be compressed from and decompressed to planar YUV images. </p>
|
||||
<p>The JPEG image retains only the luminance data (Y component), and any color data from the source image is discarded. Grayscale JPEG images can be generated from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, or they can be generated from and decompressed to planar YUV images. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53" name="gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53"></a>TJCS_CMYK </td><td class="fielddoc"><p>CMYK colorspace. </p>
|
||||
<p>When compressing the JPEG image, the C, M, Y, and K components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. CMYK JPEG images can only be compressed from and decompressed to packed-pixel images with the CMYK pixel format. </p>
|
||||
<p>When generating the JPEG image, the C, M, Y, and K components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. CMYK JPEG images can only be generated from and decompressed to packed-pixel images with the CMYK pixel format. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" name="gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e"></a>TJCS_YCCK </td><td class="fielddoc"><p>YCCK colorspace. </p>
|
||||
<p>YCCK (AKA "YCbCrK") is not an absolute colorspace but rather a mathematical transformation of CMYK designed solely for storage and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be reversibly transformed into YCCK, and as with YCbCr, the chrominance components in the YCCK pixels can be subsampled without incurring major perceptual loss. YCCK JPEG images can only be compressed from and decompressed to packed-pixel images with the CMYK pixel format. </p>
|
||||
<p>YCCK (AKA "YCbCrK") is not an absolute colorspace but rather a mathematical transformation of CMYK designed solely for storage and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be reversibly transformed into YCCK, and as with YCbCr, the chrominance components in the YCCK pixels can be subsampled without incurring major perceptual loss. YCCK JPEG images can only be generated from and decompressed to packed-pixel images with the CMYK pixel format. </p>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -866,7 +866,7 @@ scalingFactor)</code>. </p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li><code>8</code>, <code>12</code>, or <code>16</code></li>
|
||||
</ul>
|
||||
<p>12-bit data precision implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Optimized baseline entropy coding [lossy compression only].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is set. </p>
|
||||
<p>12-bit data precision implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Huffman table optimization [lossy compression, lossless transformation].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is set. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c" name="ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c"></a>TJPARAM_COLORSPACE </td><td class="fielddoc"><p>JPEG colorspace. </p>
|
||||
<p>The JPEG image uses (decompression) or will use (lossy compression) the specified colorspace.</p>
|
||||
@@ -876,7 +876,7 @@ scalingFactor)</code>. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0" name="ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0"></a>TJPARAM_FASTUPSAMPLE </td><td class="fielddoc"><p>Chrominance upsampling algorithm [lossy decompression only]. </p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li><code>0</code> <em>[default]</em> Use smooth upsampling when decompressing a JPEG image that was compressed using chrominance subsampling. This creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image.</li>
|
||||
<li><code>0</code> <em>[default]</em> Use smooth upsampling when decompressing a JPEG image that was generated using chrominance subsampling. This creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image.</li>
|
||||
<li><code>1</code> Use the fastest chrominance upsampling algorithm available, which may combine upsampling with color conversion. </li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
@@ -889,48 +889,49 @@ scalingFactor)</code>. </p>
|
||||
<li>The "fast" and "accurate" DCT/IDCT algorithms perform similarly on modern x86/x86-64 CPUs that support AVX2 instructions.</li>
|
||||
<li>The "fast" algorithm is generally only about 5-15% faster than the "accurate" algorithm on other types of CPUs.</li>
|
||||
<li>The difference in accuracy between the "fast" and "accurate" algorithms is the most pronounced at JPEG quality levels above 90 and tends to be more pronounced with decompression than with compression.</li>
|
||||
<li>The "fast" algorithm degrades and is not fully accelerated for JPEG quality levels above 97, so it will be slower than the "accurate" algorithm. </li>
|
||||
<li>For JPEG quality levels above 97, the "fast" algorithm degrades and is not fully accelerated, so it is slower than the "accurate" algorithm. </li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" name="ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6"></a>TJPARAM_OPTIMIZE </td><td class="fielddoc"><p>Optimized baseline entropy coding [lossy compression only]. </p>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" name="ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6"></a>TJPARAM_OPTIMIZE </td><td class="fielddoc"><p>Huffman table optimization [lossy compression, lossless transformation]. </p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li><code>0</code> <em>[default]</em> The JPEG image will use the default Huffman tables.</li>
|
||||
<li><code>1</code> Optimal Huffman tables will be computed for the JPEG image. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="This option will enable optimized baseline entropy coding in the JPEG image generated by this particu...">TJXOPT_OPTIMIZE</a>.</li>
|
||||
<li><code>1</code> Optimal Huffman tables will be computed for the JPEG image. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="Enable Huffman table optimization for the destination image.">TJXOPT_OPTIMIZE</a>.</li>
|
||||
</ul>
|
||||
<p>Optimized baseline entropy coding will improve compression slightly (generally 5% or less), but it will reduce compression performance considerably. </p>
|
||||
<p>Huffman table optimization improves compression slightly (generally 5% or less), but it reduces compression performance considerably. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" name="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f"></a>TJPARAM_PROGRESSIVE </td><td class="fielddoc"><p>Progressive entropy coding. </p>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" name="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f"></a>TJPARAM_PROGRESSIVE </td><td class="fielddoc"><p>Progressive JPEG. </p>
|
||||
<p>In a progressive JPEG image, the DCT coefficients are split across multiple "scans" of increasing quality. Thus, a low-quality scan containing the lowest-frequency DCT coefficients can be transmitted first and refined with subsequent higher-quality scans containing higher-frequency DCT coefficients. When using Huffman entropy coding, the progressive JPEG format also provides an "end-of-bands (EOB) run" feature that allows large groups of zeroes, potentially spanning multiple MCU blocks, to be represented using only a few bytes.</p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li><code>0</code> <em>[default for compression, lossless transformation]</em> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) baseline entropy coding.</li>
|
||||
<li><code>1</code> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) progressive entropy coding. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="This option will enable progressive entropy coding in the JPEG image generated by this particular tra...">TJXOPT_PROGRESSIVE</a>.</li>
|
||||
<li><code>0</code> <em>[default for compression, lossless transformation]</em> The lossy JPEG image is (decompression) or will be (compression, lossless transformation) single-scan.</li>
|
||||
<li><code>1</code> The lossy JPEG image is (decompression) or will be (compression, lossless transformation) progressive. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="Generate a progressive destination image instead of a single-scan destination image.">TJXOPT_PROGRESSIVE</a>.</li>
|
||||
</ul>
|
||||
<p>Progressive entropy coding will generally improve compression relative to baseline entropy coding, but it will reduce compression and decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Optimized baseline entropy coding [lossy compression only].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is also set. </p>
|
||||
<p>Progressive JPEG images generally have better compression ratios than single-scan JPEG images (much better if the image has large areas of solid color), but progressive JPEG compression and decompression is considerably slower than single-scan JPEG compression and decompression. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Huffman table optimization [lossy compression, lossless transformation].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is also set. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167" name="ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167"></a>TJPARAM_SCANLIMIT </td><td class="fielddoc"><p>Progressive JPEG scan limit for lossy JPEG images [decompression, lossless transformation]. </p>
|
||||
<p>Setting this parameter will cause the decompression and transform functions to return an error if the number of scans in a progressive JPEG image exceeds the specified limit. The primary purpose of this is to allow security-critical applications to guard against an exploit of the progressive JPEG format described in <a href="https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf" target="_blank">this report</a>.</p>
|
||||
<p>Setting this parameter causes the decompression and transform functions to return an error if the number of scans in a progressive JPEG image exceeds the specified limit. The primary purpose of this is to allow security-critical applications to guard against an exploit of the progressive JPEG format described in <a href="https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf" target="_blank">this report</a>.</p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li>maximum number of progressive JPEG scans that the decompression and transform functions will process <em>[default: <code>0</code> (no limit)]</em></li>
|
||||
</ul>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive entropy coding.">TJPARAM_PROGRESSIVE</a> </dd></dl>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive JPEG.">TJPARAM_PROGRESSIVE</a> </dd></dl>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" name="ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7"></a>TJPARAM_ARITHMETIC </td><td class="fielddoc"><p>Arithmetic entropy coding. </p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li><code>0</code> <em>[default for compression, lossless transformation]</em> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) Huffman entropy coding.</li>
|
||||
<li><code>1</code> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) arithmetic entropy coding. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a>.</li>
|
||||
<li><code>1</code> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) arithmetic entropy coding. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="Enable arithmetic entropy coding in the destination image.">TJXOPT_ARITHMETIC</a>.</li>
|
||||
</ul>
|
||||
<p>Arithmetic entropy coding will generally improve compression relative to Huffman entropy coding, but it will reduce compression and decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive entropy coding.">TJPARAM_PROGRESSIVE</a>. </p>
|
||||
<p>Arithmetic entropy coding generally improves compression relative to Huffman entropy coding, but it reduces compression and decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive JPEG.">TJPARAM_PROGRESSIVE</a>. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f" name="ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f"></a>TJPARAM_LOSSLESS </td><td class="fielddoc"><p>Lossless JPEG. </p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li><code>0</code> <em>[default for compression]</em> The JPEG image is (decompression) or will be (compression) lossy/DCT-based.</li>
|
||||
<li><code>1</code> The JPEG image is (decompression) or will be (compression) lossless/predictive.</li>
|
||||
</ul>
|
||||
<p>In most cases, compressing and decompressing lossless JPEG images is considerably slower than compressing and decompressing lossy JPEG images, and lossless JPEG images are much larger than lossy JPEG images. Thus, lossless JPEG images are typically used only for applications that require mathematically lossless compression. Also note that the following features are not available with lossless JPEG images:</p><ul>
|
||||
<p>In most cases, lossless JPEG compression and decompression is considerably slower than lossy JPEG compression and decompression, and lossless JPEG images are much larger than lossy JPEG images. Thus, lossless JPEG images are typically used only for applications that require mathematically lossless compression. Also note that the following features are not available with lossless JPEG images:</p><ul>
|
||||
<li>Colorspace conversion (lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555" title="RGB colorspace.">TJCS_RGB</a>, <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a" title="Grayscale colorspace.">TJCS_GRAY</a>, or <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53" title="CMYK colorspace.">TJCS_CMYK</a>, depending on the pixel format of the source image)</li>
|
||||
<li>Chrominance subsampling (lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>)</li>
|
||||
<li>Chrominance subsampling (lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling)">TJSAMP_444</a>)</li>
|
||||
<li>JPEG quality selection</li>
|
||||
<li>DCT/IDCT algorithm selection</li>
|
||||
<li>Progressive entropy coding</li>
|
||||
<li>Progressive JPEG</li>
|
||||
<li>Arithmetic entropy coding</li>
|
||||
<li>Compression from/decompression to planar YUV images</li>
|
||||
<li>Decompression scaling</li>
|
||||
@@ -1010,11 +1011,11 @@ scalingFactor)</code>. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a0de0a8281da45d1fc984edc8918f7dd2" name="ggaa0f6be63ba78278299c9f5c12031fe82a0de0a8281da45d1fc984edc8918f7dd2"></a>TJPARAM_MAXMEMORY </td><td class="fielddoc"><p>Memory limit for intermediate buffers. </p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li>the maximum amount of memory (in megabytes) that will be allocated for intermediate buffers, which are used with progressive JPEG compression and decompression, optimized baseline entropy coding, lossless JPEG compression, and lossless transformation <em>[default: <code>0</code> (no limit)]</em> </li>
|
||||
<li>the maximum amount of memory (in megabytes) that will be allocated for intermediate buffers, which are used with progressive JPEG compression and decompression, Huffman table optimization, lossless JPEG compression, and lossless transformation <em>[default: <code>0</code> (no limit)]</em> </li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82ac4e95dd2ecd766854feee579406eae68" name="ggaa0f6be63ba78278299c9f5c12031fe82ac4e95dd2ecd766854feee579406eae68"></a>TJPARAM_MAXPIXELS </td><td class="fielddoc"><p>Image size limit [decompression, lossless transformation, packed-pixel image loading]. </p>
|
||||
<p>Setting this parameter will cause the decompression, transform, and image loading functions to return an error if the number of pixels in the source image exceeds the specified limit. This allows security-critical applications to guard against excessive memory consumption.</p>
|
||||
<p>Setting this parameter causes the decompression, transform, and image loading functions to return an error if the number of pixels in the source image exceeds the specified limit. This allows security-critical applications to guard against excessive memory consumption.</p>
|
||||
<p><b>Value</b></p><ul>
|
||||
<li>maximum number of pixels that the decompression, transform, and image loading functions will process <em>[default: <code>0</code> (no limit)]</em> </li>
|
||||
</ul>
|
||||
@@ -1044,31 +1045,31 @@ scalingFactor)</code>. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 3-sample pixels in the order B, G, R from lowest to highest memory address within each pixel. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01" name="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01"></a>TJPF_RGBX </td><td class="fielddoc"><p>RGBX pixel format. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from lowest to highest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from lowest to highest memory address within each pixel. The X component is ignored when compressing/encoding and undefined when decompressing/decoding. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8" name="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8"></a>TJPF_BGRX </td><td class="fielddoc"><p>BGRX pixel format. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from lowest to highest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from lowest to highest memory address within each pixel. The X component is ignored when compressing/encoding and undefined when decompressing/decoding. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af" name="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af"></a>TJPF_XBGR </td><td class="fielddoc"><p>XBGR pixel format. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from highest to lowest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from highest to lowest memory address within each pixel. The X component is ignored when compressing/encoding and undefined when decompressing/decoding. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84" name="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84"></a>TJPF_XRGB </td><td class="fielddoc"><p>XRGB pixel format. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from highest to lowest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from highest to lowest memory address within each pixel. The X component is ignored when compressing/encoding and undefined when decompressing/decoding. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a" name="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a"></a>TJPF_GRAY </td><td class="fielddoc"><p>Grayscale pixel format. </p>
|
||||
<p>Each 1-sample pixel represents a luminance (brightness) level from 0 to the maximum sample value (255 for 8-bit samples, 4095 for 12-bit samples, and 65535 for 16-bit samples.) </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12" name="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12"></a>TJPF_RGBA </td><td class="fielddoc"><p>RGBA pixel format. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, except that when decompressing/decoding, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4" name="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4"></a>TJPF_BGRA </td><td class="fielddoc"><p>BGRA pixel format. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, except that when decompressing/decoding, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081" name="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081"></a>TJPF_ABGR </td><td class="fielddoc"><p>ABGR pixel format. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, except that when decompressing/decoding, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c" name="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c"></a>TJPF_ARGB </td><td class="fielddoc"><p>ARGB pixel format. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, except that when decompressing/decoding, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b" name="ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b"></a>TJPF_CMYK </td><td class="fielddoc"><p>CMYK pixel format. </p>
|
||||
<p>Unlike RGB, which is an additive color model used primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive color model used primarily for printing. In the CMYK color model, the value of each color component typically corresponds to an amount of cyan, magenta, yellow, or black ink that is applied to a white background. In order to convert between CMYK and RGB, it is necessary to use a color management system (CMS.) A CMS will attempt to map colors within the printer's gamut to perceptually similar colors in the display's gamut and vice versa, but the mapping is typically not 1:1 or reversible, nor can it be defined with a simple formula. Thus, such a conversion is out of scope for a codec library. However, the TurboJPEG API allows for compressing packed-pixel CMYK images into YCCK JPEG images (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) and decompressing YCCK JPEG images into packed-pixel CMYK images. </p>
|
||||
@@ -1093,36 +1094,36 @@ scalingFactor)</code>. </p>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Chrominance subsampling options. </p>
|
||||
<p>When pixels are converted from RGB to YCbCr (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" title="YCbCr colorspace.">TJCS_YCbCr</a>) or from CMYK to YCCK (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity. (The human eye is more sensitive to small changes in brightness than to small changes in color.) This is called "chrominance subsampling". </p>
|
||||
<p>When pixels are converted from RGB to YCbCr (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" title="YCbCr colorspace.">TJCS_YCbCr</a>) or from CMYK to YCCK (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image quality. (The human eye is more sensitive to small changes in brightness than to small changes in color.) This is called "chrominance subsampling". </p>
|
||||
<table class="fieldtable">
|
||||
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" name="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444 </td><td class="fielddoc"><p>4:4:4 chrominance subsampling (no chrominance subsampling). </p>
|
||||
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" name="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444 </td><td class="fielddoc"><p>4:4:4 chrominance subsampling (no chrominance subsampling) </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every pixel in the source image. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404" name="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404"></a>TJSAMP_422 </td><td class="fielddoc"><p>4:2:2 chrominance subsampling. </p>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404" name="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404"></a>TJSAMP_422 </td><td class="fielddoc"><p>4:2:2 chrominance subsampling </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 2x1 block of pixels in the source image. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737" name="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737"></a>TJSAMP_420 </td><td class="fielddoc"><p>4:2:0 chrominance subsampling. </p>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737" name="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737"></a>TJSAMP_420 </td><td class="fielddoc"><p>4:2:0 chrominance subsampling </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 2x2 block of pixels in the source image. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248" name="gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248"></a>TJSAMP_GRAY </td><td class="fielddoc"><p>Grayscale. </p>
|
||||
<p>The JPEG or YUV image will contain no chrominance components. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974" name="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440 </td><td class="fielddoc"><p>4:4:0 chrominance subsampling. </p>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974" name="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440 </td><td class="fielddoc"><p>4:4:0 chrominance subsampling </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2" name="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2"></a>TJSAMP_411 </td><td class="fielddoc"><p>4:1:1 chrominance subsampling. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.</p>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2" name="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2"></a>TJSAMP_411 </td><td class="fielddoc"><p>4:1:1 chrominance subsampling </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. All else being equal, a JPEG image with 4:1:1 subsampling is almost exactly the same size as a JPEG image with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d" name="gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d"></a>TJSAMP_441 </td><td class="fielddoc"><p>4:4:1 chrominance subsampling. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 1x4 block of pixels in the source image. JPEG images compressed with 4:4:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:4:1 is better able to reproduce sharp vertical features.</p>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d" name="gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d"></a>TJSAMP_441 </td><td class="fielddoc"><p>4:4:1 chrominance subsampling </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 1x4 block of pixels in the source image. All else being equal, a JPEG image with 4:4:1 subsampling is almost exactly the same size as a JPEG image with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:4:1 is better able to reproduce sharp vertical features.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>4:4:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173" name="gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173"></a>TJSAMP_UNKNOWN </td><td class="fielddoc"><p>Unknown subsampling. </p>
|
||||
<p>The JPEG image uses an unusual type of chrominance subsampling. Such images can be decompressed into packed-pixel images, but they cannot be</p><ul>
|
||||
<li>decompressed into planar YUV images,</li>
|
||||
<li>losslessly transformed if <a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2" title="This option will enable lossless cropping.">TJXOPT_CROP</a> is specified, or</li>
|
||||
<li>losslessly transformed if <a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2" title="Enable lossless cropping.">TJXOPT_CROP</a> is specified, or</li>
|
||||
<li>partially decompressed using a cropping region. </li>
|
||||
</ul>
|
||||
</td></tr>
|
||||
@@ -1147,23 +1148,23 @@ scalingFactor)</code>. </p>
|
||||
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27" name="gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27"></a>TJXOP_NONE </td><td class="fielddoc"><p>Do not transform the position of the image pixels. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce" name="gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce"></a>TJXOP_HFLIP </td><td class="fielddoc"><p>Flip (mirror) image horizontally. </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option causes tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d" name="gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d"></a>TJXOP_VFLIP </td><td class="fielddoc"><p>Flip (mirror) image vertically. </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option causes tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d" name="gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d"></a>TJXOP_TRANSPOSE </td><td class="fielddoc"><p>Transpose image (flip/mirror along upper left to lower right axis.) This transform is always perfect. </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4" name="gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4"></a>TJXOP_TRANSVERSE </td><td class="fielddoc"><p>Transverse transpose image (flip/mirror along upper right to lower left axis.) This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4" name="gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4"></a>TJXOP_TRANSVERSE </td><td class="fielddoc"><p>Transverse transpose image (flip/mirror along upper right to lower left axis.) This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option causes tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128" name="gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128"></a>TJXOP_ROT90 </td><td class="fielddoc"><p>Rotate image clockwise by 90 degrees. </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option causes tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692" name="gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692"></a>TJXOP_ROT180 </td><td class="fielddoc"><p>Rotate image 180 degrees. </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option causes tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08" name="gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08"></a>TJXOP_ROT270 </td><td class="fielddoc"><p>Rotate image counter-clockwise by 90 degrees. </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option causes tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -2540,7 +2541,7 @@ If you choose option 1, then <code>*jpegSize</code> should be set to the size of
|
||||
<table class="params">
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the image</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>.) <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173" title="Unknown subsampling.">TJSAMP_UNKNOWN</a> is treated like <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>, since a buffer large enough to hold a JPEG image with no subsampling should also be large enough to hold a JPEG image with an arbitrary level of subsampling. Note that lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</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>.) <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173" title="Unknown subsampling.">TJSAMP_UNKNOWN</a> is treated like <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling)">TJSAMP_444</a>, since a buffer large enough to hold a JPEG image with no subsampling should also be large enough to hold a JPEG image with an arbitrary level of subsampling. Note that lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling)">TJSAMP_444</a>.</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -2606,7 +2607,7 @@ If you choose option 1, then <code>*jpegSize</code> should be set to the size of
|
||||
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
|
||||
<tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
|
||||
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function varies depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick & dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
|
||||
@@ -2678,7 +2679,7 @@ If you choose option 1, then <code>*jpegSize</code> should be set to the size of
|
||||
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
|
||||
<tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
|
||||
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function varies depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick & dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
|
||||
@@ -2750,7 +2751,7 @@ If you choose option 1, then <code>*jpegSize</code> should be set to the size of
|
||||
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
|
||||
<tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
|
||||
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function varies depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
|
||||
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick & dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
|
||||
@@ -3329,9 +3330,9 @@ If you choose option 1, then <code>dstSizes[i]</code> should be set to the size
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the YUV image. NOTE: this is the width of the whole image, not the plane width.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the YUV image. NOTE: This is the width of the whole image, not the plane width.</td></tr>
|
||||
<tr><td class="paramname">stride</td><td>bytes per row in the image plane. Setting this to 0 is the equivalent of setting it to the plane width.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the YUV image. NOTE: this is the height of the whole image, not the plane height.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the YUV image. NOTE: This is the height of the whole image, not the plane height.</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>
|
||||
</dd>
|
||||
@@ -3408,7 +3409,7 @@ If you choose option 1, then <code>dstSizes[i]</code> should be set to the size
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Alpha offset (in samples) for a given pixel format. </p>
|
||||
<p>This specifies the number of samples that the alpha component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRA is stored in <code>unsigned char pixel[]</code>, then the alpha component will be <code>pixel[tjAlphaOffset[TJPF_BGRA]]</code>. This will be -1 if the pixel format does not have an alpha component. </p>
|
||||
<p>This specifies the number of samples that the alpha component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRA is stored in <code>unsigned char pixel[]</code>, then the alpha component is <code>pixel[tjAlphaOffset[TJPF_BGRA]]</code>. The offset is -1 if the pixel format does not have an alpha component. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -3433,7 +3434,7 @@ If you choose option 1, then <code>dstSizes[i]</code> should be set to the size
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Blue offset (in samples) for a given pixel format. </p>
|
||||
<p>This specifies the number of samples that the blue component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the blue component will be <code>pixel[tjBlueOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a blue component. </p>
|
||||
<p>This specifies the number of samples that the blue component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the blue component is <code>pixel[tjBlueOffset[TJPF_BGRX]]</code>. The offset is -1 if the pixel format does not have a blue component. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -3458,7 +3459,7 @@ If you choose option 1, then <code>dstSizes[i]</code> should be set to the size
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Green offset (in samples) for a given pixel format. </p>
|
||||
<p>This specifies the number of samples that the green component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the green component will be <code>pixel[tjGreenOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a green component. </p>
|
||||
<p>This specifies the number of samples that the green component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the green component is <code>pixel[tjGreenOffset[TJPF_BGRX]]</code>. The offset is -1 if the pixel format does not have a green component. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -3571,7 +3572,7 @@ If you choose option 1, then <code>dstSizes[i]</code> should be set to the size
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Red offset (in samples) for a given pixel format. </p>
|
||||
<p>This specifies the number of samples that the red component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the red component will be <code>pixel[tjRedOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a red component. </p>
|
||||
<p>This specifies the number of samples that the red component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the red component is <code>pixel[tjRedOffset[TJPF_BGRX]]</code>. The offset is -1 if the pixel format does not have a red component. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -118,7 +118,7 @@ Data Fields</h2></td></tr>
|
||||
<p>This allows for custom filters or other transformations to be applied in the frequency domain.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<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">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>
|
||||
|
||||
@@ -566,7 +566,7 @@ final class TJBench {
|
||||
precision = tjt.get(TJ.PARAM_PRECISION);
|
||||
cs = tjt.get(TJ.PARAM_COLORSPACE);
|
||||
if (tjt.get(TJ.PARAM_PROGRESSIVE) == 1)
|
||||
System.out.println("JPEG image uses progressive entropy coding\n");
|
||||
System.out.println("JPEG image is progressive\n");
|
||||
if (tjt.get(TJ.PARAM_ARITHMETIC) == 1)
|
||||
System.out.println("JPEG image uses arithmetic entropy coding\n");
|
||||
tjt.set(TJ.PARAM_PROGRESSIVE, progressive ? 1 : 0);
|
||||
@@ -782,8 +782,8 @@ final class TJBench {
|
||||
System.out.println("-lossless = Generate lossless JPEG images when compressing (implies");
|
||||
System.out.println(" -subsamp 444). PSV is the predictor selection value (1-7).");
|
||||
System.out.println("-maxmemory = Memory limit (in megabytes) for intermediate buffers used with");
|
||||
System.out.println(" progressive JPEG compression and decompression, optimized baseline entropy");
|
||||
System.out.println(" coding, lossless JPEG compression, and lossless transformation");
|
||||
System.out.println(" progressive JPEG compression and decompression, Huffman table");
|
||||
System.out.println(" optimization, lossless JPEG compression, and lossless transformation");
|
||||
System.out.println(" [default = no limit]");
|
||||
System.out.println("-maxpixels = Input image size limit (in pixels) [default = no limit]");
|
||||
System.out.println("-nowrite = Do not write reference or output images (improves consistency of");
|
||||
@@ -821,11 +821,11 @@ final class TJBench {
|
||||
System.out.println(" the scaled MCU width.");
|
||||
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithm available");
|
||||
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available");
|
||||
System.out.println("-optimize = Use optimized baseline entropy coding in JPEG images generated by");
|
||||
System.out.println("-optimize = Compute optimal Huffman tables for JPEG images generated by");
|
||||
System.out.println(" compession and transform operations");
|
||||
System.out.println("-progressive = Use progressive entropy coding in JPEG images generated by");
|
||||
System.out.println(" compression and transform operations (can be combined with -arithmetic;");
|
||||
System.out.println(" implies -optimize unless -arithmetic is also specified)");
|
||||
System.out.println("-progressive = Generate progressive JPEG images when compressing or");
|
||||
System.out.println(" transforming (can be combined with -arithmetic; implies -optimize unless");
|
||||
System.out.println(" -arithmetic is also specified)");
|
||||
System.out.println("-limitscans = Refuse to decompress or transform progressive JPEG images that");
|
||||
System.out.println(" have an unreasonably large number of scans");
|
||||
System.out.println("-scale M/N = When decompressing, scale the width/height of the JPEG image by a");
|
||||
@@ -929,7 +929,7 @@ final class TJBench {
|
||||
optimize = true;
|
||||
xformOpt |= TJTransform.OPT_OPTIMIZE;
|
||||
} else if (argv[i].equalsIgnoreCase("-progressive")) {
|
||||
System.out.println("Using progressive entropy coding\n");
|
||||
System.out.println("Generating progressive JPEG images\n");
|
||||
progressive = true;
|
||||
xformOpt |= TJTransform.OPT_PROGRESSIVE;
|
||||
} else if (argv[i].equalsIgnoreCase("-arithmetic")) {
|
||||
@@ -1128,7 +1128,7 @@ final class TJBench {
|
||||
|
||||
if (optimize && !progressive && !arithmetic && !lossless &&
|
||||
precision != 12)
|
||||
System.out.println("Using optimized baseline entropy coding\n");
|
||||
System.out.println("Computing optimal Huffman tables\n");
|
||||
|
||||
if (precision == 16 && !lossless)
|
||||
throw new Exception("-lossless must be specified along with -precision 16");
|
||||
|
||||
@@ -150,23 +150,23 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_CMYK">CS_CMYK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">CMYK colorspace.</div>
|
||||
<div class="block">CMYK colorspace</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_GRAY">CS_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Grayscale colorspace.</div>
|
||||
<div class="block">Grayscale colorspace</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_RGB">CS_RGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">RGB colorspace.</div>
|
||||
<div class="block">RGB colorspace</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr">CS_YCbCr</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">YCbCr colorspace.</div>
|
||||
<div class="block">YCbCr colorspace</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK">CS_YCCK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">YCCK colorspace.</div>
|
||||
<div class="block">YCCK colorspace</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,java.awt.Rectangle,java.awt.Rectangle,int,int,org.libjpegturbo.turbojpeg.TJTransform)">customFilter(ShortBuffer, Rectangle, Rectangle, int, int, TJTransform)</a></span> - Method in interface org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></dt>
|
||||
<dd>
|
||||
@@ -670,47 +670,43 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_ARITHMETIC">OPT_ARITHMETIC</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will enable arithmetic entropy coding in the JPEG image
|
||||
generated by this particular transform.</div>
|
||||
<div class="block">Enable arithmetic entropy coding in the destination image.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_COPYNONE">OPT_COPYNONE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will prevent <a href="org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF
|
||||
and ICC profile data) from the source image to the destination image.</div>
|
||||
<div class="block">Do not copy any extra markers (including EXIF and ICC profile data) from
|
||||
the source image to the destination image.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will enable lossless cropping.</div>
|
||||
<div class="block">Enable lossless cropping.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will discard the color data in the source image and produce a
|
||||
grayscale destination image.</div>
|
||||
<div class="block">Discard the color data in the source image, and generate a grayscale
|
||||
destination image.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will prevent <a href="org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
particular transform.</div>
|
||||
<div class="block">Do not generate a destination image.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_OPTIMIZE">OPT_OPTIMIZE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will enable optimized baseline entropy coding in the JPEG
|
||||
image generated by this particular transform.</div>
|
||||
<div class="block">Enable Huffman table optimization for the destination image.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will cause <a href="org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
<div class="block">This option causes <a href="org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
perfect.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will enable progressive entropy coding in the JPEG image
|
||||
generated by this particular transform.</div>
|
||||
<div class="block">Generate a progressive destination image instead of a single-scan
|
||||
destination image.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will discard any partial MCU blocks that cannot be
|
||||
transformed.</div>
|
||||
<div class="block">Discard any partial MCU blocks that cannot be transformed.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJTransform.html#options">options</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
@@ -779,7 +775,7 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PARAM_OPTIMIZE">PARAM_OPTIMIZE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Optimized baseline entropy coding [lossy compression only]</div>
|
||||
<div class="block">Huffman table optimization [lossy compression, lossless transformation]</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PARAM_PRECISION">PARAM_PRECISION</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
@@ -787,7 +783,7 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PARAM_PROGRESSIVE">PARAM_PROGRESSIVE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Progressive entropy coding</div>
|
||||
<div class="block">Progressive JPEG</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PARAM_QUALITY">PARAM_QUALITY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
@@ -826,51 +822,51 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ABGR">PF_ABGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">ABGR pixel format.</div>
|
||||
<div class="block">ABGR pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_ARGB">PF_ARGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">ARGB pixel format.</div>
|
||||
<div class="block">ARGB pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGR">PF_BGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">BGR pixel format.</div>
|
||||
<div class="block">BGR pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRA">PF_BGRA</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">BGRA pixel format.</div>
|
||||
<div class="block">BGRA pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_BGRX">PF_BGRX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">BGRX pixel format.</div>
|
||||
<div class="block">BGRX pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_CMYK">PF_CMYK</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">CMYK pixel format.</div>
|
||||
<div class="block">CMYK pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_GRAY">PF_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Grayscale pixel format.</div>
|
||||
<div class="block">Grayscale pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGB">PF_RGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">RGB pixel format.</div>
|
||||
<div class="block">RGB pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBA">PF_RGBA</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">RGBA pixel format.</div>
|
||||
<div class="block">RGBA pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_RGBX">PF_RGBX</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">RGBX pixel format.</div>
|
||||
<div class="block">RGBX pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XBGR">PF_XBGR</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">XBGR pixel format.</div>
|
||||
<div class="block">XBGR pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#PF_XRGB">PF_XRGB</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">XRGB pixel format.</div>
|
||||
<div class="block">XRGB pixel format</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#planeHeight(int,int,int)">planeHeight(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
@@ -893,35 +889,35 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
||||
<dl>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_411">SAMP_411</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">4:1:1 chrominance subsampling.</div>
|
||||
<div class="block">4:1:1 chrominance subsampling</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_420">SAMP_420</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">4:2:0 chrominance subsampling.</div>
|
||||
<div class="block">4:2:0 chrominance subsampling</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_422">SAMP_422</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">4:2:2 chrominance subsampling.</div>
|
||||
<div class="block">4:2:2 chrominance subsampling</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_440">SAMP_440</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">4:4:0 chrominance subsampling.</div>
|
||||
<div class="block">4:4:0 chrominance subsampling</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_441">SAMP_441</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">4:4:1 chrominance subsampling.</div>
|
||||
<div class="block">4:4:1 chrominance subsampling</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_444">SAMP_444</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling).</div>
|
||||
<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling)</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_GRAY">SAMP_GRAY</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Grayscale.</div>
|
||||
<div class="block">Grayscale</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJ.html#SAMP_UNKNOWN">SAMP_UNKNOWN</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Unknown subsampling.</div>
|
||||
<div class="block">Unknown subsampling</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#set(int,int)">set(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
|
||||
Binary file not shown.
@@ -157,35 +157,35 @@ extends java.lang.Object</pre>
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CS_CMYK">CS_CMYK</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">CMYK colorspace.</div>
|
||||
<div class="block">CMYK colorspace</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CS_GRAY">CS_GRAY</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">Grayscale colorspace.</div>
|
||||
<div class="block">Grayscale colorspace</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CS_RGB">CS_RGB</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">RGB colorspace.</div>
|
||||
<div class="block">RGB colorspace</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CS_YCbCr">CS_YCbCr</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">YCbCr colorspace.</div>
|
||||
<div class="block">YCbCr colorspace</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#CS_YCCK">CS_YCCK</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">YCCK colorspace.</div>
|
||||
<div class="block">YCCK colorspace</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
@@ -389,7 +389,7 @@ extends java.lang.Object</pre>
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PARAM_OPTIMIZE">PARAM_OPTIMIZE</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">Optimized baseline entropy coding [lossy compression only]</div>
|
||||
<div class="block">Huffman table optimization [lossy compression, lossless transformation]</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
@@ -403,7 +403,7 @@ extends java.lang.Object</pre>
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PARAM_PROGRESSIVE">PARAM_PROGRESSIVE</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">Progressive entropy coding</div>
|
||||
<div class="block">Progressive JPEG</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
@@ -469,140 +469,140 @@ extends java.lang.Object</pre>
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_ABGR">PF_ABGR</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">ABGR pixel format.</div>
|
||||
<div class="block">ABGR pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_ARGB">PF_ARGB</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">ARGB pixel format.</div>
|
||||
<div class="block">ARGB pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_BGR">PF_BGR</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">BGR pixel format.</div>
|
||||
<div class="block">BGR pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_BGRA">PF_BGRA</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">BGRA pixel format.</div>
|
||||
<div class="block">BGRA pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_BGRX">PF_BGRX</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">BGRX pixel format.</div>
|
||||
<div class="block">BGRX pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_CMYK">PF_CMYK</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">CMYK pixel format.</div>
|
||||
<div class="block">CMYK pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_GRAY">PF_GRAY</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">Grayscale pixel format.</div>
|
||||
<div class="block">Grayscale pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_RGB">PF_RGB</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">RGB pixel format.</div>
|
||||
<div class="block">RGB pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_RGBA">PF_RGBA</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">RGBA pixel format.</div>
|
||||
<div class="block">RGBA pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_RGBX">PF_RGBX</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">RGBX pixel format.</div>
|
||||
<div class="block">RGBX pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_XBGR">PF_XBGR</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">XBGR pixel format.</div>
|
||||
<div class="block">XBGR pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PF_XRGB">PF_XRGB</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">XRGB pixel format.</div>
|
||||
<div class="block">XRGB pixel format</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_411">SAMP_411</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">4:1:1 chrominance subsampling.</div>
|
||||
<div class="block">4:1:1 chrominance subsampling</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_420">SAMP_420</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">4:2:0 chrominance subsampling.</div>
|
||||
<div class="block">4:2:0 chrominance subsampling</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_422">SAMP_422</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">4:2:2 chrominance subsampling.</div>
|
||||
<div class="block">4:2:2 chrominance subsampling</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_440">SAMP_440</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">4:4:0 chrominance subsampling.</div>
|
||||
<div class="block">4:4:0 chrominance subsampling</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_441">SAMP_441</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">4:4:1 chrominance subsampling.</div>
|
||||
<div class="block">4:4:1 chrominance subsampling</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_444">SAMP_444</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling).</div>
|
||||
<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_GRAY">SAMP_GRAY</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">Grayscale.</div>
|
||||
<div class="block">Grayscale</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SAMP_UNKNOWN">SAMP_UNKNOWN</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">Unknown subsampling.</div>
|
||||
<div class="block">Unknown subsampling</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
@@ -798,9 +798,10 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_444</h4>
|
||||
<pre>public static final int SAMP_444</pre>
|
||||
<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling). The JPEG
|
||||
or YUV image will contain one chrominance component for every pixel in the
|
||||
source image.</div>
|
||||
<div class="block">4:4:4 chrominance subsampling (no chrominance subsampling)
|
||||
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every
|
||||
pixel in the source image.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_444">Constant Field Values</a></dd>
|
||||
@@ -814,8 +815,10 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_422</h4>
|
||||
<pre>public static final int SAMP_422</pre>
|
||||
<div class="block">4:2:2 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
chrominance component for every 2x1 block of pixels in the source image.</div>
|
||||
<div class="block">4:2:2 chrominance subsampling
|
||||
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every
|
||||
2x1 block of pixels in the source image.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_422">Constant Field Values</a></dd>
|
||||
@@ -829,8 +832,10 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_420</h4>
|
||||
<pre>public static final int SAMP_420</pre>
|
||||
<div class="block">4:2:0 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
chrominance component for every 2x2 block of pixels in the source image.</div>
|
||||
<div class="block">4:2:0 chrominance subsampling
|
||||
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every
|
||||
2x2 block of pixels in the source image.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_420">Constant Field Values</a></dd>
|
||||
@@ -844,7 +849,9 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_GRAY</h4>
|
||||
<pre>public static final int SAMP_GRAY</pre>
|
||||
<div class="block">Grayscale. The JPEG or YUV image will contain no chrominance components.</div>
|
||||
<div class="block">Grayscale
|
||||
|
||||
<p>The JPEG or YUV image will contain no chrominance components.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_GRAY">Constant Field Values</a></dd>
|
||||
@@ -858,9 +865,12 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_440</h4>
|
||||
<pre>public static final int SAMP_440</pre>
|
||||
<div class="block">4:4:0 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
chrominance component for every 1x2 block of pixels in the source image.
|
||||
Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.</div>
|
||||
<div class="block">4:4:0 chrominance subsampling
|
||||
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every
|
||||
1x2 block of pixels in the source image.
|
||||
|
||||
<p>NOTE: 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_440">Constant Field Values</a></dd>
|
||||
@@ -874,14 +884,16 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_411</h4>
|
||||
<pre>public static final int SAMP_411</pre>
|
||||
<div class="block">4:1:1 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
chrominance component for every 4x1 block of pixels in the source image.
|
||||
JPEG images compressed with 4:1:1 subsampling will be almost exactly the
|
||||
same size as those compressed with 4:2:0 subsampling, and in the
|
||||
aggregate, both subsampling methods produce approximately the same
|
||||
perceptual quality. However, 4:1:1 is better able to reproduce sharp
|
||||
horizontal features. Note that 4:1:1 subsampling is not fully accelerated
|
||||
in libjpeg-turbo.</div>
|
||||
<div class="block">4:1:1 chrominance subsampling
|
||||
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every
|
||||
4x1 block of pixels in the source image. All else being equal, a JPEG
|
||||
image with 4:1:1 subsampling is almost exactly the same size as a JPEG
|
||||
image with 4:2:0 subsampling, and in the aggregate, both subsampling
|
||||
methods produce approximately the same perceptual quality. However, 4:1:1
|
||||
is better able to reproduce sharp horizontal features.
|
||||
|
||||
<p>NOTE: 4:1:1 subsampling is not fully accelerated in libjpeg-turbo.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_411">Constant Field Values</a></dd>
|
||||
@@ -895,14 +907,16 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_441</h4>
|
||||
<pre>public static final int SAMP_441</pre>
|
||||
<div class="block">4:4:1 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
chrominance component for every 1x4 block of pixels in the source image.
|
||||
JPEG images compressed with 4:4:1 subsampling will be almost exactly the
|
||||
same size as those compressed with 4:2:0 subsampling, and in the
|
||||
aggregate, both subsampling methods produce approximately the same
|
||||
perceptual quality. However, 4:4:1 is better able to reproduce sharp
|
||||
vertical features. Note that 4:4:1 subsampling is not fully accelerated
|
||||
in libjpeg-turbo.</div>
|
||||
<div class="block">4:4:1 chrominance subsampling
|
||||
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every
|
||||
1x4 block of pixels in the source image. All else being equal, a JPEG
|
||||
image with 4:4:1 subsampling is almost exactly the same size as a JPEG
|
||||
image with 4:2:0 subsampling, and in the aggregate, both subsampling
|
||||
methods produce approximately the same perceptual quality. However, 4:4:1
|
||||
is better able to reproduce sharp vertical features.
|
||||
|
||||
<p>NOTE: 4:4:1 subsampling is not fully accelerated in libjpeg-turbo.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.SAMP_441">Constant Field Values</a></dd>
|
||||
@@ -916,9 +930,10 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>SAMP_UNKNOWN</h4>
|
||||
<pre>public static final int SAMP_UNKNOWN</pre>
|
||||
<div class="block">Unknown subsampling. The JPEG image uses an unusual type of chrominance
|
||||
subsampling. Such images can be decompressed into packed-pixel images,
|
||||
but they cannot be
|
||||
<div class="block">Unknown subsampling
|
||||
|
||||
<p>The JPEG image uses an unusual type of chrominance subsampling. Such
|
||||
images can be decompressed into packed-pixel images, but they cannot be
|
||||
<ul>
|
||||
<li> decompressed into planar YUV images,
|
||||
<li> losslessly transformed if <a href="TJTransform.html#OPT_CROP"><code>TJTransform.OPT_CROP</code></a> is specified,
|
||||
@@ -952,9 +967,11 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_RGB</h4>
|
||||
<pre>public static final int PF_RGB</pre>
|
||||
<div class="block">RGB pixel format. The red, green, and blue components in the image are
|
||||
stored in 3-sample pixels in the order R, G, B from lowest to highest
|
||||
memory address within each pixel.</div>
|
||||
<div class="block">RGB pixel format
|
||||
|
||||
<p>The red, green, and blue components in the image are stored in 3-sample
|
||||
pixels in the order R, G, B from lowest to highest memory address within
|
||||
each pixel.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGB">Constant Field Values</a></dd>
|
||||
@@ -968,9 +985,11 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_BGR</h4>
|
||||
<pre>public static final int PF_BGR</pre>
|
||||
<div class="block">BGR pixel format. The red, green, and blue components in the image are
|
||||
stored in 3-sample pixels in the order B, G, R from lowest to highest
|
||||
memory address within each pixel.</div>
|
||||
<div class="block">BGR pixel format
|
||||
|
||||
<p>The red, green, and blue components in the image are stored in 3-sample
|
||||
pixels in the order B, G, R from lowest to highest memory address within
|
||||
each pixel.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGR">Constant Field Values</a></dd>
|
||||
@@ -984,10 +1003,12 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_RGBX</h4>
|
||||
<pre>public static final int PF_RGBX</pre>
|
||||
<div class="block">RGBX pixel format. The red, green, and blue components in the image are
|
||||
stored in 4-sample pixels in the order R, G, B from lowest to highest
|
||||
memory address within each pixel. The X component is ignored when
|
||||
compressing and undefined when decompressing.</div>
|
||||
<div class="block">RGBX pixel format
|
||||
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample
|
||||
pixels in the order R, G, B from lowest to highest memory address within
|
||||
each pixel. The X component is ignored when compressing/encoding and
|
||||
undefined when decompressing/decoding.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBX">Constant Field Values</a></dd>
|
||||
@@ -1001,10 +1022,12 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_BGRX</h4>
|
||||
<pre>public static final int PF_BGRX</pre>
|
||||
<div class="block">BGRX pixel format. The red, green, and blue components in the image are
|
||||
stored in 4-sample pixels in the order B, G, R from lowest to highest
|
||||
memory address within each pixel. The X component is ignored when
|
||||
compressing and undefined when decompressing.</div>
|
||||
<div class="block">BGRX pixel format
|
||||
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample
|
||||
pixels in the order B, G, R from lowest to highest memory address within
|
||||
each pixel. The X component is ignored when compressing/encoding and
|
||||
undefined when decompressing/decoding.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRX">Constant Field Values</a></dd>
|
||||
@@ -1018,10 +1041,12 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_XBGR</h4>
|
||||
<pre>public static final int PF_XBGR</pre>
|
||||
<div class="block">XBGR pixel format. The red, green, and blue components in the image are
|
||||
stored in 4-sample pixels in the order R, G, B from highest to lowest
|
||||
memory address within each pixel. The X component is ignored when
|
||||
compressing and undefined when decompressing.</div>
|
||||
<div class="block">XBGR pixel format
|
||||
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample
|
||||
pixels in the order R, G, B from highest to lowest memory address within
|
||||
each pixel. The X component is ignored when compressing/encoding and
|
||||
undefined when decompressing/decoding.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XBGR">Constant Field Values</a></dd>
|
||||
@@ -1035,10 +1060,12 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_XRGB</h4>
|
||||
<pre>public static final int PF_XRGB</pre>
|
||||
<div class="block">XRGB pixel format. The red, green, and blue components in the image are
|
||||
stored in 4-sample pixels in the order B, G, R from highest to lowest
|
||||
memory address within each pixel. The X component is ignored when
|
||||
compressing and undefined when decompressing.</div>
|
||||
<div class="block">XRGB pixel format
|
||||
|
||||
<p>The red, green, and blue components in the image are stored in 4-sample
|
||||
pixels in the order B, G, R from highest to lowest memory address within
|
||||
each pixel. The X component is ignored when compressing/encoding and
|
||||
undefined when decompressing/decoding.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_XRGB">Constant Field Values</a></dd>
|
||||
@@ -1052,9 +1079,11 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_GRAY</h4>
|
||||
<pre>public static final int PF_GRAY</pre>
|
||||
<div class="block">Grayscale pixel format. Each 1-sample pixel represents a luminance
|
||||
(brightness) level from 0 to the maximum sample value (255 for 8-bit
|
||||
samples, 4095 for 12-bit samples, and 65535 for 16-bit samples.)</div>
|
||||
<div class="block">Grayscale pixel format
|
||||
|
||||
<p>Each 1-sample pixel represents a luminance (brightness) level from 0 to
|
||||
the maximum sample value (255 for 8-bit samples, 4095 for 12-bit samples,
|
||||
and 65535 for 16-bit samples.)</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_GRAY">Constant Field Values</a></dd>
|
||||
@@ -1068,9 +1097,11 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_RGBA</h4>
|
||||
<pre>public static final int PF_RGBA</pre>
|
||||
<div class="block">RGBA pixel format. This is the same as <a href="#PF_RGBX"><code>PF_RGBX</code></a>, except that when
|
||||
decompressing, the X component is guaranteed to be equal to the maximum
|
||||
sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<div class="block">RGBA pixel format
|
||||
|
||||
<p>This is the same as <a href="#PF_RGBX"><code>PF_RGBX</code></a>, except that when
|
||||
decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
maximum sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_RGBA">Constant Field Values</a></dd>
|
||||
@@ -1084,9 +1115,11 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_BGRA</h4>
|
||||
<pre>public static final int PF_BGRA</pre>
|
||||
<div class="block">BGRA pixel format. This is the same as <a href="#PF_BGRX"><code>PF_BGRX</code></a>, except that when
|
||||
decompressing, the X component is guaranteed to be equal to the maximum
|
||||
sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<div class="block">BGRA pixel format
|
||||
|
||||
<p>This is the same as <a href="#PF_BGRX"><code>PF_BGRX</code></a>, except that when
|
||||
decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
maximum sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_BGRA">Constant Field Values</a></dd>
|
||||
@@ -1100,9 +1133,11 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_ABGR</h4>
|
||||
<pre>public static final int PF_ABGR</pre>
|
||||
<div class="block">ABGR pixel format. This is the same as <a href="#PF_XBGR"><code>PF_XBGR</code></a>, except that when
|
||||
decompressing, the X component is guaranteed to be equal to the maximum
|
||||
sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<div class="block">ABGR pixel format
|
||||
|
||||
<p>This is the same as <a href="#PF_XBGR"><code>PF_XBGR</code></a>, except that when
|
||||
decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
maximum sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ABGR">Constant Field Values</a></dd>
|
||||
@@ -1116,9 +1151,11 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_ARGB</h4>
|
||||
<pre>public static final int PF_ARGB</pre>
|
||||
<div class="block">ARGB pixel format. This is the same as <a href="#PF_XRGB"><code>PF_XRGB</code></a>, except that when
|
||||
decompressing, the X component is guaranteed to be equal to the maximum
|
||||
sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<div class="block">ARGB pixel format
|
||||
|
||||
<p>This is the same as <a href="#PF_XRGB"><code>PF_XRGB</code></a>, except that when
|
||||
decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
maximum sample value, which can be interpreted as an opaque alpha channel.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_ARGB">Constant Field Values</a></dd>
|
||||
@@ -1132,19 +1169,21 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PF_CMYK</h4>
|
||||
<pre>public static final int PF_CMYK</pre>
|
||||
<div class="block">CMYK pixel format. Unlike RGB, which is an additive color model used
|
||||
primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive
|
||||
color model used primarily for printing. In the CMYK color model, the
|
||||
value of each color component typically corresponds to an amount of cyan,
|
||||
magenta, yellow, or black ink that is applied to a white background. In
|
||||
order to convert between CMYK and RGB, it is necessary to use a color
|
||||
management system (CMS.) A CMS will attempt to map colors within the
|
||||
printer's gamut to perceptually similar colors in the display's gamut and
|
||||
vice versa, but the mapping is typically not 1:1 or reversible, nor can it
|
||||
be defined with a simple formula. Thus, such a conversion is out of scope
|
||||
for a codec library. However, the TurboJPEG API allows for compressing
|
||||
packed-pixel CMYK images into YCCK JPEG images (see <a href="#CS_YCCK"><code>CS_YCCK</code></a>) and
|
||||
decompressing YCCK JPEG images into packed-pixel CMYK images.</div>
|
||||
<div class="block">CMYK pixel format
|
||||
|
||||
<p>Unlike RGB, which is an additive color model used primarily for
|
||||
display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive color model used
|
||||
primarily for printing. In the CMYK color model, the value of each color
|
||||
component typically corresponds to an amount of cyan, magenta, yellow, or
|
||||
black ink that is applied to a white background. In order to convert
|
||||
between CMYK and RGB, it is necessary to use a color management system
|
||||
(CMS.) A CMS will attempt to map colors within the printer's gamut to
|
||||
perceptually similar colors in the display's gamut and vice versa, but the
|
||||
mapping is typically not 1:1 or reversible, nor can it be defined with a
|
||||
simple formula. Thus, such a conversion is out of scope for a codec
|
||||
library. However, the TurboJPEG API allows for compressing packed-pixel
|
||||
CMYK images into YCCK JPEG images (see <a href="#CS_YCCK"><code>CS_YCCK</code></a>) and decompressing
|
||||
YCCK JPEG images into packed-pixel CMYK images.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_CMYK">Constant Field Values</a></dd>
|
||||
@@ -1172,12 +1211,14 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>CS_RGB</h4>
|
||||
<pre>public static final int CS_RGB</pre>
|
||||
<div class="block">RGB colorspace. When compressing the JPEG image, the R, G, and B
|
||||
components in the source image are reordered into image planes, but no
|
||||
colorspace conversion or subsampling is performed. RGB JPEG images can be
|
||||
compressed from and decompressed to packed-pixel images with any of the
|
||||
extended RGB or grayscale pixel formats, but they cannot be compressed
|
||||
from or decompressed to planar YUV images.</div>
|
||||
<div class="block">RGB colorspace
|
||||
|
||||
<p>When generating the JPEG image, the R, G, and B components in the
|
||||
source image are reordered into image planes, but no colorspace conversion
|
||||
or subsampling is performed. RGB JPEG images can be generated from and
|
||||
decompressed to packed-pixel images with any of the extended RGB or
|
||||
grayscale pixel formats, but they cannot be generated from or
|
||||
decompressed to planar YUV images.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_RGB">Constant Field Values</a></dd>
|
||||
@@ -1191,21 +1232,22 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>CS_YCbCr</h4>
|
||||
<pre>public static final int CS_YCbCr</pre>
|
||||
<div class="block">YCbCr colorspace. YCbCr is not an absolute colorspace but rather a
|
||||
mathematical transformation of RGB designed solely for storage and
|
||||
transmission. YCbCr images must be converted to RGB before they can
|
||||
actually be displayed. In the YCbCr colorspace, the Y (luminance)
|
||||
component represents the black & white portion of the original image,
|
||||
and the Cb and Cr (chrominance) components represent the color portion of
|
||||
the original image. Originally, the analog equivalent of this
|
||||
transformation allowed the same signal to drive both black & white and
|
||||
color televisions, but JPEG images use YCbCr primarily because it allows
|
||||
the color data to be optionally subsampled for the purposes of reducing
|
||||
network or disk usage. YCbCr is the most common JPEG colorspace, and
|
||||
YCbCr JPEG images can be compressed from and decompressed to packed-pixel
|
||||
images with any of the extended RGB or grayscale pixel formats. YCbCr
|
||||
JPEG images can also be compressed from and decompressed to planar YUV
|
||||
images.</div>
|
||||
<div class="block">YCbCr colorspace
|
||||
|
||||
<p>YCbCr is not an absolute colorspace but rather a mathematical
|
||||
transformation of RGB designed solely for storage and transmission. YCbCr
|
||||
images must be converted to RGB before they can be displayed. In the
|
||||
YCbCr colorspace, the Y (luminance) component represents the black &
|
||||
white portion of the original image, and the Cb and Cr (chrominance)
|
||||
components represent the color portion of the original image.
|
||||
Historically, the analog equivalent of this transformation allowed the
|
||||
same signal to be displayed to both black & white and color
|
||||
televisions, but JPEG images use YCbCr primarily because it allows the
|
||||
color data to be optionally subsampled in order to reduce network and disk
|
||||
usage. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images
|
||||
can be generated from and decompressed to packed-pixel images with any of
|
||||
the extended RGB or grayscale pixel formats. YCbCr JPEG images can also
|
||||
be generated from and decompressed to planar YUV images.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_YCbCr">Constant Field Values</a></dd>
|
||||
@@ -1219,12 +1261,13 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>CS_GRAY</h4>
|
||||
<pre>public static final int CS_GRAY</pre>
|
||||
<div class="block">Grayscale colorspace. The JPEG image retains only the luminance data (Y
|
||||
component), and any color data from the source image is discarded.
|
||||
Grayscale JPEG images can be compressed from and decompressed to
|
||||
packed-pixel images with any of the extended RGB or grayscale pixel
|
||||
formats, or they can be compressed from and decompressed to planar YUV
|
||||
images.</div>
|
||||
<div class="block">Grayscale colorspace
|
||||
|
||||
<p>The JPEG image retains only the luminance data (Y component), and any
|
||||
color data from the source image is discarded. Grayscale JPEG images can
|
||||
be generated from and decompressed to packed-pixel images with any of the
|
||||
extended RGB or grayscale pixel formats, or they can be generated from and
|
||||
decompressed to planar YUV images.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_GRAY">Constant Field Values</a></dd>
|
||||
@@ -1238,11 +1281,12 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>CS_CMYK</h4>
|
||||
<pre>public static final int CS_CMYK</pre>
|
||||
<div class="block">CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K
|
||||
components in the source image are reordered into image planes, but no
|
||||
colorspace conversion or subsampling is performed. CMYK JPEG images can
|
||||
only be compressed from and decompressed to packed-pixel images with the
|
||||
CMYK pixel format.</div>
|
||||
<div class="block">CMYK colorspace
|
||||
|
||||
<p>When generating the JPEG image, the C, M, Y, and K components in the
|
||||
source image are reordered into image planes, but no colorspace conversion
|
||||
or subsampling is performed. CMYK JPEG images can only be generated from
|
||||
and decompressed to packed-pixel images with the CMYK pixel format.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.CS_CMYK">Constant Field Values</a></dd>
|
||||
@@ -1256,12 +1300,14 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>CS_YCCK</h4>
|
||||
<pre>public static final int CS_YCCK</pre>
|
||||
<div class="block">YCCK colorspace. YCCK (AKA "YCbCrK") is not an absolute colorspace but
|
||||
rather a mathematical transformation of CMYK designed solely for storage
|
||||
and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be
|
||||
<div class="block">YCCK colorspace
|
||||
|
||||
<p>YCCK (AKA "YCbCrK") is not an absolute colorspace but rather a
|
||||
mathematical transformation of CMYK designed solely for storage and
|
||||
transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be
|
||||
reversibly transformed into YCCK, and as with YCbCr, the chrominance
|
||||
components in the YCCK pixels can be subsampled without incurring major
|
||||
perceptual loss. YCCK JPEG images can only be compressed from and
|
||||
perceptual loss. YCCK JPEG images can only be generated from and
|
||||
decompressed to packed-pixel images with the CMYK pixel format.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
@@ -1350,7 +1396,7 @@ extends java.lang.Object</pre>
|
||||
from CMYK to YCCK (see <a href="#CS_YCCK"><code>CS_YCCK</code></a>) as part of the JPEG compression
|
||||
process, some of the Cb and Cr (chrominance) components can be discarded
|
||||
or averaged together to produce a smaller image with little perceptible
|
||||
loss of image clarity. (The human eye is more sensitive to small changes
|
||||
loss of image quality. (The human eye is more sensitive to small changes
|
||||
in brightness than to small changes in color.) This is called
|
||||
"chrominance subsampling".
|
||||
|
||||
@@ -1453,7 +1499,7 @@ extends java.lang.Object</pre>
|
||||
<p><b>Value</b>
|
||||
<ul>
|
||||
<li> <code>0</code> <i>[default]</i> Use smooth upsampling when
|
||||
decompressing a JPEG image that was compressed using chrominance
|
||||
decompressing a JPEG image that was generated using chrominance
|
||||
subsampling. This creates a smooth transition between neighboring
|
||||
chrominance components in order to reduce upsampling artifacts in the
|
||||
decompressed image.
|
||||
@@ -1495,9 +1541,8 @@ extends java.lang.Object</pre>
|
||||
<li> The difference in accuracy between the "fast" and "accurate"
|
||||
algorithms is the most pronounced at JPEG quality levels above 90 and
|
||||
tends to be more pronounced with decompression than with compression.
|
||||
<li> The "fast" algorithm degrades and is not fully accelerated for JPEG
|
||||
quality levels above 97, so it will be slower than the "accurate"
|
||||
algorithm.
|
||||
<li> For JPEG quality levels above 97, the "fast" algorithm degrades and
|
||||
is not fully accelerated, so it is slower than the "accurate" algorithm.
|
||||
</ul></div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
@@ -1512,7 +1557,7 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PARAM_OPTIMIZE</h4>
|
||||
<pre>public static final int PARAM_OPTIMIZE</pre>
|
||||
<div class="block">Optimized baseline entropy coding [lossy compression only]
|
||||
<div class="block">Huffman table optimization [lossy compression, lossless transformation]
|
||||
|
||||
<p><b>Value</b>
|
||||
<ul>
|
||||
@@ -1523,9 +1568,8 @@ extends java.lang.Object</pre>
|
||||
<a href="TJTransform.html#OPT_OPTIMIZE"><code>TJTransform.OPT_OPTIMIZE</code></a>.
|
||||
</ul>
|
||||
|
||||
<p>Optimized baseline entropy coding will improve compression slightly
|
||||
(generally 5% or less), but it will reduce compression performance
|
||||
considerably.</div>
|
||||
<p>Huffman table optimization improves compression slightly (generally 5%
|
||||
or less), but it reduces compression performance considerably.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PARAM_OPTIMIZE">Constant Field Values</a></dd>
|
||||
@@ -1539,24 +1583,34 @@ extends java.lang.Object</pre>
|
||||
<li class="blockList">
|
||||
<h4>PARAM_PROGRESSIVE</h4>
|
||||
<pre>public static final int PARAM_PROGRESSIVE</pre>
|
||||
<div class="block">Progressive entropy coding
|
||||
<div class="block">Progressive JPEG
|
||||
|
||||
<p>In a progressive JPEG image, the DCT coefficients are split across
|
||||
multiple "scans" of increasing quality. Thus, a low-quality scan
|
||||
containing the lowest-frequency DCT coefficients can be transmitted first
|
||||
and refined with subsequent higher-quality scans containing
|
||||
higher-frequency DCT coefficients. When using Huffman entropy coding, the
|
||||
progressive JPEG format also provides an "end-of-bands (EOB) run" feature
|
||||
that allows large groups of zeroes, potentially spanning multiple MCU
|
||||
blocks, to be represented using only a few bytes.
|
||||
|
||||
<p><b>Value</b>
|
||||
<ul>
|
||||
<li> <code>0</code> <i>[default for compression, lossless
|
||||
transformation]</i> The lossy JPEG image uses (decompression) or will use
|
||||
(compression, lossless transformation) baseline entropy coding.
|
||||
<li> <code>1</code> The lossy JPEG image uses (decompression) or will use
|
||||
(compression, lossless transformation) progressive entropy coding. For
|
||||
lossless transformation, this can also be specified using
|
||||
transformation]</i> The lossy JPEG image is (decompression) or will be
|
||||
(compression, lossless transformation) single-scan.
|
||||
<li> <code>1</code> The lossy JPEG image is (decompression) or will be
|
||||
(compression, lossless transformation) progressive. For lossless
|
||||
transformation, this can also be specified using
|
||||
<a href="TJTransform.html#OPT_PROGRESSIVE"><code>TJTransform.OPT_PROGRESSIVE</code></a>.
|
||||
</ul>
|
||||
|
||||
<p>Progressive entropy coding will generally improve compression relative
|
||||
to baseline entropy coding, but it will reduce compression and
|
||||
decompression performance considerably. Can be combined with
|
||||
<a href="#PARAM_ARITHMETIC"><code>PARAM_ARITHMETIC</code></a>. Implies <a href="#PARAM_OPTIMIZE"><code>PARAM_OPTIMIZE</code></a> unless
|
||||
<a href="#PARAM_ARITHMETIC"><code>PARAM_ARITHMETIC</code></a> is also set.</div>
|
||||
<p>Progressive JPEG images generally have better compression ratios than
|
||||
single-scan JPEG images (much better if the image has large areas of solid
|
||||
color), but progressive JPEG compression and decompression is considerably
|
||||
slower than single-scan JPEG compression and decompression. Can be
|
||||
combined with <a href="#PARAM_ARITHMETIC"><code>PARAM_ARITHMETIC</code></a>. Implies <a href="#PARAM_OPTIMIZE"><code>PARAM_OPTIMIZE</code></a>
|
||||
unless <a href="#PARAM_ARITHMETIC"><code>PARAM_ARITHMETIC</code></a> is also set.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PARAM_PROGRESSIVE">Constant Field Values</a></dd>
|
||||
@@ -1573,7 +1627,7 @@ extends java.lang.Object</pre>
|
||||
<div class="block">Progressive JPEG scan limit for lossy JPEG images [decompression, lossless
|
||||
transformation]
|
||||
|
||||
<p>Setting this parameter will cause the decompression and transform
|
||||
<p>Setting this parameter causes the decompression and transform
|
||||
operations to throw an error if the number of scans in a progressive JPEG
|
||||
image exceeds the specified limit. The primary purpose of this is to
|
||||
allow security-critical applications to guard against an exploit of the
|
||||
@@ -1613,9 +1667,9 @@ extends java.lang.Object</pre>
|
||||
<a href="TJTransform.html#OPT_ARITHMETIC"><code>TJTransform.OPT_ARITHMETIC</code></a>.
|
||||
</ul>
|
||||
|
||||
<p>Arithmetic entropy coding will generally improve compression relative
|
||||
to Huffman entropy coding, but it will reduce compression and
|
||||
decompression performance considerably. Can be combined with
|
||||
<p>Arithmetic entropy coding generally improves compression relative to
|
||||
Huffman entropy coding, but it reduces compression and decompression
|
||||
performance considerably. Can be combined with
|
||||
<a href="#PARAM_PROGRESSIVE"><code>PARAM_PROGRESSIVE</code></a>.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
@@ -1640,9 +1694,9 @@ extends java.lang.Object</pre>
|
||||
(compression) lossless/predictive.
|
||||
</ul>
|
||||
|
||||
<p>In most cases, compressing and decompressing lossless JPEG images is
|
||||
considerably slower than compressing and decompressing lossy JPEG images,
|
||||
and lossless JPEG images are much larger than lossy JPEG images. Thus,
|
||||
<p>In most cases, lossless JPEG compression and decompression is
|
||||
considerably slower than lossy JPEG compression and decompression, and
|
||||
lossless JPEG images are much larger than lossy JPEG images. Thus,
|
||||
lossless JPEG images are typically used only for applications that require
|
||||
mathematically lossless compression. Also note that the following
|
||||
features are not available with lossless JPEG images:
|
||||
@@ -1654,7 +1708,7 @@ extends java.lang.Object</pre>
|
||||
<a href="#SAMP_444"><code>SAMP_444</code></a>)
|
||||
<li> JPEG quality selection
|
||||
<li> DCT/IDCT algorithm selection
|
||||
<li> Progressive entropy coding
|
||||
<li> Progressive JPEG
|
||||
<li> Arithmetic entropy coding
|
||||
<li> Compression from/decompression to planar YUV images
|
||||
<li> Decompression scaling
|
||||
@@ -1895,9 +1949,8 @@ extends java.lang.Object</pre>
|
||||
<ul>
|
||||
<li> the maximum amount of memory (in megabytes) that will be allocated
|
||||
for intermediate buffers, which are used with progressive JPEG compression
|
||||
and decompression, optimized baseline entropy coding, lossless JPEG
|
||||
compression, and lossless transformation <i>[default: <code>0</code> (no
|
||||
limit)]</i>
|
||||
and decompression, Huffman table optimization, lossless JPEG compression,
|
||||
and lossless transformation <i>[default: <code>0</code> (no limit)]</i>
|
||||
</ul></div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
@@ -1914,7 +1967,7 @@ extends java.lang.Object</pre>
|
||||
<pre>public static final int PARAM_MAXPIXELS</pre>
|
||||
<div class="block">Image size limit [decompression, lossless transformation]
|
||||
|
||||
<p>Setting this parameter will cause the decompression and transform
|
||||
<p>Setting this parameter causes the decompression and transform
|
||||
operations to throw an error if the number of pixels in the JPEG source
|
||||
image exceeds the specified limit. This allows security-critical
|
||||
applications to guard against excessive memory consumption.
|
||||
@@ -2072,8 +2125,8 @@ public static final int FLAG_LIMITSCANS</pre>
|
||||
<pre>public static final int ERR_WARNING</pre>
|
||||
<div class="block">The error was non-fatal and recoverable, but the destination image may
|
||||
still be corrupt.
|
||||
<p>
|
||||
NOTE: due to the design of the TurboJPEG Java API, only certain methods
|
||||
|
||||
<p>NOTE: Due to the design of the TurboJPEG Java API, only certain methods
|
||||
(specifically, <a href="TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor.decompress*()</code></a> methods
|
||||
with a void return type) will complete and leave the destination image in
|
||||
a fully recoverable state after a non-fatal error occurs.</div>
|
||||
@@ -2192,7 +2245,7 @@ public static final int FLAG_LIMITSCANS</pre>
|
||||
<div class="block">For the given pixel format, returns the number of samples that the red
|
||||
component is offset from the start of the pixel. For instance, if an
|
||||
8-bit-per-sample pixel of format <code>TJ.PF_BGRX</code> is stored in
|
||||
<code>char pixel[]</code>, then the red component will be
|
||||
<code>char pixel[]</code>, then the red component is
|
||||
<code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -2213,7 +2266,7 @@ public static final int FLAG_LIMITSCANS</pre>
|
||||
<div class="block">For the given pixel format, returns the number of samples that the green
|
||||
component is offset from the start of the pixel. For instance, if an
|
||||
8-bit-per-sample pixel of format <code>TJ.PF_BGRX</code> is stored in
|
||||
<code>char pixel[]</code>, then the green component will be
|
||||
<code>char pixel[]</code>, then the green component is
|
||||
<code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -2234,7 +2287,7 @@ public static final int FLAG_LIMITSCANS</pre>
|
||||
<div class="block">For the given pixel format, returns the number of samples that the blue
|
||||
component is offset from the start of the pixel. For instance, if an
|
||||
8-bit-per-sample pixel of format <code>TJ.PF_BGRX</code> is stored in
|
||||
<code>char pixel[]</code>, then the blue component will be
|
||||
<code>char pixel[]</code>, then the blue component is
|
||||
<code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -2255,7 +2308,7 @@ public static final int FLAG_LIMITSCANS</pre>
|
||||
<div class="block">For the given pixel format, returns the number of samples that the alpha
|
||||
component is offset from the start of the pixel. For instance, if an
|
||||
8-bit-per-sample pixel of format <code>TJ.PF_BGRA</code> is stored in
|
||||
<code>char pixel[]</code>, then the alpha component will be
|
||||
<code>char pixel[]</code>, then the alpha component is
|
||||
<code>pixel[TJ.getAlphaOffset(TJ.PF_BGRA)]</code>.</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -2340,10 +2393,10 @@ public static final int FLAG_LIMITSCANS</pre>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
<dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
2 = V/Cr)</dd>
|
||||
<dd><code>width</code> - width (in pixels) of the YUV image. NOTE: this is the width
|
||||
<dd><code>width</code> - width (in pixels) of the YUV image. NOTE: This is the width
|
||||
of the whole image, not the plane width.</dd>
|
||||
<dd><code>stride</code> - bytes per row in the image plane.</dd>
|
||||
<dd><code>height</code> - height (in pixels) of the YUV image. NOTE: this is the
|
||||
<dd><code>height</code> - height (in pixels) of the YUV image. NOTE: This is the
|
||||
height of the whole image, not the plane height.</dd>
|
||||
<dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
|
||||
@@ -195,7 +195,7 @@ $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
<dd><code>coeffBuffer</code> - a buffer containing transformed DCT coefficients.
|
||||
(NOTE: this buffer is not guaranteed to be valid once the callback
|
||||
(NOTE: This buffer is not guaranteed to be valid once the callback
|
||||
returns, so applications wishing to hand off the DCT coefficients to
|
||||
another method should make a copy of them within the body of the
|
||||
callback.)</dd>
|
||||
|
||||
@@ -980,9 +980,9 @@ public int getScaledHeight​(int desiredWidth,
|
||||
source image associated with this decompressor instance and output an
|
||||
8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given
|
||||
destination buffer.
|
||||
<p>
|
||||
NOTE: The destination image is fully recoverable if this method throws a
|
||||
non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
|
||||
|
||||
<p>NOTE: The destination image is fully recoverable if this method throws
|
||||
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
|
||||
set.)</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -1011,7 +1011,7 @@ public int getScaledHeight​(int desiredWidth,
|
||||
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
|
||||
you can also use this parameter to specify the row alignment/padding of
|
||||
the destination image, to skip rows, or to decompress/decode into a
|
||||
specific region of a larger image. NOTE: if the source image is a lossy
|
||||
specific region of a larger image. NOTE: If the source image is a lossy
|
||||
JPEG image, then <code>destinationWidth</code> is either the scaled JPEG
|
||||
width (see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
|
||||
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and
|
||||
@@ -1118,9 +1118,9 @@ public byte[] decompress​(int desiredWidth,
|
||||
<div class="block">Decompress the 12-bit-per-sample JPEG source image associated with this
|
||||
decompressor instance and output a 12-bit-per-sample packed-pixel
|
||||
grayscale, RGB, or CMYK image to the given destination buffer.
|
||||
<p>
|
||||
NOTE: The destination image is fully recoverable if this method throws a
|
||||
non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
|
||||
|
||||
<p>NOTE: The destination image is fully recoverable if this method throws
|
||||
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
|
||||
set.)</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -1150,7 +1150,7 @@ public byte[] decompress​(int desiredWidth,
|
||||
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
|
||||
you can also use this parameter to specify the row alignment/padding of
|
||||
the destination image, to skip rows, or to decompress into a specific
|
||||
region of a larger image. NOTE: if the source image is a lossy JPEG
|
||||
region of a larger image. NOTE: If the source image is a lossy JPEG
|
||||
image, then <code>destinationWidth</code> is either the scaled JPEG width
|
||||
(see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
|
||||
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and
|
||||
@@ -1207,9 +1207,9 @@ public byte[] decompress​(int desiredWidth,
|
||||
with this decompressor instance and output a 16-bit-per-sample
|
||||
packed-pixel grayscale, RGB, or CMYK image to the given destination
|
||||
buffer.
|
||||
<p>
|
||||
NOTE: The destination image is fully recoverable if this method throws a
|
||||
non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
|
||||
|
||||
<p>NOTE: The destination image is fully recoverable if this method throws
|
||||
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
|
||||
set.)</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -1279,9 +1279,9 @@ public byte[] decompress​(int desiredWidth,
|
||||
decompression but leaves out the color conversion step, so a planar YUV
|
||||
image is generated instead of a packed-pixel image. This method cannot be
|
||||
used to decompress JPEG source images with the CMYK or YCCK colorspace.
|
||||
<p>
|
||||
NOTE: The planar YUV destination image is fully recoverable if this method
|
||||
throws a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless
|
||||
|
||||
<p>NOTE: The planar YUV destination image is fully recoverable if this
|
||||
method throws a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless
|
||||
<a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is set.)</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -1432,9 +1432,9 @@ public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">
|
||||
source image associated with this decompressor instance and output an
|
||||
8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given
|
||||
destination buffer.
|
||||
<p>
|
||||
NOTE: The destination image is fully recoverable if this method throws a
|
||||
non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a>
|
||||
|
||||
<p>NOTE: The destination image is fully recoverable if this method throws
|
||||
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a>
|
||||
is set.)</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
@@ -1460,7 +1460,7 @@ public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">
|
||||
should be set to <code>destinationWidth</code>. (Setting this parameter
|
||||
to 0 is the equivalent of setting it to <code>destinationWidth</code>.)
|
||||
However, you can also use this parameter to skip rows or to
|
||||
decompress/decode into a specific region of a larger image. NOTE: if the
|
||||
decompress/decode into a specific region of a larger image. NOTE: If the
|
||||
source image is a lossy JPEG image, then <code>destinationWidth</code> is
|
||||
either the scaled JPEG width (see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>, <a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and <a href="#getWidth()"><code>getWidth()</code></a>) or the width of the
|
||||
cropping region (see <a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If
|
||||
@@ -1511,9 +1511,9 @@ public void decompress​(int[] dstBuf,
|
||||
source image associated with this decompressor instance and output an
|
||||
8-bit-per-sample packed-pixel decompressed/decoded image to the given
|
||||
<code>BufferedImage</code> instance.
|
||||
<p>
|
||||
NOTE: The destination image is fully recoverable if this method throws a
|
||||
non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a>
|
||||
|
||||
<p>NOTE: The destination image is fully recoverable if this method throws
|
||||
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a>
|
||||
is set.)</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
|
||||
@@ -269,54 +269,51 @@ extends java.awt.Rectangle</pre>
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_ARITHMETIC">OPT_ARITHMETIC</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will enable arithmetic entropy coding in the JPEG image
|
||||
generated by this particular transform.</div>
|
||||
<div class="block">Enable arithmetic entropy coding in the destination image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_COPYNONE">OPT_COPYNONE</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will prevent <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF
|
||||
and ICC profile data) from the source image to the destination image.</div>
|
||||
<div class="block">Do not copy any extra markers (including EXIF and ICC profile data) from
|
||||
the source image to the destination image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_CROP">OPT_CROP</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will enable lossless cropping.</div>
|
||||
<div class="block">Enable lossless cropping.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_GRAY">OPT_GRAY</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will discard the color data in the source image and produce a
|
||||
grayscale destination image.</div>
|
||||
<div class="block">Discard the color data in the source image, and generate a grayscale
|
||||
destination image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_NOOUTPUT">OPT_NOOUTPUT</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will prevent <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
particular transform.</div>
|
||||
<div class="block">Do not generate a destination image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_OPTIMIZE">OPT_OPTIMIZE</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will enable optimized baseline entropy coding in the JPEG
|
||||
image generated by this particular transform.</div>
|
||||
<div class="block">Enable Huffman table optimization for the destination image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_PERFECT">OPT_PERFECT</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will cause <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
<div class="block">This option causes <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
perfect.</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -324,16 +321,15 @@ extends java.awt.Rectangle</pre>
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will enable progressive entropy coding in the JPEG image
|
||||
generated by this particular transform.</div>
|
||||
<div class="block">Generate a progressive destination image instead of a single-scan
|
||||
destination image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OPT_TRIM">OPT_TRIM</a></span></code></th>
|
||||
<td class="colLast">
|
||||
<div class="block">This option will discard any partial MCU blocks that cannot be
|
||||
transformed.</div>
|
||||
<div class="block">Discard any partial MCU blocks that cannot be transformed.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
@@ -612,16 +608,16 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_PERFECT</h4>
|
||||
<pre>public static final int OPT_PERFECT</pre>
|
||||
<div class="block">This option will cause <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
perfect. Lossless transforms operate on MCU blocks, whose size depends on
|
||||
the level of chrominance subsampling used. If the image's width or height
|
||||
is not evenly divisible by the MCU block size (see <a href="TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth()</code></a> and <a href="TJ.html#getMCUHeight(int)"><code>TJ.getMCUHeight()</code></a>), then
|
||||
there will be partial MCU blocks on the right and/or bottom edges. It is
|
||||
not possible to move these partial MCU blocks to the top or left of the
|
||||
image, so any transform that would require that is "imperfect." If this
|
||||
option is not specified, then any partial MCU blocks that cannot be
|
||||
transformed will be left in place, which will create odd-looking strips on
|
||||
the right or bottom edge of the image.</div>
|
||||
<div class="block">This option causes <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
perfect. Lossless transforms operate on MCU blocks, the size of which
|
||||
depends on the level of chrominance subsampling used. If the image's
|
||||
width or height is not evenly divisible by the MCU block size (see
|
||||
<a href="TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth()</code></a> and <a href="TJ.html#getMCUHeight(int)"><code>TJ.getMCUHeight()</code></a>), then there will be partial MCU blocks on the right
|
||||
and/or bottom edges. It is not possible to move these partial MCU blocks
|
||||
to the top or left of the image, so any transform that would require that
|
||||
is "imperfect." If this option is not specified, then any partial MCU
|
||||
blocks that cannot be transformed will be left in place, which will create
|
||||
odd-looking strips on the right or bottom edge of the image.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT">Constant Field Values</a></dd>
|
||||
@@ -635,8 +631,7 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_TRIM</h4>
|
||||
<pre>public static final int OPT_TRIM</pre>
|
||||
<div class="block">This option will discard any partial MCU blocks that cannot be
|
||||
transformed.</div>
|
||||
<div class="block">Discard any partial MCU blocks that cannot be transformed.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM">Constant Field Values</a></dd>
|
||||
@@ -650,7 +645,7 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_CROP</h4>
|
||||
<pre>public static final int OPT_CROP</pre>
|
||||
<div class="block">This option will enable lossless cropping.</div>
|
||||
<div class="block">Enable lossless cropping.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP">Constant Field Values</a></dd>
|
||||
@@ -664,8 +659,8 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_GRAY</h4>
|
||||
<pre>public static final int OPT_GRAY</pre>
|
||||
<div class="block">This option will discard the color data in the source image and produce a
|
||||
grayscale destination image.</div>
|
||||
<div class="block">Discard the color data in the source image, and generate a grayscale
|
||||
destination image.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY">Constant Field Values</a></dd>
|
||||
@@ -679,10 +674,9 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_NOOUTPUT</h4>
|
||||
<pre>public static final int OPT_NOOUTPUT</pre>
|
||||
<div class="block">This option will prevent <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
particular transform. This can be used in conjunction with a custom
|
||||
filter to capture the transformed DCT coefficients without transcoding
|
||||
them.</div>
|
||||
<div class="block">Do not generate a destination image. This can be used in conjunction with
|
||||
a custom filter to capture the transformed DCT coefficients without
|
||||
transcoding them.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT">Constant Field Values</a></dd>
|
||||
@@ -696,12 +690,13 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_PROGRESSIVE</h4>
|
||||
<pre>public static final int OPT_PROGRESSIVE</pre>
|
||||
<div class="block">This option will enable progressive entropy coding in the JPEG image
|
||||
generated by this particular transform. Progressive entropy coding will
|
||||
generally improve compression relative to baseline entropy coding (the
|
||||
default), but it will reduce decompression performance considerably.
|
||||
Can be combined with <a href="#OPT_ARITHMETIC"><code>OPT_ARITHMETIC</code></a>. Implies
|
||||
<a href="#OPT_OPTIMIZE"><code>OPT_OPTIMIZE</code></a> unless <a href="#OPT_ARITHMETIC"><code>OPT_ARITHMETIC</code></a> is also specified.</div>
|
||||
<div class="block">Generate a progressive destination image instead of a single-scan
|
||||
destination image. Progressive JPEG images generally have better
|
||||
compression ratios than single-scan JPEG images (much better if the image
|
||||
has large areas of solid color), but progressive JPEG decompression is
|
||||
considerably slower than single-scan JPEG decompression. Can be combined
|
||||
with <a href="#OPT_ARITHMETIC"><code>OPT_ARITHMETIC</code></a>. Implies <a href="#OPT_OPTIMIZE"><code>OPT_OPTIMIZE</code></a> unless
|
||||
<a href="#OPT_ARITHMETIC"><code>OPT_ARITHMETIC</code></a> is also specified.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_PROGRESSIVE">Constant Field Values</a></dd>
|
||||
@@ -715,8 +710,8 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_COPYNONE</h4>
|
||||
<pre>public static final int OPT_COPYNONE</pre>
|
||||
<div class="block">This option will prevent <a href="TJTransformer.html#transform(byte%5B%5D%5B%5D,org.libjpegturbo.turbojpeg.TJTransform%5B%5D)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF
|
||||
and ICC profile data) from the source image to the destination image.</div>
|
||||
<div class="block">Do not copy any extra markers (including EXIF and ICC profile data) from
|
||||
the source image to the destination image.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_COPYNONE">Constant Field Values</a></dd>
|
||||
@@ -730,11 +725,10 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_ARITHMETIC</h4>
|
||||
<pre>public static final int OPT_ARITHMETIC</pre>
|
||||
<div class="block">This option will enable arithmetic entropy coding in the JPEG image
|
||||
generated by this particular transform. Arithmetic entropy coding will
|
||||
generally improve compression relative to Huffman entropy coding (the
|
||||
default), but it will reduce decompression performance considerably. Can
|
||||
be combined with <a href="#OPT_PROGRESSIVE"><code>OPT_PROGRESSIVE</code></a>.</div>
|
||||
<div class="block">Enable arithmetic entropy coding in the destination image. Arithmetic
|
||||
entropy coding generally improves compression relative to Huffman entropy
|
||||
coding (the default), but it reduces decompression performance
|
||||
considerably. Can be combined with <a href="#OPT_PROGRESSIVE"><code>OPT_PROGRESSIVE</code></a>.</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_ARITHMETIC">Constant Field Values</a></dd>
|
||||
@@ -748,9 +742,8 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_OPTIMIZE</h4>
|
||||
<pre>public static final int OPT_OPTIMIZE</pre>
|
||||
<div class="block">This option will enable optimized baseline entropy coding in the JPEG
|
||||
image generated by this particular transform. Optimized baseline entropy
|
||||
coding will improve compression slightly (generally 5% or less.)</div>
|
||||
<div class="block">Enable Huffman table optimization for the destination image. Huffman
|
||||
table optimization improves compression slightly (generally 5% or less.)</div>
|
||||
<dl>
|
||||
<dt><span class="seeLabel">See Also:</span></dt>
|
||||
<dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_OPTIMIZE">Constant Field Values</a></dd>
|
||||
|
||||
@@ -139,15 +139,15 @@ extends java.lang.Object</pre>
|
||||
serves as the destination image for YUV encode and decompress-to-YUV
|
||||
operations and as the source image for compress-from-YUV and YUV decode
|
||||
operations.
|
||||
<p>
|
||||
Technically, the JPEG format uses the YCbCr colorspace (which is technically
|
||||
not a colorspace but a color transform), but per the convention of the
|
||||
digital video community, the TurboJPEG API uses "YUV" to refer to an image
|
||||
format consisting of Y, Cb, and Cr image planes.
|
||||
<p>
|
||||
Each plane is simply a 2D array of bytes, each byte representing the value
|
||||
of one of the components (Y, Cb, or Cr) at a particular location in the
|
||||
image. The width and height of each plane are determined by the image
|
||||
|
||||
<p>Technically, the JPEG format uses the YCbCr colorspace (which is
|
||||
technically not a colorspace but a color transform), but per the convention
|
||||
of the digital video community, the TurboJPEG API uses "YUV" to refer to an
|
||||
image format consisting of Y, Cb, and Cr image planes.
|
||||
|
||||
<p>Each plane is simply a 2D array of bytes, each byte representing the
|
||||
value of one of the components (Y, Cb, or Cr) at a particular location in
|
||||
the image. The width and height of each plane are determined by the image
|
||||
width, height, and level of chrominance subsampling. The luminance plane
|
||||
width is the image width padded to the nearest multiple of the horizontal
|
||||
subsampling factor (1 in the case of 4:4:4, grayscale, 4:4:0, or 4:4:1; 2 in
|
||||
@@ -160,9 +160,9 @@ extends java.lang.Object</pre>
|
||||
the luminance plane width divided by the horizontal subsampling factor, and
|
||||
the chrominance plane height is equal to the luminance plane height divided
|
||||
by the vertical subsampling factor.
|
||||
<p>
|
||||
For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
|
||||
used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
|
||||
<p>For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling
|
||||
is used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
chrominance planes would be 18 x 35 bytes. If you specify a row alignment
|
||||
of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes,
|
||||
and each of the chrominance planes would be 20 x 35 bytes.</div>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2013, 2017-2018, 2020-2023 D. R. Commander.
|
||||
* Copyright (C)2011-2013, 2017-2018, 2020-2024 D. R. Commander.
|
||||
* All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
@@ -44,57 +44,72 @@ public final class TJ {
|
||||
*/
|
||||
public static final int NUMSAMP = 7;
|
||||
/**
|
||||
* 4:4:4 chrominance subsampling (no chrominance subsampling). The JPEG
|
||||
* or YUV image will contain one chrominance component for every pixel in the
|
||||
* source image.
|
||||
* 4:4:4 chrominance subsampling (no chrominance subsampling)
|
||||
*
|
||||
* <p>The JPEG or YUV image will contain one chrominance component for every
|
||||
* pixel in the source image.
|
||||
*/
|
||||
public static final int SAMP_444 = 0;
|
||||
/**
|
||||
* 4:2:2 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 2x1 block of pixels in the source image.
|
||||
* 4:2:2 chrominance subsampling
|
||||
*
|
||||
* <p>The JPEG or YUV image will contain one chrominance component for every
|
||||
* 2x1 block of pixels in the source image.
|
||||
*/
|
||||
public static final int SAMP_422 = 1;
|
||||
/**
|
||||
* 4:2:0 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 2x2 block of pixels in the source image.
|
||||
* 4:2:0 chrominance subsampling
|
||||
*
|
||||
* <p>The JPEG or YUV image will contain one chrominance component for every
|
||||
* 2x2 block of pixels in the source image.
|
||||
*/
|
||||
public static final int SAMP_420 = 2;
|
||||
/**
|
||||
* Grayscale. The JPEG or YUV image will contain no chrominance components.
|
||||
* Grayscale
|
||||
*
|
||||
* <p>The JPEG or YUV image will contain no chrominance components.
|
||||
*/
|
||||
public static final int SAMP_GRAY = 3;
|
||||
/**
|
||||
* 4:4:0 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 1x2 block of pixels in the source image.
|
||||
* Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.
|
||||
* 4:4:0 chrominance subsampling
|
||||
*
|
||||
* <p>The JPEG or YUV image will contain one chrominance component for every
|
||||
* 1x2 block of pixels in the source image.
|
||||
*
|
||||
* <p>NOTE: 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.
|
||||
*/
|
||||
public static final int SAMP_440 = 4;
|
||||
/**
|
||||
* 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 4x1 block of pixels in the source image.
|
||||
* JPEG images compressed with 4:1:1 subsampling will be almost exactly the
|
||||
* same size as those compressed with 4:2:0 subsampling, and in the
|
||||
* aggregate, both subsampling methods produce approximately the same
|
||||
* perceptual quality. However, 4:1:1 is better able to reproduce sharp
|
||||
* horizontal features. Note that 4:1:1 subsampling is not fully accelerated
|
||||
* in libjpeg-turbo.
|
||||
* 4:1:1 chrominance subsampling
|
||||
*
|
||||
* <p>The JPEG or YUV image will contain one chrominance component for every
|
||||
* 4x1 block of pixels in the source image. All else being equal, a JPEG
|
||||
* image with 4:1:1 subsampling is almost exactly the same size as a JPEG
|
||||
* image with 4:2:0 subsampling, and in the aggregate, both subsampling
|
||||
* methods produce approximately the same perceptual quality. However, 4:1:1
|
||||
* is better able to reproduce sharp horizontal features.
|
||||
*
|
||||
* <p>NOTE: 4:1:1 subsampling is not fully accelerated in libjpeg-turbo.
|
||||
*/
|
||||
public static final int SAMP_411 = 5;
|
||||
/**
|
||||
* 4:4:1 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 1x4 block of pixels in the source image.
|
||||
* JPEG images compressed with 4:4:1 subsampling will be almost exactly the
|
||||
* same size as those compressed with 4:2:0 subsampling, and in the
|
||||
* aggregate, both subsampling methods produce approximately the same
|
||||
* perceptual quality. However, 4:4:1 is better able to reproduce sharp
|
||||
* vertical features. Note that 4:4:1 subsampling is not fully accelerated
|
||||
* in libjpeg-turbo.
|
||||
* 4:4:1 chrominance subsampling
|
||||
*
|
||||
* <p>The JPEG or YUV image will contain one chrominance component for every
|
||||
* 1x4 block of pixels in the source image. All else being equal, a JPEG
|
||||
* image with 4:4:1 subsampling is almost exactly the same size as a JPEG
|
||||
* image with 4:2:0 subsampling, and in the aggregate, both subsampling
|
||||
* methods produce approximately the same perceptual quality. However, 4:4:1
|
||||
* is better able to reproduce sharp vertical features.
|
||||
*
|
||||
* <p>NOTE: 4:4:1 subsampling is not fully accelerated in libjpeg-turbo.
|
||||
*/
|
||||
public static final int SAMP_441 = 6;
|
||||
/**
|
||||
* Unknown subsampling. The JPEG image uses an unusual type of chrominance
|
||||
* subsampling. Such images can be decompressed into packed-pixel images,
|
||||
* but they cannot be
|
||||
* Unknown subsampling
|
||||
*
|
||||
* <p>The JPEG image uses an unusual type of chrominance subsampling. Such
|
||||
* images can be decompressed into packed-pixel images, but they cannot be
|
||||
* <ul>
|
||||
* <li> decompressed into planar YUV images,
|
||||
* <li> losslessly transformed if {@link TJTransform#OPT_CROP} is specified,
|
||||
@@ -149,89 +164,113 @@ public final class TJ {
|
||||
*/
|
||||
public static final int NUMPF = 12;
|
||||
/**
|
||||
* RGB pixel format. The red, green, and blue components in the image are
|
||||
* stored in 3-sample pixels in the order R, G, B from lowest to highest
|
||||
* memory address within each pixel.
|
||||
* RGB pixel format
|
||||
*
|
||||
* <p>The red, green, and blue components in the image are stored in 3-sample
|
||||
* pixels in the order R, G, B from lowest to highest memory address within
|
||||
* each pixel.
|
||||
*/
|
||||
public static final int PF_RGB = 0;
|
||||
/**
|
||||
* BGR pixel format. The red, green, and blue components in the image are
|
||||
* stored in 3-sample pixels in the order B, G, R from lowest to highest
|
||||
* memory address within each pixel.
|
||||
* BGR pixel format
|
||||
*
|
||||
* <p>The red, green, and blue components in the image are stored in 3-sample
|
||||
* pixels in the order B, G, R from lowest to highest memory address within
|
||||
* each pixel.
|
||||
*/
|
||||
public static final int PF_BGR = 1;
|
||||
/**
|
||||
* RGBX pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order R, G, B from lowest to highest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* RGBX pixel format
|
||||
*
|
||||
* <p>The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order R, G, B from lowest to highest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
public static final int PF_RGBX = 2;
|
||||
/**
|
||||
* BGRX pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order B, G, R from lowest to highest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* BGRX pixel format
|
||||
*
|
||||
* <p>The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order B, G, R from lowest to highest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
public static final int PF_BGRX = 3;
|
||||
/**
|
||||
* XBGR pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order R, G, B from highest to lowest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* XBGR pixel format
|
||||
*
|
||||
* <p>The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order R, G, B from highest to lowest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
public static final int PF_XBGR = 4;
|
||||
/**
|
||||
* XRGB pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order B, G, R from highest to lowest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* XRGB pixel format
|
||||
*
|
||||
* <p>The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order B, G, R from highest to lowest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
public static final int PF_XRGB = 5;
|
||||
/**
|
||||
* Grayscale pixel format. Each 1-sample pixel represents a luminance
|
||||
* (brightness) level from 0 to the maximum sample value (255 for 8-bit
|
||||
* samples, 4095 for 12-bit samples, and 65535 for 16-bit samples.)
|
||||
* Grayscale pixel format
|
||||
*
|
||||
* <p>Each 1-sample pixel represents a luminance (brightness) level from 0 to
|
||||
* the maximum sample value (255 for 8-bit samples, 4095 for 12-bit samples,
|
||||
* and 65535 for 16-bit samples.)
|
||||
*/
|
||||
public static final int PF_GRAY = 6;
|
||||
/**
|
||||
* RGBA pixel format. This is the same as {@link #PF_RGBX}, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* RGBA pixel format
|
||||
*
|
||||
* <p>This is the same as {@link #PF_RGBX}, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
public static final int PF_RGBA = 7;
|
||||
/**
|
||||
* BGRA pixel format. This is the same as {@link #PF_BGRX}, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* BGRA pixel format
|
||||
*
|
||||
* <p>This is the same as {@link #PF_BGRX}, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
public static final int PF_BGRA = 8;
|
||||
/**
|
||||
* ABGR pixel format. This is the same as {@link #PF_XBGR}, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* ABGR pixel format
|
||||
*
|
||||
* <p>This is the same as {@link #PF_XBGR}, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
public static final int PF_ABGR = 9;
|
||||
/**
|
||||
* ARGB pixel format. This is the same as {@link #PF_XRGB}, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* ARGB pixel format
|
||||
*
|
||||
* <p>This is the same as {@link #PF_XRGB}, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
public static final int PF_ARGB = 10;
|
||||
/**
|
||||
* CMYK pixel format. Unlike RGB, which is an additive color model used
|
||||
* primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive
|
||||
* color model used primarily for printing. In the CMYK color model, the
|
||||
* value of each color component typically corresponds to an amount of cyan,
|
||||
* magenta, yellow, or black ink that is applied to a white background. In
|
||||
* order to convert between CMYK and RGB, it is necessary to use a color
|
||||
* management system (CMS.) A CMS will attempt to map colors within the
|
||||
* printer's gamut to perceptually similar colors in the display's gamut and
|
||||
* vice versa, but the mapping is typically not 1:1 or reversible, nor can it
|
||||
* be defined with a simple formula. Thus, such a conversion is out of scope
|
||||
* for a codec library. However, the TurboJPEG API allows for compressing
|
||||
* packed-pixel CMYK images into YCCK JPEG images (see {@link #CS_YCCK}) and
|
||||
* decompressing YCCK JPEG images into packed-pixel CMYK images.
|
||||
* CMYK pixel format
|
||||
*
|
||||
* <p>Unlike RGB, which is an additive color model used primarily for
|
||||
* display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive color model used
|
||||
* primarily for printing. In the CMYK color model, the value of each color
|
||||
* component typically corresponds to an amount of cyan, magenta, yellow, or
|
||||
* black ink that is applied to a white background. In order to convert
|
||||
* between CMYK and RGB, it is necessary to use a color management system
|
||||
* (CMS.) A CMS will attempt to map colors within the printer's gamut to
|
||||
* perceptually similar colors in the display's gamut and vice versa, but the
|
||||
* mapping is typically not 1:1 or reversible, nor can it be defined with a
|
||||
* simple formula. Thus, such a conversion is out of scope for a codec
|
||||
* library. However, the TurboJPEG API allows for compressing packed-pixel
|
||||
* CMYK images into YCCK JPEG images (see {@link #CS_YCCK}) and decompressing
|
||||
* YCCK JPEG images into packed-pixel CMYK images.
|
||||
*/
|
||||
public static final int PF_CMYK = 11;
|
||||
|
||||
@@ -257,7 +296,7 @@ public final class TJ {
|
||||
* For the given pixel format, returns the number of samples that the red
|
||||
* component is offset from the start of the pixel. For instance, if an
|
||||
* 8-bit-per-sample pixel of format <code>TJ.PF_BGRX</code> is stored in
|
||||
* <code>char pixel[]</code>, then the red component will be
|
||||
* <code>char pixel[]</code>, then the red component is
|
||||
* <code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>.
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of {@link #PF_RGB PF_*})
|
||||
@@ -279,7 +318,7 @@ public final class TJ {
|
||||
* For the given pixel format, returns the number of samples that the green
|
||||
* component is offset from the start of the pixel. For instance, if an
|
||||
* 8-bit-per-sample pixel of format <code>TJ.PF_BGRX</code> is stored in
|
||||
* <code>char pixel[]</code>, then the green component will be
|
||||
* <code>char pixel[]</code>, then the green component is
|
||||
* <code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>.
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of {@link #PF_RGB PF_*})
|
||||
@@ -301,7 +340,7 @@ public final class TJ {
|
||||
* For the given pixel format, returns the number of samples that the blue
|
||||
* component is offset from the start of the pixel. For instance, if an
|
||||
* 8-bit-per-sample pixel of format <code>TJ.PF_BGRX</code> is stored in
|
||||
* <code>char pixel[]</code>, then the blue component will be
|
||||
* <code>char pixel[]</code>, then the blue component is
|
||||
* <code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>.
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of {@link #PF_RGB PF_*})
|
||||
@@ -323,7 +362,7 @@ public final class TJ {
|
||||
* For the given pixel format, returns the number of samples that the alpha
|
||||
* component is offset from the start of the pixel. For instance, if an
|
||||
* 8-bit-per-sample pixel of format <code>TJ.PF_BGRA</code> is stored in
|
||||
* <code>char pixel[]</code>, then the alpha component will be
|
||||
* <code>char pixel[]</code>, then the alpha component is
|
||||
* <code>pixel[TJ.getAlphaOffset(TJ.PF_BGRA)]</code>.
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of {@link #PF_RGB PF_*})
|
||||
@@ -346,57 +385,64 @@ public final class TJ {
|
||||
*/
|
||||
public static final int NUMCS = 5;
|
||||
/**
|
||||
* RGB colorspace. When compressing the JPEG image, the R, G, and B
|
||||
* components in the source image are reordered into image planes, but no
|
||||
* colorspace conversion or subsampling is performed. RGB JPEG images can be
|
||||
* compressed from and decompressed to packed-pixel images with any of the
|
||||
* extended RGB or grayscale pixel formats, but they cannot be compressed
|
||||
* from or decompressed to planar YUV images.
|
||||
* RGB colorspace
|
||||
*
|
||||
* <p>When generating the JPEG image, the R, G, and B components in the
|
||||
* source image are reordered into image planes, but no colorspace conversion
|
||||
* or subsampling is performed. RGB JPEG images can be generated from and
|
||||
* decompressed to packed-pixel images with any of the extended RGB or
|
||||
* grayscale pixel formats, but they cannot be generated from or
|
||||
* decompressed to planar YUV images.
|
||||
*/
|
||||
public static final int CS_RGB = 0;
|
||||
/**
|
||||
* YCbCr colorspace. YCbCr is not an absolute colorspace but rather a
|
||||
* mathematical transformation of RGB designed solely for storage and
|
||||
* transmission. YCbCr images must be converted to RGB before they can
|
||||
* actually be displayed. In the YCbCr colorspace, the Y (luminance)
|
||||
* component represents the black & white portion of the original image,
|
||||
* and the Cb and Cr (chrominance) components represent the color portion of
|
||||
* the original image. Originally, the analog equivalent of this
|
||||
* transformation allowed the same signal to drive both black & white and
|
||||
* color televisions, but JPEG images use YCbCr primarily because it allows
|
||||
* the color data to be optionally subsampled for the purposes of reducing
|
||||
* network or disk usage. YCbCr is the most common JPEG colorspace, and
|
||||
* YCbCr JPEG images can be compressed from and decompressed to packed-pixel
|
||||
* images with any of the extended RGB or grayscale pixel formats. YCbCr
|
||||
* JPEG images can also be compressed from and decompressed to planar YUV
|
||||
* images.
|
||||
* YCbCr colorspace
|
||||
*
|
||||
* <p>YCbCr is not an absolute colorspace but rather a mathematical
|
||||
* transformation of RGB designed solely for storage and transmission. YCbCr
|
||||
* images must be converted to RGB before they can be displayed. In the
|
||||
* YCbCr colorspace, the Y (luminance) component represents the black &
|
||||
* white portion of the original image, and the Cb and Cr (chrominance)
|
||||
* components represent the color portion of the original image.
|
||||
* Historically, the analog equivalent of this transformation allowed the
|
||||
* same signal to be displayed to both black & white and color
|
||||
* televisions, but JPEG images use YCbCr primarily because it allows the
|
||||
* color data to be optionally subsampled in order to reduce network and disk
|
||||
* usage. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images
|
||||
* can be generated from and decompressed to packed-pixel images with any of
|
||||
* the extended RGB or grayscale pixel formats. YCbCr JPEG images can also
|
||||
* be generated from and decompressed to planar YUV images.
|
||||
*/
|
||||
@SuppressWarnings("checkstyle:ConstantName")
|
||||
public static final int CS_YCbCr = 1;
|
||||
/**
|
||||
* Grayscale colorspace. The JPEG image retains only the luminance data (Y
|
||||
* component), and any color data from the source image is discarded.
|
||||
* Grayscale JPEG images can be compressed from and decompressed to
|
||||
* packed-pixel images with any of the extended RGB or grayscale pixel
|
||||
* formats, or they can be compressed from and decompressed to planar YUV
|
||||
* images.
|
||||
* Grayscale colorspace
|
||||
*
|
||||
* <p>The JPEG image retains only the luminance data (Y component), and any
|
||||
* color data from the source image is discarded. Grayscale JPEG images can
|
||||
* be generated from and decompressed to packed-pixel images with any of the
|
||||
* extended RGB or grayscale pixel formats, or they can be generated from and
|
||||
* decompressed to planar YUV images.
|
||||
*/
|
||||
public static final int CS_GRAY = 2;
|
||||
/**
|
||||
* CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K
|
||||
* components in the source image are reordered into image planes, but no
|
||||
* colorspace conversion or subsampling is performed. CMYK JPEG images can
|
||||
* only be compressed from and decompressed to packed-pixel images with the
|
||||
* CMYK pixel format.
|
||||
* CMYK colorspace
|
||||
*
|
||||
* <p>When generating the JPEG image, the C, M, Y, and K components in the
|
||||
* source image are reordered into image planes, but no colorspace conversion
|
||||
* or subsampling is performed. CMYK JPEG images can only be generated from
|
||||
* and decompressed to packed-pixel images with the CMYK pixel format.
|
||||
*/
|
||||
public static final int CS_CMYK = 3;
|
||||
/**
|
||||
* YCCK colorspace. YCCK (AKA "YCbCrK") is not an absolute colorspace but
|
||||
* rather a mathematical transformation of CMYK designed solely for storage
|
||||
* and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be
|
||||
* YCCK colorspace
|
||||
*
|
||||
* <p>YCCK (AKA "YCbCrK") is not an absolute colorspace but rather a
|
||||
* mathematical transformation of CMYK designed solely for storage and
|
||||
* transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be
|
||||
* reversibly transformed into YCCK, and as with YCbCr, the chrominance
|
||||
* components in the YCCK pixels can be subsampled without incurring major
|
||||
* perceptual loss. YCCK JPEG images can only be compressed from and
|
||||
* perceptual loss. YCCK JPEG images can only be generated from and
|
||||
* decompressed to packed-pixel images with the CMYK pixel format.
|
||||
*/
|
||||
public static final int CS_YCCK = 4;
|
||||
@@ -447,7 +493,7 @@ public final class TJ {
|
||||
* from CMYK to YCCK (see {@link #CS_YCCK}) as part of the JPEG compression
|
||||
* process, some of the Cb and Cr (chrominance) components can be discarded
|
||||
* or averaged together to produce a smaller image with little perceptible
|
||||
* loss of image clarity. (The human eye is more sensitive to small changes
|
||||
* loss of image quality. (The human eye is more sensitive to small changes
|
||||
* in brightness than to small changes in color.) This is called
|
||||
* "chrominance subsampling".
|
||||
*
|
||||
@@ -500,7 +546,7 @@ public final class TJ {
|
||||
* <p><b>Value</b>
|
||||
* <ul>
|
||||
* <li> <code>0</code> <i>[default]</i> Use smooth upsampling when
|
||||
* decompressing a JPEG image that was compressed using chrominance
|
||||
* decompressing a JPEG image that was generated using chrominance
|
||||
* subsampling. This creates a smooth transition between neighboring
|
||||
* chrominance components in order to reduce upsampling artifacts in the
|
||||
* decompressed image.
|
||||
@@ -532,14 +578,13 @@ public final class TJ {
|
||||
* <li> The difference in accuracy between the "fast" and "accurate"
|
||||
* algorithms is the most pronounced at JPEG quality levels above 90 and
|
||||
* tends to be more pronounced with decompression than with compression.
|
||||
* <li> The "fast" algorithm degrades and is not fully accelerated for JPEG
|
||||
* quality levels above 97, so it will be slower than the "accurate"
|
||||
* algorithm.
|
||||
* <li> For JPEG quality levels above 97, the "fast" algorithm degrades and
|
||||
* is not fully accelerated, so it is slower than the "accurate" algorithm.
|
||||
* </ul>
|
||||
*/
|
||||
public static final int PARAM_FASTDCT = 10;
|
||||
/**
|
||||
* Optimized baseline entropy coding [lossy compression only]
|
||||
* Huffman table optimization [lossy compression, lossless transformation]
|
||||
*
|
||||
* <p><b>Value</b>
|
||||
* <ul>
|
||||
@@ -550,37 +595,46 @@ public final class TJ {
|
||||
* {@link TJTransform#OPT_OPTIMIZE}.
|
||||
* </ul>
|
||||
*
|
||||
* <p>Optimized baseline entropy coding will improve compression slightly
|
||||
* (generally 5% or less), but it will reduce compression performance
|
||||
* considerably.
|
||||
* <p>Huffman table optimization improves compression slightly (generally 5%
|
||||
* or less), but it reduces compression performance considerably.
|
||||
*/
|
||||
public static final int PARAM_OPTIMIZE = 11;
|
||||
/**
|
||||
* Progressive entropy coding
|
||||
* Progressive JPEG
|
||||
*
|
||||
* <p>In a progressive JPEG image, the DCT coefficients are split across
|
||||
* multiple "scans" of increasing quality. Thus, a low-quality scan
|
||||
* containing the lowest-frequency DCT coefficients can be transmitted first
|
||||
* and refined with subsequent higher-quality scans containing
|
||||
* higher-frequency DCT coefficients. When using Huffman entropy coding, the
|
||||
* progressive JPEG format also provides an "end-of-bands (EOB) run" feature
|
||||
* that allows large groups of zeroes, potentially spanning multiple MCU
|
||||
* blocks, to be represented using only a few bytes.
|
||||
*
|
||||
* <p><b>Value</b>
|
||||
* <ul>
|
||||
* <li> <code>0</code> <i>[default for compression, lossless
|
||||
* transformation]</i> The lossy JPEG image uses (decompression) or will use
|
||||
* (compression, lossless transformation) baseline entropy coding.
|
||||
* <li> <code>1</code> The lossy JPEG image uses (decompression) or will use
|
||||
* (compression, lossless transformation) progressive entropy coding. For
|
||||
* lossless transformation, this can also be specified using
|
||||
* transformation]</i> The lossy JPEG image is (decompression) or will be
|
||||
* (compression, lossless transformation) single-scan.
|
||||
* <li> <code>1</code> The lossy JPEG image is (decompression) or will be
|
||||
* (compression, lossless transformation) progressive. For lossless
|
||||
* transformation, this can also be specified using
|
||||
* {@link TJTransform#OPT_PROGRESSIVE}.
|
||||
* </ul>
|
||||
*
|
||||
* <p>Progressive entropy coding will generally improve compression relative
|
||||
* to baseline entropy coding, but it will reduce compression and
|
||||
* decompression performance considerably. Can be combined with
|
||||
* {@link #PARAM_ARITHMETIC}. Implies {@link #PARAM_OPTIMIZE} unless
|
||||
* {@link #PARAM_ARITHMETIC} is also set.
|
||||
* <p>Progressive JPEG images generally have better compression ratios than
|
||||
* single-scan JPEG images (much better if the image has large areas of solid
|
||||
* color), but progressive JPEG compression and decompression is considerably
|
||||
* slower than single-scan JPEG compression and decompression. Can be
|
||||
* combined with {@link #PARAM_ARITHMETIC}. Implies {@link #PARAM_OPTIMIZE}
|
||||
* unless {@link #PARAM_ARITHMETIC} is also set.
|
||||
*/
|
||||
public static final int PARAM_PROGRESSIVE = 12;
|
||||
/**
|
||||
* Progressive JPEG scan limit for lossy JPEG images [decompression, lossless
|
||||
* transformation]
|
||||
*
|
||||
* <p>Setting this parameter will cause the decompression and transform
|
||||
* <p>Setting this parameter causes the decompression and transform
|
||||
* operations to throw an error if the number of scans in a progressive JPEG
|
||||
* image exceeds the specified limit. The primary purpose of this is to
|
||||
* allow security-critical applications to guard against an exploit of the
|
||||
@@ -611,9 +665,9 @@ public final class TJ {
|
||||
* {@link TJTransform#OPT_ARITHMETIC}.
|
||||
* </ul>
|
||||
*
|
||||
* <p>Arithmetic entropy coding will generally improve compression relative
|
||||
* to Huffman entropy coding, but it will reduce compression and
|
||||
* decompression performance considerably. Can be combined with
|
||||
* <p>Arithmetic entropy coding generally improves compression relative to
|
||||
* Huffman entropy coding, but it reduces compression and decompression
|
||||
* performance considerably. Can be combined with
|
||||
* {@link #PARAM_PROGRESSIVE}.
|
||||
*/
|
||||
public static final int PARAM_ARITHMETIC = 14;
|
||||
@@ -628,9 +682,9 @@ public final class TJ {
|
||||
* (compression) lossless/predictive.
|
||||
* </ul>
|
||||
*
|
||||
* <p>In most cases, compressing and decompressing lossless JPEG images is
|
||||
* considerably slower than compressing and decompressing lossy JPEG images,
|
||||
* and lossless JPEG images are much larger than lossy JPEG images. Thus,
|
||||
* <p>In most cases, lossless JPEG compression and decompression is
|
||||
* considerably slower than lossy JPEG compression and decompression, and
|
||||
* lossless JPEG images are much larger than lossy JPEG images. Thus,
|
||||
* lossless JPEG images are typically used only for applications that require
|
||||
* mathematically lossless compression. Also note that the following
|
||||
* features are not available with lossless JPEG images:
|
||||
@@ -642,7 +696,7 @@ public final class TJ {
|
||||
* {@link #SAMP_444})
|
||||
* <li> JPEG quality selection
|
||||
* <li> DCT/IDCT algorithm selection
|
||||
* <li> Progressive entropy coding
|
||||
* <li> Progressive JPEG
|
||||
* <li> Arithmetic entropy coding
|
||||
* <li> Compression from/decompression to planar YUV images
|
||||
* <li> Decompression scaling
|
||||
@@ -809,16 +863,15 @@ public final class TJ {
|
||||
* <ul>
|
||||
* <li> the maximum amount of memory (in megabytes) that will be allocated
|
||||
* for intermediate buffers, which are used with progressive JPEG compression
|
||||
* and decompression, optimized baseline entropy coding, lossless JPEG
|
||||
* compression, and lossless transformation <i>[default: <code>0</code> (no
|
||||
* limit)]</i>
|
||||
* and decompression, Huffman table optimization, lossless JPEG compression,
|
||||
* and lossless transformation <i>[default: <code>0</code> (no limit)]</i>
|
||||
* </ul>
|
||||
*/
|
||||
public static final int PARAM_MAXMEMORY = 23;
|
||||
/**
|
||||
* Image size limit [decompression, lossless transformation]
|
||||
*
|
||||
* <p>Setting this parameter will cause the decompression and transform
|
||||
* <p>Setting this parameter causes the decompression and transform
|
||||
* operations to throw an error if the number of pixels in the JPEG source
|
||||
* image exceeds the specified limit. This allows security-critical
|
||||
* applications to guard against excessive memory consumption.
|
||||
@@ -876,8 +929,8 @@ public final class TJ {
|
||||
/**
|
||||
* The error was non-fatal and recoverable, but the destination image may
|
||||
* still be corrupt.
|
||||
* <p>
|
||||
* NOTE: due to the design of the TurboJPEG Java API, only certain methods
|
||||
*
|
||||
* <p>NOTE: Due to the design of the TurboJPEG Java API, only certain methods
|
||||
* (specifically, {@link TJDecompressor TJDecompressor.decompress*()} methods
|
||||
* with a void return type) will complete and leave the destination image in
|
||||
* a fully recoverable state after a non-fatal error occurs.
|
||||
@@ -940,12 +993,12 @@ public final class TJ {
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
* 2 = V/Cr)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image. NOTE: this is the width
|
||||
* @param width width (in pixels) of the YUV image. NOTE: This is the width
|
||||
* of the whole image, not the plane width.
|
||||
*
|
||||
* @param stride bytes per row in the image plane.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image. NOTE: this is the
|
||||
* @param height height (in pixels) of the YUV image. NOTE: This is the
|
||||
* height of the whole image, not the plane height.
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011, 2013, 2023 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2011, 2013, 2023-2024 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -43,7 +43,7 @@ public interface TJCustomFilter {
|
||||
* applied in the frequency domain.
|
||||
*
|
||||
* @param coeffBuffer a buffer containing transformed DCT coefficients.
|
||||
* (NOTE: this buffer is not guaranteed to be valid once the callback
|
||||
* (NOTE: This buffer is not guaranteed to be valid once the callback
|
||||
* returns, so applications wishing to hand off the DCT coefficients to
|
||||
* another method should make a copy of them within the body of the
|
||||
* callback.)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2015, 2018, 2022-2023 D. R. Commander.
|
||||
* Copyright (C)2011-2015, 2018, 2022-2024 D. R. Commander.
|
||||
* All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
@@ -380,9 +380,9 @@ public class TJDecompressor implements Closeable {
|
||||
* source image associated with this decompressor instance and output an
|
||||
* 8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given
|
||||
* destination buffer.
|
||||
* <p>
|
||||
* NOTE: The destination image is fully recoverable if this method throws a
|
||||
* non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING} is
|
||||
*
|
||||
* <p>NOTE: The destination image is fully recoverable if this method throws
|
||||
* a non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING} is
|
||||
* set.)
|
||||
*
|
||||
* @param dstBuf buffer that will receive the packed-pixel
|
||||
@@ -413,7 +413,7 @@ public class TJDecompressor implements Closeable {
|
||||
* {@link TJ#getPixelSize TJ.getPixelSize}(pixelFormat)</code>.) However,
|
||||
* you can also use this parameter to specify the row alignment/padding of
|
||||
* the destination image, to skip rows, or to decompress/decode into a
|
||||
* specific region of a larger image. NOTE: if the source image is a lossy
|
||||
* specific region of a larger image. NOTE: If the source image is a lossy
|
||||
* JPEG image, then <code>destinationWidth</code> is either the scaled JPEG
|
||||
* width (see {@link #setScalingFactor setScalingFactor()},
|
||||
* {@link TJScalingFactor#getScaled TJScalingFactor.getScaled()}, and
|
||||
@@ -515,9 +515,9 @@ public class TJDecompressor implements Closeable {
|
||||
* Decompress the 12-bit-per-sample JPEG source image associated with this
|
||||
* decompressor instance and output a 12-bit-per-sample packed-pixel
|
||||
* grayscale, RGB, or CMYK image to the given destination buffer.
|
||||
* <p>
|
||||
* NOTE: The destination image is fully recoverable if this method throws a
|
||||
* non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING} is
|
||||
*
|
||||
* <p>NOTE: The destination image is fully recoverable if this method throws
|
||||
* a non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING} is
|
||||
* set.)
|
||||
*
|
||||
* @param dstBuf buffer that will receive the packed-pixel
|
||||
@@ -549,7 +549,7 @@ public class TJDecompressor implements Closeable {
|
||||
* {@link TJ#getPixelSize TJ.getPixelSize}(pixelFormat)</code>.) However,
|
||||
* you can also use this parameter to specify the row alignment/padding of
|
||||
* the destination image, to skip rows, or to decompress into a specific
|
||||
* region of a larger image. NOTE: if the source image is a lossy JPEG
|
||||
* region of a larger image. NOTE: If the source image is a lossy JPEG
|
||||
* image, then <code>destinationWidth</code> is either the scaled JPEG width
|
||||
* (see {@link #setScalingFactor setScalingFactor()},
|
||||
* {@link TJScalingFactor#getScaled TJScalingFactor.getScaled()}, and
|
||||
@@ -603,9 +603,9 @@ public class TJDecompressor implements Closeable {
|
||||
* with this decompressor instance and output a 16-bit-per-sample
|
||||
* packed-pixel grayscale, RGB, or CMYK image to the given destination
|
||||
* buffer.
|
||||
* <p>
|
||||
* NOTE: The destination image is fully recoverable if this method throws a
|
||||
* non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING} is
|
||||
*
|
||||
* <p>NOTE: The destination image is fully recoverable if this method throws
|
||||
* a non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING} is
|
||||
* set.)
|
||||
*
|
||||
* @param dstBuf buffer that will receive the packed-pixel
|
||||
@@ -678,9 +678,9 @@ public class TJDecompressor implements Closeable {
|
||||
* decompression but leaves out the color conversion step, so a planar YUV
|
||||
* image is generated instead of a packed-pixel image. This method cannot be
|
||||
* used to decompress JPEG source images with the CMYK or YCCK colorspace.
|
||||
* <p>
|
||||
* NOTE: The planar YUV destination image is fully recoverable if this method
|
||||
* throws a non-fatal {@link TJException} (unless
|
||||
*
|
||||
* <p>NOTE: The planar YUV destination image is fully recoverable if this
|
||||
* method throws a non-fatal {@link TJException} (unless
|
||||
* {@link TJ#PARAM_STOPONWARNING} is set.)
|
||||
*
|
||||
* @param dstImage {@link YUVImage} instance that will receive the planar YUV
|
||||
@@ -836,9 +836,9 @@ public class TJDecompressor implements Closeable {
|
||||
* source image associated with this decompressor instance and output an
|
||||
* 8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given
|
||||
* destination buffer.
|
||||
* <p>
|
||||
* NOTE: The destination image is fully recoverable if this method throws a
|
||||
* non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING}
|
||||
*
|
||||
* <p>NOTE: The destination image is fully recoverable if this method throws
|
||||
* a non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING}
|
||||
* is set.)
|
||||
*
|
||||
* @param dstBuf buffer that will receive the packed-pixel
|
||||
@@ -866,7 +866,7 @@ public class TJDecompressor implements Closeable {
|
||||
* should be set to <code>destinationWidth</code>. (Setting this parameter
|
||||
* to 0 is the equivalent of setting it to <code>destinationWidth</code>.)
|
||||
* However, you can also use this parameter to skip rows or to
|
||||
* decompress/decode into a specific region of a larger image. NOTE: if the
|
||||
* decompress/decode into a specific region of a larger image. NOTE: If the
|
||||
* source image is a lossy JPEG image, then <code>destinationWidth</code> is
|
||||
* either the scaled JPEG width (see {@link #setScalingFactor
|
||||
* setScalingFactor()}, {@link TJScalingFactor#getScaled
|
||||
@@ -921,9 +921,9 @@ public class TJDecompressor implements Closeable {
|
||||
* source image associated with this decompressor instance and output an
|
||||
* 8-bit-per-sample packed-pixel decompressed/decoded image to the given
|
||||
* <code>BufferedImage</code> instance.
|
||||
* <p>
|
||||
* NOTE: The destination image is fully recoverable if this method throws a
|
||||
* non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING}
|
||||
*
|
||||
* <p>NOTE: The destination image is fully recoverable if this method throws
|
||||
* a non-fatal {@link TJException} (unless {@link TJ#PARAM_STOPONWARNING}
|
||||
* is set.)
|
||||
*
|
||||
* @param dstImage a <code>BufferedImage</code> instance that will receive
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011, 2013, 2018, 2022-2023 D. R. Commander.
|
||||
* Copyright (C)2011, 2013, 2018, 2022-2024 D. R. Commander.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -92,69 +92,64 @@ public class TJTransform extends Rectangle {
|
||||
|
||||
|
||||
/**
|
||||
* This option will cause {@link TJTransformer#transform
|
||||
* This option causes {@link TJTransformer#transform
|
||||
* TJTransformer.transform()} to throw an exception if the transform is not
|
||||
* perfect. Lossless transforms operate on MCU blocks, whose size depends on
|
||||
* the level of chrominance subsampling used. If the image's width or height
|
||||
* is not evenly divisible by the MCU block size (see {@link TJ#getMCUWidth
|
||||
* TJ.getMCUWidth()} and {@link TJ#getMCUHeight TJ.getMCUHeight()}), then
|
||||
* there will be partial MCU blocks on the right and/or bottom edges. It is
|
||||
* not possible to move these partial MCU blocks to the top or left of the
|
||||
* image, so any transform that would require that is "imperfect." If this
|
||||
* option is not specified, then any partial MCU blocks that cannot be
|
||||
* transformed will be left in place, which will create odd-looking strips on
|
||||
* the right or bottom edge of the image.
|
||||
* perfect. Lossless transforms operate on MCU blocks, the size of which
|
||||
* depends on the level of chrominance subsampling used. If the image's
|
||||
* width or height is not evenly divisible by the MCU block size (see
|
||||
* {@link TJ#getMCUWidth TJ.getMCUWidth()} and {@link TJ#getMCUHeight
|
||||
* TJ.getMCUHeight()}), then there will be partial MCU blocks on the right
|
||||
* and/or bottom edges. It is not possible to move these partial MCU blocks
|
||||
* to the top or left of the image, so any transform that would require that
|
||||
* is "imperfect." If this option is not specified, then any partial MCU
|
||||
* blocks that cannot be transformed will be left in place, which will create
|
||||
* odd-looking strips on the right or bottom edge of the image.
|
||||
*/
|
||||
public static final int OPT_PERFECT = (1 << 0);
|
||||
/**
|
||||
* This option will discard any partial MCU blocks that cannot be
|
||||
* transformed.
|
||||
* Discard any partial MCU blocks that cannot be transformed.
|
||||
*/
|
||||
public static final int OPT_TRIM = (1 << 1);
|
||||
/**
|
||||
* This option will enable lossless cropping.
|
||||
* Enable lossless cropping.
|
||||
*/
|
||||
public static final int OPT_CROP = (1 << 2);
|
||||
/**
|
||||
* This option will discard the color data in the source image and produce a
|
||||
* grayscale destination image.
|
||||
* Discard the color data in the source image, and generate a grayscale
|
||||
* destination image.
|
||||
*/
|
||||
public static final int OPT_GRAY = (1 << 3);
|
||||
/**
|
||||
* This option will prevent {@link TJTransformer#transform
|
||||
* TJTransformer.transform()} from outputting a JPEG image for this
|
||||
* particular transform. This can be used in conjunction with a custom
|
||||
* filter to capture the transformed DCT coefficients without transcoding
|
||||
* them.
|
||||
* Do not generate a destination image. This can be used in conjunction with
|
||||
* a custom filter to capture the transformed DCT coefficients without
|
||||
* transcoding them.
|
||||
*/
|
||||
public static final int OPT_NOOUTPUT = (1 << 4);
|
||||
/**
|
||||
* This option will enable progressive entropy coding in the JPEG image
|
||||
* generated by this particular transform. Progressive entropy coding will
|
||||
* generally improve compression relative to baseline entropy coding (the
|
||||
* default), but it will reduce decompression performance considerably.
|
||||
* Can be combined with {@link #OPT_ARITHMETIC}. Implies
|
||||
* {@link #OPT_OPTIMIZE} unless {@link #OPT_ARITHMETIC} is also specified.
|
||||
* Generate a progressive destination image instead of a single-scan
|
||||
* destination image. Progressive JPEG images generally have better
|
||||
* compression ratios than single-scan JPEG images (much better if the image
|
||||
* has large areas of solid color), but progressive JPEG decompression is
|
||||
* considerably slower than single-scan JPEG decompression. Can be combined
|
||||
* with {@link #OPT_ARITHMETIC}. Implies {@link #OPT_OPTIMIZE} unless
|
||||
* {@link #OPT_ARITHMETIC} is also specified.
|
||||
*/
|
||||
public static final int OPT_PROGRESSIVE = (1 << 5);
|
||||
/**
|
||||
* This option will prevent {@link TJTransformer#transform
|
||||
* TJTransformer.transform()} from copying any extra markers (including EXIF
|
||||
* and ICC profile data) from the source image to the destination image.
|
||||
* Do not copy any extra markers (including EXIF and ICC profile data) from
|
||||
* the source image to the destination image.
|
||||
*/
|
||||
public static final int OPT_COPYNONE = (1 << 6);
|
||||
/**
|
||||
* This option will enable arithmetic entropy coding in the JPEG image
|
||||
* generated by this particular transform. Arithmetic entropy coding will
|
||||
* generally improve compression relative to Huffman entropy coding (the
|
||||
* default), but it will reduce decompression performance considerably. Can
|
||||
* be combined with {@link #OPT_PROGRESSIVE}.
|
||||
* Enable arithmetic entropy coding in the destination image. Arithmetic
|
||||
* entropy coding generally improves compression relative to Huffman entropy
|
||||
* coding (the default), but it reduces decompression performance
|
||||
* considerably. Can be combined with {@link #OPT_PROGRESSIVE}.
|
||||
*/
|
||||
public static final int OPT_ARITHMETIC = (1 << 7);
|
||||
/**
|
||||
* This option will enable optimized baseline entropy coding in the JPEG
|
||||
* image generated by this particular transform. Optimized baseline entropy
|
||||
* coding will improve compression slightly (generally 5% or less.)
|
||||
* Enable Huffman table optimization for the destination image. Huffman
|
||||
* table optimization improves compression slightly (generally 5% or less.)
|
||||
*/
|
||||
public static final int OPT_OPTIMIZE = (1 << 8);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2014, 2017, 2023 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2014, 2017, 2023-2024 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -37,15 +37,15 @@ package org.libjpegturbo.turbojpeg;
|
||||
* serves as the destination image for YUV encode and decompress-to-YUV
|
||||
* operations and as the source image for compress-from-YUV and YUV decode
|
||||
* operations.
|
||||
* <p>
|
||||
* Technically, the JPEG format uses the YCbCr colorspace (which is technically
|
||||
* not a colorspace but a color transform), but per the convention of the
|
||||
* digital video community, the TurboJPEG API uses "YUV" to refer to an image
|
||||
* format consisting of Y, Cb, and Cr image planes.
|
||||
* <p>
|
||||
* Each plane is simply a 2D array of bytes, each byte representing the value
|
||||
* of one of the components (Y, Cb, or Cr) at a particular location in the
|
||||
* image. The width and height of each plane are determined by the image
|
||||
*
|
||||
* <p>Technically, the JPEG format uses the YCbCr colorspace (which is
|
||||
* technically not a colorspace but a color transform), but per the convention
|
||||
* of the digital video community, the TurboJPEG API uses "YUV" to refer to an
|
||||
* image format consisting of Y, Cb, and Cr image planes.
|
||||
*
|
||||
* <p>Each plane is simply a 2D array of bytes, each byte representing the
|
||||
* value of one of the components (Y, Cb, or Cr) at a particular location in
|
||||
* the image. The width and height of each plane are determined by the image
|
||||
* width, height, and level of chrominance subsampling. The luminance plane
|
||||
* width is the image width padded to the nearest multiple of the horizontal
|
||||
* subsampling factor (1 in the case of 4:4:4, grayscale, 4:4:0, or 4:4:1; 2 in
|
||||
@@ -58,9 +58,9 @@ package org.libjpegturbo.turbojpeg;
|
||||
* the luminance plane width divided by the horizontal subsampling factor, and
|
||||
* the chrominance plane height is equal to the luminance plane height divided
|
||||
* by the vertical subsampling factor.
|
||||
* <p>
|
||||
* For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
|
||||
* used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
*
|
||||
* <p>For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling
|
||||
* is used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
* chrominance planes would be 18 x 35 bytes. If you specify a row alignment
|
||||
* of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes,
|
||||
* and each of the chrominance planes would be 20 x 35 bytes.
|
||||
|
||||
18
tjbench.c
18
tjbench.c
@@ -679,7 +679,7 @@ static int decompTest(char *fileName)
|
||||
subsamp = tj3Get(handle, TJPARAM_SUBSAMP);
|
||||
precision = tj3Get(handle, TJPARAM_PRECISION);
|
||||
if (tj3Get(handle, TJPARAM_PROGRESSIVE) == 1)
|
||||
printf("JPEG image uses progressive entropy coding\n\n");
|
||||
printf("JPEG image is progressive\n\n");
|
||||
if (tj3Get(handle, TJPARAM_ARITHMETIC) == 1)
|
||||
printf("JPEG image uses arithmetic entropy coding\n\n");
|
||||
if (tj3Set(handle, TJPARAM_PROGRESSIVE, progressive) == -1)
|
||||
@@ -919,8 +919,8 @@ static void usage(char *progName)
|
||||
printf("-lossless = Generate lossless JPEG images when compressing (implies\n");
|
||||
printf(" -subsamp 444). PSV is the predictor selection value (1-7).\n");
|
||||
printf("-maxmemory = Memory limit (in megabytes) for intermediate buffers used with\n");
|
||||
printf(" progressive JPEG compression and decompression, optimized baseline entropy\n");
|
||||
printf(" coding, lossless JPEG compression, and lossless transformation\n");
|
||||
printf(" progressive JPEG compression and decompression, Huffman table\n");
|
||||
printf(" optimization, lossless JPEG compression, and lossless transformation\n");
|
||||
printf(" [default = no limit]\n");
|
||||
printf("-maxpixels = Input image size limit (in pixels) [default = no limit]\n");
|
||||
printf("-nowrite = Do not write reference or output images (improves consistency of\n");
|
||||
@@ -958,11 +958,11 @@ static void usage(char *progName)
|
||||
printf(" the scaled MCU width.\n");
|
||||
printf("-fastdct = Use the fastest DCT/IDCT algorithm available\n");
|
||||
printf("-fastupsample = Use the fastest chrominance upsampling algorithm available\n");
|
||||
printf("-optimize = Use optimized baseline entropy coding in JPEG images generated by\n");
|
||||
printf("-optimize = Compute optimal Huffman tables for JPEG images generated by\n");
|
||||
printf(" compession and transform operations\n");
|
||||
printf("-progressive = Use progressive entropy coding in JPEG images generated by\n");
|
||||
printf(" compression and transform operations (can be combined with -arithmetic;\n");
|
||||
printf(" implies -optimize unless -arithmetic is also specified)\n");
|
||||
printf("-progressive = Generate progressive JPEG images when compressing or\n");
|
||||
printf(" transforming (can be combined with -arithmetic; implies -optimize unless\n");
|
||||
printf(" -arithmetic is also specified)\n");
|
||||
printf("-limitscans = Refuse to decompress or transform progressive JPEG images that\n");
|
||||
printf(" have an unreasonably large number of scans\n");
|
||||
printf("-scale M/N = When decompressing, scale the width/height of the JPEG image by a\n");
|
||||
@@ -1050,7 +1050,7 @@ int main(int argc, char *argv[])
|
||||
optimize = 1;
|
||||
xformOpt |= TJXOPT_OPTIMIZE;
|
||||
} else if (!strcasecmp(argv[i], "-progressive")) {
|
||||
printf("Using progressive entropy coding\n\n");
|
||||
printf("Generating progressive JPEG images\n\n");
|
||||
progressive = 1;
|
||||
xformOpt |= TJXOPT_PROGRESSIVE;
|
||||
} else if (!strcasecmp(argv[i], "-arithmetic")) {
|
||||
@@ -1197,7 +1197,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (optimize && !progressive && !arithmetic && !lossless && precision != 12)
|
||||
printf("Using optimized baseline entropy coding\n\n");
|
||||
printf("Computing optimal Huffman tables\n\n");
|
||||
|
||||
if (precision == 16 && !lossless) {
|
||||
printf("ERROR: -lossless must be specified along with -precision 16\n");
|
||||
|
||||
481
turbojpeg.h
481
turbojpeg.h
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2009-2015, 2017, 2020-2023 D. R. Commander.
|
||||
* Copyright (C)2009-2015, 2017, 2020-2024 D. R. Commander.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -85,7 +85,7 @@
|
||||
#define TJ_NUMINIT 3
|
||||
|
||||
/**
|
||||
* Initialization options.
|
||||
* Initialization options
|
||||
*/
|
||||
enum TJINIT {
|
||||
/**
|
||||
@@ -110,70 +110,83 @@ enum TJINIT {
|
||||
#define TJ_NUMSAMP 7
|
||||
|
||||
/**
|
||||
* Chrominance subsampling options.
|
||||
* Chrominance subsampling options
|
||||
*
|
||||
* When pixels are converted from RGB to YCbCr (see #TJCS_YCbCr) or from CMYK
|
||||
* to YCCK (see #TJCS_YCCK) as part of the JPEG compression process, some of
|
||||
* the Cb and Cr (chrominance) components can be discarded or averaged together
|
||||
* to produce a smaller image with little perceptible loss of image clarity.
|
||||
* to produce a smaller image with little perceptible loss of image quality.
|
||||
* (The human eye is more sensitive to small changes in brightness than to
|
||||
* small changes in color.) This is called "chrominance subsampling".
|
||||
*/
|
||||
enum TJSAMP {
|
||||
/**
|
||||
* 4:4:4 chrominance subsampling (no chrominance subsampling). The JPEG or
|
||||
* YUV image will contain one chrominance component for every pixel in the
|
||||
* source image.
|
||||
* 4:4:4 chrominance subsampling (no chrominance subsampling)
|
||||
*
|
||||
* The JPEG or YUV image will contain one chrominance component for every
|
||||
* pixel in the source image.
|
||||
*/
|
||||
TJSAMP_444,
|
||||
/**
|
||||
* 4:2:2 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 2x1 block of pixels in the source image.
|
||||
* 4:2:2 chrominance subsampling
|
||||
*
|
||||
* The JPEG or YUV image will contain one chrominance component for every 2x1
|
||||
* block of pixels in the source image.
|
||||
*/
|
||||
TJSAMP_422,
|
||||
/**
|
||||
* 4:2:0 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 2x2 block of pixels in the source image.
|
||||
* 4:2:0 chrominance subsampling
|
||||
*
|
||||
* The JPEG or YUV image will contain one chrominance component for every 2x2
|
||||
* block of pixels in the source image.
|
||||
*/
|
||||
TJSAMP_420,
|
||||
/**
|
||||
* Grayscale. The JPEG or YUV image will contain no chrominance components.
|
||||
* Grayscale
|
||||
*
|
||||
* The JPEG or YUV image will contain no chrominance components.
|
||||
*/
|
||||
TJSAMP_GRAY,
|
||||
/**
|
||||
* 4:4:0 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 1x2 block of pixels in the source image.
|
||||
* 4:4:0 chrominance subsampling
|
||||
*
|
||||
* The JPEG or YUV image will contain one chrominance component for every 1x2
|
||||
* block of pixels in the source image.
|
||||
*
|
||||
* @note 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.
|
||||
*/
|
||||
TJSAMP_440,
|
||||
/**
|
||||
* 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 4x1 block of pixels in the source image.
|
||||
* JPEG images compressed with 4:1:1 subsampling will be almost exactly the
|
||||
* same size as those compressed with 4:2:0 subsampling, and in the
|
||||
* aggregate, both subsampling methods produce approximately the same
|
||||
* perceptual quality. However, 4:1:1 is better able to reproduce sharp
|
||||
* horizontal features.
|
||||
* 4:1:1 chrominance subsampling
|
||||
*
|
||||
* The JPEG or YUV image will contain one chrominance component for every 4x1
|
||||
* block of pixels in the source image. All else being equal, a JPEG image
|
||||
* with 4:1:1 subsampling is almost exactly the same size as a JPEG image
|
||||
* with 4:2:0 subsampling, and in the aggregate, both subsampling methods
|
||||
* produce approximately the same perceptual quality. However, 4:1:1 is
|
||||
* better able to reproduce sharp horizontal features.
|
||||
*
|
||||
* @note 4:1:1 subsampling is not fully accelerated in libjpeg-turbo.
|
||||
*/
|
||||
TJSAMP_411,
|
||||
/**
|
||||
* 4:4:1 chrominance subsampling. The JPEG or YUV image will contain one
|
||||
* chrominance component for every 1x4 block of pixels in the source image.
|
||||
* JPEG images compressed with 4:4:1 subsampling will be almost exactly the
|
||||
* same size as those compressed with 4:2:0 subsampling, and in the
|
||||
* aggregate, both subsampling methods produce approximately the same
|
||||
* perceptual quality. However, 4:4:1 is better able to reproduce sharp
|
||||
* vertical features.
|
||||
* 4:4:1 chrominance subsampling
|
||||
*
|
||||
* The JPEG or YUV image will contain one chrominance component for every 1x4
|
||||
* block of pixels in the source image. All else being equal, a JPEG image
|
||||
* with 4:4:1 subsampling is almost exactly the same size as a JPEG image
|
||||
* with 4:2:0 subsampling, and in the aggregate, both subsampling methods
|
||||
* produce approximately the same perceptual quality. However, 4:4:1 is
|
||||
* better able to reproduce sharp vertical features.
|
||||
*
|
||||
* @note 4:4:1 subsampling is not fully accelerated in libjpeg-turbo.
|
||||
*/
|
||||
TJSAMP_441,
|
||||
/**
|
||||
* Unknown subsampling. The JPEG image uses an unusual type of chrominance
|
||||
* subsampling. Such images can be decompressed into packed-pixel images,
|
||||
* but they cannot be
|
||||
* Unknown subsampling
|
||||
*
|
||||
* The JPEG image uses an unusual type of chrominance subsampling. Such
|
||||
* images can be decompressed into packed-pixel images, but they cannot be
|
||||
* - decompressed into planar YUV images,
|
||||
* - losslessly transformed if #TJXOPT_CROP is specified, or
|
||||
* - partially decompressed using a cropping region.
|
||||
@@ -182,7 +195,8 @@ enum TJSAMP {
|
||||
};
|
||||
|
||||
/**
|
||||
* MCU block width (in pixels) for a given level of chrominance subsampling.
|
||||
* MCU block width (in pixels) for a given level of chrominance subsampling
|
||||
*
|
||||
* MCU block sizes:
|
||||
* - 8x8 for no subsampling or grayscale
|
||||
* - 16x8 for 4:2:2
|
||||
@@ -194,7 +208,8 @@ enum TJSAMP {
|
||||
static const int tjMCUWidth[TJ_NUMSAMP] = { 8, 16, 16, 8, 8, 32, 8 };
|
||||
|
||||
/**
|
||||
* MCU block height (in pixels) for a given level of chrominance subsampling.
|
||||
* MCU block height (in pixels) for a given level of chrominance subsampling
|
||||
*
|
||||
* MCU block sizes:
|
||||
* - 8x8 for no subsampling or grayscale
|
||||
* - 16x8 for 4:2:2
|
||||
@@ -216,138 +231,168 @@ static const int tjMCUHeight[TJ_NUMSAMP] = { 8, 8, 16, 8, 16, 8, 32 };
|
||||
*/
|
||||
enum TJPF {
|
||||
/**
|
||||
* RGB pixel format. The red, green, and blue components in the image are
|
||||
* stored in 3-sample pixels in the order R, G, B from lowest to highest
|
||||
* memory address within each pixel.
|
||||
* RGB pixel format
|
||||
*
|
||||
* The red, green, and blue components in the image are stored in 3-sample
|
||||
* pixels in the order R, G, B from lowest to highest memory address within
|
||||
* each pixel.
|
||||
*/
|
||||
TJPF_RGB,
|
||||
/**
|
||||
* BGR pixel format. The red, green, and blue components in the image are
|
||||
* stored in 3-sample pixels in the order B, G, R from lowest to highest
|
||||
* memory address within each pixel.
|
||||
* BGR pixel format
|
||||
*
|
||||
* The red, green, and blue components in the image are stored in 3-sample
|
||||
* pixels in the order B, G, R from lowest to highest memory address within
|
||||
* each pixel.
|
||||
*/
|
||||
TJPF_BGR,
|
||||
/**
|
||||
* RGBX pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order R, G, B from lowest to highest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* RGBX pixel format
|
||||
*
|
||||
* The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order R, G, B from lowest to highest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
TJPF_RGBX,
|
||||
/**
|
||||
* BGRX pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order B, G, R from lowest to highest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* BGRX pixel format
|
||||
*
|
||||
* The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order B, G, R from lowest to highest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
TJPF_BGRX,
|
||||
/**
|
||||
* XBGR pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order R, G, B from highest to lowest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* XBGR pixel format
|
||||
*
|
||||
* The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order R, G, B from highest to lowest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
TJPF_XBGR,
|
||||
/**
|
||||
* XRGB pixel format. The red, green, and blue components in the image are
|
||||
* stored in 4-sample pixels in the order B, G, R from highest to lowest
|
||||
* memory address within each pixel. The X component is ignored when
|
||||
* compressing and undefined when decompressing.
|
||||
* XRGB pixel format
|
||||
*
|
||||
* The red, green, and blue components in the image are stored in 4-sample
|
||||
* pixels in the order B, G, R from highest to lowest memory address within
|
||||
* each pixel. The X component is ignored when compressing/encoding and
|
||||
* undefined when decompressing/decoding.
|
||||
*/
|
||||
TJPF_XRGB,
|
||||
/**
|
||||
* Grayscale pixel format. Each 1-sample pixel represents a luminance
|
||||
* (brightness) level from 0 to the maximum sample value (255 for 8-bit
|
||||
* samples, 4095 for 12-bit samples, and 65535 for 16-bit samples.)
|
||||
* Grayscale pixel format
|
||||
*
|
||||
* Each 1-sample pixel represents a luminance (brightness) level from 0 to
|
||||
* the maximum sample value (255 for 8-bit samples, 4095 for 12-bit samples,
|
||||
* and 65535 for 16-bit samples.)
|
||||
*/
|
||||
TJPF_GRAY,
|
||||
/**
|
||||
* RGBA pixel format. This is the same as @ref TJPF_RGBX, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* RGBA pixel format
|
||||
*
|
||||
* This is the same as @ref TJPF_RGBX, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
TJPF_RGBA,
|
||||
/**
|
||||
* BGRA pixel format. This is the same as @ref TJPF_BGRX, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* BGRA pixel format
|
||||
*
|
||||
* This is the same as @ref TJPF_BGRX, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
TJPF_BGRA,
|
||||
/**
|
||||
* ABGR pixel format. This is the same as @ref TJPF_XBGR, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* ABGR pixel format
|
||||
*
|
||||
* This is the same as @ref TJPF_XBGR, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
TJPF_ABGR,
|
||||
/**
|
||||
* ARGB pixel format. This is the same as @ref TJPF_XRGB, except that when
|
||||
* decompressing, the X component is guaranteed to be equal to the maximum
|
||||
* sample value, which can be interpreted as an opaque alpha channel.
|
||||
* ARGB pixel format
|
||||
*
|
||||
* This is the same as @ref TJPF_XRGB, except that when
|
||||
* decompressing/decoding, the X component is guaranteed to be equal to the
|
||||
* maximum sample value, which can be interpreted as an opaque alpha channel.
|
||||
*/
|
||||
TJPF_ARGB,
|
||||
/**
|
||||
* CMYK pixel format. Unlike RGB, which is an additive color model used
|
||||
* primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive
|
||||
* color model used primarily for printing. In the CMYK color model, the
|
||||
* value of each color component typically corresponds to an amount of cyan,
|
||||
* magenta, yellow, or black ink that is applied to a white background. In
|
||||
* order to convert between CMYK and RGB, it is necessary to use a color
|
||||
* management system (CMS.) A CMS will attempt to map colors within the
|
||||
* printer's gamut to perceptually similar colors in the display's gamut and
|
||||
* vice versa, but the mapping is typically not 1:1 or reversible, nor can it
|
||||
* be defined with a simple formula. Thus, such a conversion is out of scope
|
||||
* for a codec library. However, the TurboJPEG API allows for compressing
|
||||
* packed-pixel CMYK images into YCCK JPEG images (see #TJCS_YCCK) and
|
||||
* decompressing YCCK JPEG images into packed-pixel CMYK images.
|
||||
* CMYK pixel format
|
||||
*
|
||||
* Unlike RGB, which is an additive color model used primarily for display,
|
||||
* CMYK (Cyan/Magenta/Yellow/Key) is a subtractive color model used primarily
|
||||
* for printing. In the CMYK color model, the value of each color component
|
||||
* typically corresponds to an amount of cyan, magenta, yellow, or black ink
|
||||
* that is applied to a white background. In order to convert between CMYK
|
||||
* and RGB, it is necessary to use a color management system (CMS.) A CMS
|
||||
* will attempt to map colors within the printer's gamut to perceptually
|
||||
* similar colors in the display's gamut and vice versa, but the mapping is
|
||||
* typically not 1:1 or reversible, nor can it be defined with a simple
|
||||
* formula. Thus, such a conversion is out of scope for a codec library.
|
||||
* However, the TurboJPEG API allows for compressing packed-pixel CMYK images
|
||||
* into YCCK JPEG images (see #TJCS_YCCK) and decompressing YCCK JPEG images
|
||||
* into packed-pixel CMYK images.
|
||||
*/
|
||||
TJPF_CMYK,
|
||||
/**
|
||||
* Unknown pixel format. Currently this is only used by #tj3LoadImage8(),
|
||||
* #tj3LoadImage12(), and #tj3LoadImage16().
|
||||
* Unknown pixel format
|
||||
*
|
||||
* Currently this is only used by #tj3LoadImage8(), #tj3LoadImage12(), and
|
||||
* #tj3LoadImage16().
|
||||
*/
|
||||
TJPF_UNKNOWN = -1
|
||||
};
|
||||
|
||||
/**
|
||||
* Red offset (in samples) for a given pixel format. This specifies the number
|
||||
* of samples that the red component is offset from the start of the pixel.
|
||||
* For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored
|
||||
* in `unsigned char pixel[]`, then the red component will be
|
||||
* `pixel[tjRedOffset[TJPF_BGRX]]`. This will be -1 if the pixel format does
|
||||
* not have a red component.
|
||||
* Red offset (in samples) for a given pixel format
|
||||
*
|
||||
* This specifies the number of samples that the red component is offset from
|
||||
* the start of the pixel. For instance, if an 8-bit-per-component pixel of
|
||||
* format TJPF_BGRX is stored in `unsigned char pixel[]`, then the red
|
||||
* component is `pixel[tjRedOffset[TJPF_BGRX]]`. The offset is -1 if the pixel
|
||||
* format does not have a red component.
|
||||
*/
|
||||
static const int tjRedOffset[TJ_NUMPF] = {
|
||||
0, 2, 0, 2, 3, 1, -1, 0, 2, 3, 1, -1
|
||||
};
|
||||
/**
|
||||
* Green offset (in samples) for a given pixel format. This specifies the
|
||||
* number of samples that the green component is offset from the start of the
|
||||
* pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is
|
||||
* stored in `unsigned char pixel[]`, then the green component will be
|
||||
* `pixel[tjGreenOffset[TJPF_BGRX]]`. This will be -1 if the pixel format does
|
||||
* not have a green component.
|
||||
* Green offset (in samples) for a given pixel format
|
||||
*
|
||||
* This specifies the number of samples that the green component is offset from
|
||||
* the start of the pixel. For instance, if an 8-bit-per-component pixel of
|
||||
* format TJPF_BGRX is stored in `unsigned char pixel[]`, then the green
|
||||
* component is `pixel[tjGreenOffset[TJPF_BGRX]]`. The offset is -1 if the
|
||||
* pixel format does not have a green component.
|
||||
*/
|
||||
static const int tjGreenOffset[TJ_NUMPF] = {
|
||||
1, 1, 1, 1, 2, 2, -1, 1, 1, 2, 2, -1
|
||||
};
|
||||
/**
|
||||
* Blue offset (in samples) for a given pixel format. This specifies the
|
||||
* number of samples that the blue component is offset from the start of the
|
||||
* pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is
|
||||
* stored in `unsigned char pixel[]`, then the blue component will be
|
||||
* `pixel[tjBlueOffset[TJPF_BGRX]]`. This will be -1 if the pixel format does
|
||||
* not have a blue component.
|
||||
* Blue offset (in samples) for a given pixel format
|
||||
*
|
||||
* This specifies the number of samples that the blue component is offset from
|
||||
* the start of the pixel. For instance, if an 8-bit-per-component pixel of
|
||||
* format TJPF_BGRX is stored in `unsigned char pixel[]`, then the blue
|
||||
* component is `pixel[tjBlueOffset[TJPF_BGRX]]`. The offset is -1 if the
|
||||
* pixel format does not have a blue component.
|
||||
*/
|
||||
static const int tjBlueOffset[TJ_NUMPF] = {
|
||||
2, 0, 2, 0, 1, 3, -1, 2, 0, 1, 3, -1
|
||||
};
|
||||
/**
|
||||
* Alpha offset (in samples) for a given pixel format. This specifies the
|
||||
* number of samples that the alpha component is offset from the start of the
|
||||
* pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRA is
|
||||
* stored in `unsigned char pixel[]`, then the alpha component will be
|
||||
* `pixel[tjAlphaOffset[TJPF_BGRA]]`. This will be -1 if the pixel format does
|
||||
* not have an alpha component.
|
||||
* Alpha offset (in samples) for a given pixel format
|
||||
*
|
||||
* This specifies the number of samples that the alpha component is offset from
|
||||
* the start of the pixel. For instance, if an 8-bit-per-component pixel of
|
||||
* format TJPF_BGRA is stored in `unsigned char pixel[]`, then the alpha
|
||||
* component is `pixel[tjAlphaOffset[TJPF_BGRA]]`. The offset is -1 if the
|
||||
* pixel format does not have an alpha component.
|
||||
*/
|
||||
static const int tjAlphaOffset[TJ_NUMPF] = {
|
||||
-1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0, -1
|
||||
@@ -370,55 +415,63 @@ static const int tjPixelSize[TJ_NUMPF] = {
|
||||
*/
|
||||
enum TJCS {
|
||||
/**
|
||||
* RGB colorspace. When compressing the JPEG image, the R, G, and B
|
||||
* components in the source image are reordered into image planes, but no
|
||||
* colorspace conversion or subsampling is performed. RGB JPEG images can be
|
||||
* compressed from and decompressed to packed-pixel images with any of the
|
||||
* extended RGB or grayscale pixel formats, but they cannot be compressed
|
||||
* from or decompressed to planar YUV images.
|
||||
* RGB colorspace
|
||||
*
|
||||
* When generating the JPEG image, the R, G, and B components in the source
|
||||
* image are reordered into image planes, but no colorspace conversion or
|
||||
* subsampling is performed. RGB JPEG images can be generated from and
|
||||
* decompressed to packed-pixel images with any of the extended RGB or
|
||||
* grayscale pixel formats, but they cannot be generated from or
|
||||
* decompressed to planar YUV images.
|
||||
*/
|
||||
TJCS_RGB,
|
||||
/**
|
||||
* YCbCr colorspace. YCbCr is not an absolute colorspace but rather a
|
||||
* mathematical transformation of RGB designed solely for storage and
|
||||
* transmission. YCbCr images must be converted to RGB before they can
|
||||
* actually be displayed. In the YCbCr colorspace, the Y (luminance)
|
||||
* component represents the black & white portion of the original image, and
|
||||
* the Cb and Cr (chrominance) components represent the color portion of the
|
||||
* original image. Originally, the analog equivalent of this transformation
|
||||
* allowed the same signal to drive both black & white and color televisions,
|
||||
* but JPEG images use YCbCr primarily because it allows the color data to be
|
||||
* optionally subsampled for the purposes of reducing network or disk usage.
|
||||
* YCbCr is the most common JPEG colorspace, and YCbCr JPEG images can be
|
||||
* compressed from and decompressed to packed-pixel images with any of the
|
||||
* extended RGB or grayscale pixel formats. YCbCr JPEG images can also be
|
||||
* compressed from and decompressed to planar YUV images.
|
||||
* YCbCr colorspace
|
||||
*
|
||||
* YCbCr is not an absolute colorspace but rather a mathematical
|
||||
* transformation of RGB designed solely for storage and transmission. YCbCr
|
||||
* images must be converted to RGB before they can be displayed. In the
|
||||
* YCbCr colorspace, the Y (luminance) component represents the black & white
|
||||
* portion of the original image, and the Cb and Cr (chrominance) components
|
||||
* represent the color portion of the original image. Historically, the
|
||||
* analog equivalent of this transformation allowed the same signal to be
|
||||
* displayed to both black & white and color televisions, but JPEG images use
|
||||
* YCbCr primarily because it allows the color data to be optionally
|
||||
* subsampled in order to reduce network and disk usage. YCbCr is the most
|
||||
* common JPEG colorspace, and YCbCr JPEG images can be generated from and
|
||||
* decompressed to packed-pixel images with any of the extended RGB or
|
||||
* grayscale pixel formats. YCbCr JPEG images can also be generated from
|
||||
* and decompressed to planar YUV images.
|
||||
*/
|
||||
TJCS_YCbCr,
|
||||
/**
|
||||
* Grayscale colorspace. The JPEG image retains only the luminance data (Y
|
||||
* component), and any color data from the source image is discarded.
|
||||
* Grayscale JPEG images can be compressed from and decompressed to
|
||||
* packed-pixel images with any of the extended RGB or grayscale pixel
|
||||
* formats, or they can be compressed from and decompressed to planar YUV
|
||||
* images.
|
||||
* Grayscale colorspace
|
||||
*
|
||||
* The JPEG image retains only the luminance data (Y component), and any
|
||||
* color data from the source image is discarded. Grayscale JPEG images can
|
||||
* be generated from and decompressed to packed-pixel images with any of the
|
||||
* extended RGB or grayscale pixel formats, or they can be generated from
|
||||
* and decompressed to planar YUV images.
|
||||
*/
|
||||
TJCS_GRAY,
|
||||
/**
|
||||
* CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K
|
||||
* components in the source image are reordered into image planes, but no
|
||||
* colorspace conversion or subsampling is performed. CMYK JPEG images can
|
||||
* only be compressed from and decompressed to packed-pixel images with the
|
||||
* CMYK pixel format.
|
||||
* CMYK colorspace
|
||||
*
|
||||
* When generating the JPEG image, the C, M, Y, and K components in the
|
||||
* source image are reordered into image planes, but no colorspace conversion
|
||||
* or subsampling is performed. CMYK JPEG images can only be generated from
|
||||
* and decompressed to packed-pixel images with the CMYK pixel format.
|
||||
*/
|
||||
TJCS_CMYK,
|
||||
/**
|
||||
* YCCK colorspace. YCCK (AKA "YCbCrK") is not an absolute colorspace but
|
||||
* rather a mathematical transformation of CMYK designed solely for storage
|
||||
* and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be
|
||||
* YCCK colorspace
|
||||
*
|
||||
* YCCK (AKA "YCbCrK") is not an absolute colorspace but rather a
|
||||
* mathematical transformation of CMYK designed solely for storage and
|
||||
* transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be
|
||||
* reversibly transformed into YCCK, and as with YCbCr, the chrominance
|
||||
* components in the YCCK pixels can be subsampled without incurring major
|
||||
* perceptual loss. YCCK JPEG images can only be compressed from and
|
||||
* perceptual loss. YCCK JPEG images can only be generated from and
|
||||
* decompressed to packed-pixel images with the CMYK pixel format.
|
||||
*/
|
||||
TJCS_YCCK
|
||||
@@ -516,7 +569,7 @@ enum TJPARAM {
|
||||
*
|
||||
* **Value**
|
||||
* - `0` *[default]* Use smooth upsampling when decompressing a JPEG image
|
||||
* that was compressed using chrominance subsampling. This creates a smooth
|
||||
* that was generated using chrominance subsampling. This creates a smooth
|
||||
* transition between neighboring chrominance components in order to reduce
|
||||
* upsampling artifacts in the decompressed image.
|
||||
* - `1` Use the fastest chrominance upsampling algorithm available, which
|
||||
@@ -541,13 +594,12 @@ enum TJPARAM {
|
||||
* - The difference in accuracy between the "fast" and "accurate" algorithms
|
||||
* is the most pronounced at JPEG quality levels above 90 and tends to be
|
||||
* more pronounced with decompression than with compression.
|
||||
* - The "fast" algorithm degrades and is not fully accelerated for JPEG
|
||||
* quality levels above 97, so it will be slower than the "accurate"
|
||||
* algorithm.
|
||||
* - For JPEG quality levels above 97, the "fast" algorithm degrades and is
|
||||
* not fully accelerated, so it is slower than the "accurate" algorithm.
|
||||
*/
|
||||
TJPARAM_FASTDCT,
|
||||
/**
|
||||
* Optimized baseline entropy coding [lossy compression only]
|
||||
* Huffman table optimization [lossy compression, lossless transformation]
|
||||
*
|
||||
* **Value**
|
||||
* - `0` *[default]* The JPEG image will use the default Huffman tables.
|
||||
@@ -555,36 +607,46 @@ enum TJPARAM {
|
||||
* lossless transformation, this can also be specified using
|
||||
* #TJXOPT_OPTIMIZE.
|
||||
*
|
||||
* Optimized baseline entropy coding will improve compression slightly
|
||||
* (generally 5% or less), but it will reduce compression performance
|
||||
* considerably.
|
||||
* Huffman table optimization improves compression slightly (generally 5% or
|
||||
* less), but it reduces compression performance considerably.
|
||||
*/
|
||||
TJPARAM_OPTIMIZE,
|
||||
/**
|
||||
* Progressive entropy coding
|
||||
* Progressive JPEG
|
||||
*
|
||||
* In a progressive JPEG image, the DCT coefficients are split across
|
||||
* multiple "scans" of increasing quality. Thus, a low-quality scan
|
||||
* containing the lowest-frequency DCT coefficients can be transmitted first
|
||||
* and refined with subsequent higher-quality scans containing
|
||||
* higher-frequency DCT coefficients. When using Huffman entropy coding, the
|
||||
* progressive JPEG format also provides an "end-of-bands (EOB) run" feature
|
||||
* that allows large groups of zeroes, potentially spanning multiple MCU
|
||||
* blocks, to be represented using only a few bytes.
|
||||
*
|
||||
* **Value**
|
||||
* - `0` *[default for compression, lossless transformation]* The lossy JPEG
|
||||
* image uses (decompression) or will use (compression, lossless
|
||||
* transformation) baseline entropy coding.
|
||||
* - `1` The lossy JPEG image uses (decompression) or will use (compression,
|
||||
* lossless transformation) progressive entropy coding. For lossless
|
||||
* transformation, this can also be specified using #TJXOPT_PROGRESSIVE.
|
||||
* image is (decompression) or will be (compression, lossless transformation)
|
||||
* single-scan.
|
||||
* - `1` The lossy JPEG image is (decompression) or will be (compression,
|
||||
* lossless transformation) progressive. For lossless transformation, this
|
||||
* can also be specified using #TJXOPT_PROGRESSIVE.
|
||||
*
|
||||
* Progressive entropy coding will generally improve compression relative to
|
||||
* baseline entropy coding, but it will reduce compression and decompression
|
||||
* performance considerably. Can be combined with #TJPARAM_ARITHMETIC.
|
||||
* Implies #TJPARAM_OPTIMIZE unless #TJPARAM_ARITHMETIC is also set.
|
||||
* Progressive JPEG images generally have better compression ratios than
|
||||
* single-scan JPEG images (much better if the image has large areas of solid
|
||||
* color), but progressive JPEG compression and decompression is considerably
|
||||
* slower than single-scan JPEG compression and decompression. Can be
|
||||
* combined with #TJPARAM_ARITHMETIC. Implies #TJPARAM_OPTIMIZE unless
|
||||
* #TJPARAM_ARITHMETIC is also set.
|
||||
*/
|
||||
TJPARAM_PROGRESSIVE,
|
||||
/**
|
||||
* Progressive JPEG scan limit for lossy JPEG images [decompression, lossless
|
||||
* transformation]
|
||||
*
|
||||
* Setting this parameter will cause the decompression and transform
|
||||
* functions to return an error if the number of scans in a progressive JPEG
|
||||
* image exceeds the specified limit. The primary purpose of this is to
|
||||
* allow security-critical applications to guard against an exploit of the
|
||||
* Setting this parameter causes the decompression and transform functions to
|
||||
* return an error if the number of scans in a progressive JPEG image exceeds
|
||||
* the specified limit. The primary purpose of this is to allow
|
||||
* security-critical applications to guard against an exploit of the
|
||||
* progressive JPEG format described in
|
||||
* <a href="https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf" target="_blank">this report</a>.
|
||||
*
|
||||
@@ -606,8 +668,8 @@ enum TJPARAM {
|
||||
* lossless transformation) arithmetic entropy coding. For lossless
|
||||
* transformation, this can also be specified using #TJXOPT_ARITHMETIC.
|
||||
*
|
||||
* Arithmetic entropy coding will generally improve compression relative to
|
||||
* Huffman entropy coding, but it will reduce compression and decompression
|
||||
* Arithmetic entropy coding generally improves compression relative to
|
||||
* Huffman entropy coding, but it reduces compression and decompression
|
||||
* performance considerably. Can be combined with #TJPARAM_PROGRESSIVE.
|
||||
*/
|
||||
TJPARAM_ARITHMETIC,
|
||||
@@ -620,19 +682,19 @@ enum TJPARAM {
|
||||
* - `1` The JPEG image is (decompression) or will be (compression)
|
||||
* lossless/predictive.
|
||||
*
|
||||
* In most cases, compressing and decompressing lossless JPEG images is
|
||||
* considerably slower than compressing and decompressing lossy JPEG images,
|
||||
* and lossless JPEG images are much larger than lossy JPEG images. Thus,
|
||||
* lossless JPEG images are typically used only for applications that require
|
||||
* mathematically lossless compression. Also note that the following
|
||||
* features are not available with lossless JPEG images:
|
||||
* In most cases, lossless JPEG compression and decompression is considerably
|
||||
* slower than lossy JPEG compression and decompression, and lossless JPEG
|
||||
* images are much larger than lossy JPEG images. Thus, lossless JPEG images
|
||||
* are typically used only for applications that require mathematically
|
||||
* lossless compression. Also note that the following features are not
|
||||
* available with lossless JPEG images:
|
||||
* - Colorspace conversion (lossless JPEG images always use #TJCS_RGB,
|
||||
* #TJCS_GRAY, or #TJCS_CMYK, depending on the pixel format of the source
|
||||
* image)
|
||||
* - Chrominance subsampling (lossless JPEG images always use #TJSAMP_444)
|
||||
* - JPEG quality selection
|
||||
* - DCT/IDCT algorithm selection
|
||||
* - Progressive entropy coding
|
||||
* - Progressive JPEG
|
||||
* - Arithmetic entropy coding
|
||||
* - Compression from/decompression to planar YUV images
|
||||
* - Decompression scaling
|
||||
@@ -783,15 +845,15 @@ enum TJPARAM {
|
||||
* **Value**
|
||||
* - the maximum amount of memory (in megabytes) that will be allocated for
|
||||
* intermediate buffers, which are used with progressive JPEG compression and
|
||||
* decompression, optimized baseline entropy coding, lossless JPEG
|
||||
* compression, and lossless transformation *[default: `0` (no limit)]*
|
||||
* decompression, Huffman table optimization, lossless JPEG compression, and
|
||||
* lossless transformation *[default: `0` (no limit)]*
|
||||
*/
|
||||
TJPARAM_MAXMEMORY,
|
||||
/**
|
||||
* Image size limit [decompression, lossless transformation, packed-pixel
|
||||
* image loading]
|
||||
*
|
||||
* Setting this parameter will cause the decompression, transform, and image
|
||||
* Setting this parameter causes the decompression, transform, and image
|
||||
* loading functions to return an error if the number of pixels in the source
|
||||
* image exceeds the specified limit. This allows security-critical
|
||||
* applications to guard against excessive memory consumption.
|
||||
@@ -835,7 +897,7 @@ enum TJERR {
|
||||
*/
|
||||
enum TJXOP {
|
||||
/**
|
||||
* Do not transform the position of the image pixels
|
||||
* Do not transform the position of the image pixels.
|
||||
*/
|
||||
TJXOP_NONE,
|
||||
/**
|
||||
@@ -880,8 +942,8 @@ enum TJXOP {
|
||||
|
||||
|
||||
/**
|
||||
* This option will cause #tj3Transform() to return an error if the transform
|
||||
* is not perfect. Lossless transforms operate on MCU blocks, whose size
|
||||
* This option causes #tj3Transform() to return an error if the transform is
|
||||
* not perfect. Lossless transforms operate on MCU blocks, the size of which
|
||||
* depends on the level of chrominance subsampling used (see #tjMCUWidth and
|
||||
* #tjMCUHeight.) If the image's width or height is not evenly divisible by
|
||||
* the MCU block size, then there will be partial MCU blocks on the right
|
||||
@@ -893,54 +955,49 @@ enum TJXOP {
|
||||
*/
|
||||
#define TJXOPT_PERFECT (1 << 0)
|
||||
/**
|
||||
* This option will cause #tj3Transform() to discard any partial MCU blocks
|
||||
* that cannot be transformed.
|
||||
* Discard any partial MCU blocks that cannot be transformed.
|
||||
*/
|
||||
#define TJXOPT_TRIM (1 << 1)
|
||||
/**
|
||||
* This option will enable lossless cropping. See #tj3Transform() for more
|
||||
* information.
|
||||
* Enable lossless cropping. See #tj3Transform() for more information.
|
||||
*/
|
||||
#define TJXOPT_CROP (1 << 2)
|
||||
/**
|
||||
* This option will discard the color data in the source image and produce a
|
||||
* grayscale destination image.
|
||||
* Discard the color data in the source image, and generate a grayscale
|
||||
* destination image.
|
||||
*/
|
||||
#define TJXOPT_GRAY (1 << 3)
|
||||
/**
|
||||
* This option will prevent #tj3Transform() from outputting a JPEG image for
|
||||
* this particular transform. (This can be used in conjunction with a custom
|
||||
* filter to capture the transformed DCT coefficients without transcoding
|
||||
* them.)
|
||||
* Do not generate a destination image. (This can be used in conjunction with
|
||||
* a custom filter to capture the transformed DCT coefficients without
|
||||
* transcoding them.)
|
||||
*/
|
||||
#define TJXOPT_NOOUTPUT (1 << 4)
|
||||
/**
|
||||
* This option will enable progressive entropy coding in the JPEG image
|
||||
* generated by this particular transform. Progressive entropy coding will
|
||||
* generally improve compression relative to baseline entropy coding (the
|
||||
* default), but it will reduce decompression performance considerably.
|
||||
* Can be combined with #TJXOPT_ARITHMETIC. Implies #TJXOPT_OPTIMIZE unless
|
||||
* #TJXOPT_ARITHMETIC is also specified.
|
||||
* Generate a progressive destination image instead of a single-scan
|
||||
* destination image. Progressive JPEG images generally have better
|
||||
* compression ratios than single-scan JPEG images (much better if the image
|
||||
* has large areas of solid color), but progressive JPEG decompression is
|
||||
* considerably slower than single-scan JPEG decompression. Can be combined
|
||||
* with #TJXOPT_ARITHMETIC. Implies #TJXOPT_OPTIMIZE unless #TJXOPT_ARITHMETIC
|
||||
* is also specified.
|
||||
*/
|
||||
#define TJXOPT_PROGRESSIVE (1 << 5)
|
||||
/**
|
||||
* This option will prevent #tj3Transform() from copying any extra markers
|
||||
* (including EXIF and ICC profile data) from the source image to the
|
||||
* destination image.
|
||||
* Do not copy any extra markers (including EXIF and ICC profile data) from the
|
||||
* source image to the destination image.
|
||||
*/
|
||||
#define TJXOPT_COPYNONE (1 << 6)
|
||||
/**
|
||||
* This option will enable arithmetic entropy coding in the JPEG image
|
||||
* generated by this particular transform. Arithmetic entropy coding will
|
||||
* generally improve compression relative to Huffman entropy coding (the
|
||||
* default), but it will reduce decompression performance considerably. Can be
|
||||
* combined with #TJXOPT_PROGRESSIVE.
|
||||
* Enable arithmetic entropy coding in the destination image. Arithmetic
|
||||
* entropy coding generally improves compression relative to Huffman entropy
|
||||
* coding (the default), but it reduces decompression performance considerably.
|
||||
* Can be combined with #TJXOPT_PROGRESSIVE.
|
||||
*/
|
||||
#define TJXOPT_ARITHMETIC (1 << 7)
|
||||
/**
|
||||
* This option will enable optimized baseline entropy coding in the JPEG image
|
||||
* generated by this particular transform. Optimized baseline entropy coding
|
||||
* will improve compression slightly (generally 5% or less.)
|
||||
* Enable Huffman table optimization for the destination image. Huffman table
|
||||
* optimization improves compression slightly (generally 5% or less.)
|
||||
*/
|
||||
#define TJXOPT_OPTIMIZE (1 << 8)
|
||||
|
||||
@@ -1019,7 +1076,7 @@ typedef struct tjtransform {
|
||||
* applied in the frequency domain.
|
||||
*
|
||||
* @param coeffs pointer to an array of transformed DCT coefficients. (NOTE:
|
||||
* this pointer is not guaranteed to be valid once the callback returns, so
|
||||
* 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.)
|
||||
*
|
||||
@@ -1372,13 +1429,13 @@ DLLEXPORT size_t tj3YUVBufSize(int width, int align, int height, int subsamp);
|
||||
*
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image. NOTE: this is the width of
|
||||
* @param width width (in pixels) of the YUV image. NOTE: This is the width of
|
||||
* the whole image, not the plane width.
|
||||
*
|
||||
* @param stride bytes per row in the image plane. Setting this to 0 is the
|
||||
* equivalent of setting it to the plane width.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image. NOTE: this is the height
|
||||
* @param height height (in pixels) of the YUV image. NOTE: This is the height
|
||||
* of the whole image, not the plane height.
|
||||
*
|
||||
* @param subsamp level of chrominance subsampling in the image (see
|
||||
@@ -1985,7 +2042,7 @@ DLLEXPORT void *tj3Alloc(size_t bytes);
|
||||
*
|
||||
* @param pixelFormat pointer to an integer variable that specifies or will
|
||||
* receive the pixel format of the packed-pixel buffer. The behavior of this
|
||||
* function will vary depending on the value of `*pixelFormat` passed to the
|
||||
* function varies depending on the value of `*pixelFormat` passed to the
|
||||
* function:
|
||||
* - @ref TJPF_UNKNOWN : The packed-pixel buffer returned by this function will
|
||||
* use the most optimal pixel format for the file type, and `*pixelFormat` will
|
||||
|
||||
Reference in New Issue
Block a user