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:
DRC
2024-08-14 09:21:54 -04:00
parent b4336c3afb
commit 0c23b0ad60
20 changed files with 1016 additions and 870 deletions

View File

@@ -117,31 +117,31 @@ Macros</h2></td></tr>
<tr class="memdesc:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of transform operations. <br /></td></tr>
<tr class="separator:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50e03cb5ed115330e212417429600b00" id="r_ga50e03cb5ed115330e212417429600b00"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga319826b7eb1583c0595bbe7b95428709" id="r_ga319826b7eb1583c0595bbe7b95428709"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga9c771a757fc1294add611906b89ab2d2" id="r_ga9c771a757fc1294add611906b89ab2d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</td><td class="mdescRight">This option will enable lossless cropping. <br /></td></tr>
<tr class="memdesc:ga9c771a757fc1294add611906b89ab2d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable lossless cropping. <br /></td></tr>
<tr class="separator:ga9c771a757fc1294add611906b89ab2d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3acee7b48ade1b99e5588736007c2589" id="r_ga3acee7b48ade1b99e5588736007c2589"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:gafbf992bbf6e006705886333703ffab31" id="r_gafbf992bbf6e006705886333703ffab31"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</td><td class="mdescRight">Do not generate a destination image. <br /></td></tr>
<tr class="separator:gafbf992bbf6e006705886333703ffab31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad2371c80674584ecc1a7d75e564cf026" id="r_gad2371c80674584ecc1a7d75e564cf026"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ga153b468cfb905d0de61706c838986fe8" id="r_ga153b468cfb905d0de61706c838986fe8"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:gaecaaa3b7e2af812592c015d83207f010" id="r_gaecaaa3b7e2af812592c015d83207f010"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</td><td class="mdescRight">Enable arithmetic entropy coding in the destination image. <br /></td></tr>
<tr class="separator:gaecaaa3b7e2af812592c015d83207f010"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6bedf37aa9e1122f3ec9f7302ca59117" id="r_ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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">&#160;</td><td class="mdescRight">Enable Huffman table optimization for the destination image. <br /></td></tr>
<tr class="separator:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga84878bb65404204743aa18cac02781df" id="r_ga84878bb65404204743aa18cac02781df"><td class="memItemLeft" align="right" valign="top">#define&#160;</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">&#160;</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&#160;</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&#160;</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 &amp; 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 &amp; 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 &amp; 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 &amp; 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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</td><td class="fielddoc"><p>Progressive entropy coding. </p>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" name="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f"></a>TJPARAM_PROGRESSIVE&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</td><td class="fielddoc"><p>4:2:2 chrominance subsampling. </p>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404" name="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404"></a>TJSAMP_422&#160;</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&#160;</td><td class="fielddoc"><p>4:2:0 chrominance subsampling. </p>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737" name="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737"></a>TJSAMP_420&#160;</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&#160;</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&#160;</td><td class="fielddoc"><p>4:4:0 chrominance subsampling. </p>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974" name="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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 &amp; 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 &amp; 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 &amp; 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>

View File

@@ -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>