Wordsmithing

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1021 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2013-08-23 06:38:59 +00:00
parent 38cb1ec2a7
commit b2c4745aa3
8 changed files with 118 additions and 76 deletions

View File

@@ -737,7 +737,7 @@ Variables</h2></td></tr>
</td></tr> </td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b"></a>TJPF_CMYK</em>&nbsp;</td><td class="fielddoc"> <tr><td class="fieldname"><em><a class="anchor" id="ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b"></a>TJPF_CMYK</em>&nbsp;</td><td class="fielddoc">
<p>CMYK pixel format. </p> <p>CMYK pixel format. </p>
<p>Unlike RGB, which is a display colorspace, CMYK (Cyan/Magenta/Yellow/Key) is a print colorspace in which the value of each color component corresponds to the 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 CMYK pixels into a YCCK JPEG image (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 CMYK pixels. </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 CMYK pixels into a YCCK JPEG image (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 CMYK pixels. </p>
</td></tr> </td></tr>
</table> </table>
@@ -754,7 +754,8 @@ Variables</h2></td></tr>
</div><div class="memdoc"> </div><div class="memdoc">
<p>Chrominance subsampling options. </p> <p>Chrominance subsampling options. </p>
<p>When pixels are converted from the RGB colorspace to YCbCr (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" title="YCbCr colorspace.">TJCS_YCbCr</a>) or from the CMYK colorspace 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 small changes in color.) This is called "chrominance subsampling". (NOTE: In common usage, "YCbCr" and "YUV" have come to mean the same thing. The convention within the TurboJPEG API is to use "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes, per the convention of the digital video community.) </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>NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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>
<table class="fieldtable"> <table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444</em>&nbsp;</td><td class="fielddoc"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444</em>&nbsp;</td><td class="fielddoc">
<p>4:4:4 chrominance subsampling (no chrominance subsampling). </p> <p>4:4:4 chrominance subsampling (no chrominance subsampling). </p>
@@ -1272,7 +1273,8 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
</div><div class="memdoc"> </div><div class="memdoc">
<p>Decompress a JPEG image to a YUV planar image. </p> <p>Decompress a JPEG image to a YUV planar image. </p>
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image. The structure of the planes in this image is the same as in the images generated by <a class="el" href="group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360" title="Encode an RGB or grayscale image into a YUV planar image.">tjEncodeYUV3()</a>. Note that, if the width or height of the JPEG image is not an even multiple of the MCU block size (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>), then an intermediate buffer copy will be performed within TurboJPEG.</p> <p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image. The structure of the planes in this image is the same as in the images generated by <a class="el" href="group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360" title="Encode an RGB or grayscale image into a YUV planar image.">tjEncodeYUV3()</a>. Note that, if the width or height of the JPEG image is not an even multiple of the MCU block size (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>), then an intermediate buffer copy will be performed within TurboJPEG. </p>
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr> <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance </td></tr>
@@ -1388,7 +1390,8 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
</div><div class="memdoc"> </div><div class="memdoc">
<p>Encode an RGB or grayscale image into a YUV planar image. </p> <p>Encode an RGB or grayscale image into a YUV planar image. </p>
<p>This function uses the accelerated color conversion routines in TurboJPEG's underlying codec but does not execute any of the other steps in the JPEG compression process. The Y, U, and V image planes are stored sequentially into the destination buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane is padded to the nearest multiple of 2 in the output image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.)</p> <p>This function uses the accelerated color conversion routines in TurboJPEG's underlying codec but does not execute any of the other steps in the JPEG compression process. The Y, U (Cb), and V (Cr) image planes are stored sequentially into the destination buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane is padded to the nearest multiple of 2 in the output image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) </p>
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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>
<dl class="params"><dt>Parameters</dt><dd> <dl class="params"><dt>Parameters</dt><dd>
<table class="params"> <table class="params">
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr> <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance </td></tr>

View File

@@ -807,18 +807,19 @@ PF_CMYK</H3>
<PRE> <PRE>
public static final int <B>PF_CMYK</B></PRE> public static final int <B>PF_CMYK</B></PRE>
<DL> <DL>
<DD>CMYK pixel format. Unlike RGB, which is a display colorspace, <DD>CMYK pixel format. Unlike RGB, which is an additive color model used
CMYK (Cyan/Magenta/Yellow/Key) is a print colorspace in which the primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive
value of each color component corresponds to the amount of cyan, magenta, color model used primarily for printing. In the CMYK color model, the
yellow, or black ink that is applied to a white background. In order to value of each color component typically corresponds to an amount of cyan,
convert between CMYK and RGB, it is necessary to use a color management magenta, yellow, or black ink that is applied to a white background. In
system (CMS.) A CMS will attempt to map colors within the printer's gamut order to convert between CMYK and RGB, it is necessary to use a color
to perceptually similar colors in the display's gamut and vice versa, but management system (CMS.) A CMS will attempt to map colors within the
the mapping is typically not 1:1 or reversible, nor can it be defined with printer's gamut to perceptually similar colors in the display's gamut and
a simple formula. Thus, such a conversion is out of scope for a codec vice versa, but the mapping is typically not 1:1 or reversible, nor can it
library. However, the TurboJPEG API allows for compressing CMYK pixels be defined with a simple formula. Thus, such a conversion is out of scope
into a YCCK JPEG image (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><CODE>CS_YCCK</CODE></A>) and decompressing YCCK JPEG for a codec library. However, the TurboJPEG API allows for compressing
images into CMYK pixels. CMYK pixels into a YCCK JPEG image (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><CODE>CS_YCCK</CODE></A>) and
decompressing YCCK JPEG images into CMYK pixels.
<P> <P>
<DL> <DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_CMYK">Constant Field Values</A></DL> <DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.PF_CMYK">Constant Field Values</A></DL>

View File

@@ -469,7 +469,13 @@ public void <B>setSubsamp</B>(int&nbsp;newSubsamp)
throws java.lang.Exception</PRE> throws java.lang.Exception</PRE>
<DL> <DL>
<DD>Set the level of chrominance subsampling for subsequent compress/encode <DD>Set the level of chrominance subsampling for subsequent compress/encode
operations. operations. When pixels are converted from RGB to YCbCr (see
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><CODE>TJ.CS_YCbCr</CODE></A>) or from CMYK to YCCK (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><CODE>TJ.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 in brightness than to small changes in color.)
This is called "chrominance subsampling".
<P> <P>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>newSubsamp</CODE> - the new level of chrominance subsampling (one of <DT><B>Parameters:</B><DD><CODE>newSubsamp</CODE> - the new level of chrominance subsampling (one of
@@ -609,14 +615,18 @@ public void <B>encodeYUV</B>(byte[]&nbsp;dstBuf,
instance and output a YUV planar image to the given destination buffer. instance and output a YUV planar image to the given destination buffer.
This method uses the accelerated color conversion routines in TurboJPEG's This method uses the accelerated color conversion routines in TurboJPEG's
underlying codec but does not execute any of the other steps in the JPEG underlying codec but does not execute any of the other steps in the JPEG
compression process. The Y, U, and V image planes are stored sequentially compression process. The Y, U (Cb), and V (Cr) image planes are stored
into the destination buffer, and the size of each plane is determined by sequentially into the destination buffer, and the size of each plane is
the width and height of the source image, as well as the specified padding determined by the width and height of the source image, as well as the
and level of chrominance subsampling. If the chrominance components are specified padding and level of chrominance subsampling. If the
subsampled along the horizontal dimension, then the width of the luminance chrominance components are subsampled along the horizontal dimension, then
plane is padded to the nearest multiple of 2 in the output image (same the width of the luminance plane is padded to the nearest multiple of 2 in
goes for the height of the luminance plane, if the chrominance components the output image (same goes for the height of the luminance plane, if the
are subsampled along the vertical dimension.) chrominance components are subsampled along the vertical dimension.)
<p>
NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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> <P>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use <DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use

View File

@@ -887,6 +887,10 @@ public void <B>decompressToYUV</B>(byte[]&nbsp;dstBuf,
that, if the width or height of the image is not an even multiple of the that, if the width or height of the image is not an even multiple of the
MCU block size (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><CODE>TJ.getMCUWidth(int)</CODE></A> and <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)"><CODE>TJ.getMCUHeight(int)</CODE></A>), MCU block size (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><CODE>TJ.getMCUWidth(int)</CODE></A> and <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)"><CODE>TJ.getMCUHeight(int)</CODE></A>),
then an intermediate buffer copy will be performed within TurboJPEG. then an intermediate buffer copy will be performed within TurboJPEG.
<p>
NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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> <P>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use <DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use

View File

@@ -192,18 +192,19 @@ public final class TJ {
*/ */
public static final int PF_ARGB = 10; public static final int PF_ARGB = 10;
/** /**
* CMYK pixel format. Unlike RGB, which is a display colorspace, * CMYK pixel format. Unlike RGB, which is an additive color model used
* CMYK (Cyan/Magenta/Yellow/Key) is a print colorspace in which the * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive
* value of each color component corresponds to the amount of cyan, magenta, * color model used primarily for printing. In the CMYK color model, the
* yellow, or black ink that is applied to a white background. In order to * value of each color component typically corresponds to an amount of cyan,
* convert between CMYK and RGB, it is necessary to use a color management * magenta, yellow, or black ink that is applied to a white background. In
* system (CMS.) A CMS will attempt to map colors within the printer's gamut * order to convert between CMYK and RGB, it is necessary to use a color
* to perceptually similar colors in the display's gamut and vice versa, but * management system (CMS.) A CMS will attempt to map colors within the
* the mapping is typically not 1:1 or reversible, nor can it be defined with * printer's gamut to perceptually similar colors in the display's gamut and
* a simple formula. Thus, such a conversion is out of scope for a codec * vice versa, but the mapping is typically not 1:1 or reversible, nor can it
* library. However, the TurboJPEG API allows for compressing CMYK pixels * be defined with a simple formula. Thus, such a conversion is out of scope
* into a YCCK JPEG image (see {@link #CS_YCCK}) and decompressing YCCK JPEG * for a codec library. However, the TurboJPEG API allows for compressing
* images into CMYK pixels. * CMYK pixels into a YCCK JPEG image (see {@link #CS_YCCK}) and
* decompressing YCCK JPEG images into CMYK pixels.
*/ */
public static final int PF_CMYK = 11; public static final int PF_CMYK = 11;

View File

@@ -155,7 +155,13 @@ public class TJCompressor {
/** /**
* Set the level of chrominance subsampling for subsequent compress/encode * Set the level of chrominance subsampling for subsequent compress/encode
* operations. * operations. When pixels are converted from RGB to YCbCr (see
* {@link TJ#CS_YCbCr}) or from CMYK to YCCK (see {@link TJ#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 in brightness than to small changes in color.)
* This is called "chrominance subsampling".
* *
* @param newSubsamp the new level of chrominance subsampling (one of * @param newSubsamp the new level of chrominance subsampling (one of
* {@link TJ TJ.SAMP_*}) * {@link TJ TJ.SAMP_*})
@@ -351,14 +357,18 @@ public class TJCompressor {
* instance and output a YUV planar image to the given destination buffer. * instance and output a YUV planar image to the given destination buffer.
* This method uses the accelerated color conversion routines in TurboJPEG's * This method uses the accelerated color conversion routines in TurboJPEG's
* underlying codec but does not execute any of the other steps in the JPEG * underlying codec but does not execute any of the other steps in the JPEG
* compression process. The Y, U, and V image planes are stored sequentially * compression process. The Y, U (Cb), and V (Cr) image planes are stored
* into the destination buffer, and the size of each plane is determined by * sequentially into the destination buffer, and the size of each plane is
* the width and height of the source image, as well as the specified padding * determined by the width and height of the source image, as well as the
* and level of chrominance subsampling. If the chrominance components are * specified padding and level of chrominance subsampling. If the
* subsampled along the horizontal dimension, then the width of the luminance * chrominance components are subsampled along the horizontal dimension, then
* plane is padded to the nearest multiple of 2 in the output image (same * the width of the luminance plane is padded to the nearest multiple of 2 in
* goes for the height of the luminance plane, if the chrominance components * the output image (same goes for the height of the luminance plane, if the
* are subsampled along the vertical dimension.) * chrominance components are subsampled along the vertical dimension.)
* <p>
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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.
* *
* @param dstBuf buffer that will receive the YUV planar image. Use * @param dstBuf buffer that will receive the YUV planar image. Use
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer * {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer

View File

@@ -369,6 +369,10 @@ public class TJDecompressor {
* that, if the width or height of the image is not an even multiple of the * that, if the width or height of the image is not an even multiple of the
* MCU block size (see {@link TJ#getMCUWidth} and {@link TJ#getMCUHeight}), * MCU block size (see {@link TJ#getMCUWidth} and {@link TJ#getMCUHeight}),
* then an intermediate buffer copy will be performed within TurboJPEG. * then an intermediate buffer copy will be performed within TurboJPEG.
* <p>
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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.
* *
* @param dstBuf buffer that will receive the YUV planar image. Use * @param dstBuf buffer that will receive the YUV planar image. Use
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer * {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer

View File

@@ -53,16 +53,16 @@
/** /**
* Chrominance subsampling options. * Chrominance subsampling options.
* When pixels are converted from the RGB colorspace to YCbCr (see #TJCS_YCbCr) * When pixels are converted from RGB to YCbCr (see #TJCS_YCbCr) or from CMYK
* or from the CMYK colorspace to YCCK (see #TJCS_YCCK) as part of the JPEG * to YCCK (see #TJCS_YCCK) as part of the JPEG compression process, some of
* compression process, some of the Cb and Cr (chrominance) components can be * the Cb and Cr (chrominance) components can be discarded or averaged together
* discarded or averaged together to produce a smaller image with little * to produce a smaller image with little perceptible loss of image clarity
* perceptible loss of image clarity (the human eye is more sensitive to small * (the human eye is more sensitive to small changes in brightness than to
* changes in brightness than small changes in color.) This is called * small changes in color.) This is called "chrominance subsampling".
* "chrominance subsampling". (NOTE: In common usage, "YCbCr" and "YUV" have * <p>
* come to mean the same thing. The convention within the TurboJPEG API is to * NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the
* use "YUV" to refer to an image format consisting of Y, Cb, and Cr image * convention of the digital video community, the TurboJPEG API uses "YUV" to
* planes, per the convention of the digital video community.) * refer to an image format consisting of Y, Cb, and Cr image planes.
*/ */
enum TJSAMP enum TJSAMP
{ {
@@ -208,18 +208,19 @@ enum TJPF
*/ */
TJPF_ARGB, TJPF_ARGB,
/** /**
* CMYK pixel format. Unlike RGB, which is a display colorspace, * CMYK pixel format. Unlike RGB, which is an additive color model used
* CMYK (Cyan/Magenta/Yellow/Key) is a print colorspace in which the * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive
* value of each color component corresponds to the amount of cyan, magenta, * color model used primarily for printing. In the CMYK color model, the
* yellow, or black ink that is applied to a white background. In order to * value of each color component typically corresponds to an amount of cyan,
* convert between CMYK and RGB, it is necessary to use a color management * magenta, yellow, or black ink that is applied to a white background. In
* system (CMS.) A CMS will attempt to map colors within the printer's gamut * order to convert between CMYK and RGB, it is necessary to use a color
* to perceptually similar colors in the display's gamut and vice versa, but * management system (CMS.) A CMS will attempt to map colors within the
* the mapping is typically not 1:1 or reversible, nor can it be defined with * printer's gamut to perceptually similar colors in the display's gamut and
* a simple formula. Thus, such a conversion is out of scope for a codec * vice versa, but the mapping is typically not 1:1 or reversible, nor can it
* library. However, the TurboJPEG API allows for compressing CMYK pixels * be defined with a simple formula. Thus, such a conversion is out of scope
* into a YCCK JPEG image (see #TJCS_YCCK) and decompressing YCCK JPEG images * for a codec library. However, the TurboJPEG API allows for compressing
* into CMYK pixels. * CMYK pixels into a YCCK JPEG image (see #TJCS_YCCK) and decompressing YCCK
* JPEG images into CMYK pixels.
*/ */
TJPF_CMYK TJPF_CMYK
}; };
@@ -700,14 +701,18 @@ DLLEXPORT unsigned long DLLCALL tjBufSizeYUV2(int width, int pad, int height,
* Encode an RGB or grayscale image into a YUV planar image. This function * Encode an RGB or grayscale image into a YUV planar image. This function
* uses the accelerated color conversion routines in TurboJPEG's underlying * uses the accelerated color conversion routines in TurboJPEG's underlying
* codec but does not execute any of the other steps in the JPEG compression * codec but does not execute any of the other steps in the JPEG compression
* process. The Y, U, and V image planes are stored sequentially into the * process. The Y, U (Cb), and V (Cr) image planes are stored sequentially
* destination buffer, and the size of each plane is determined by the width * into the destination buffer, and the size of each plane is determined by the
* and height of the source image, as well as the specified padding and level * width and height of the source image, as well as the specified padding and
* of chrominance subsampling. If the chrominance components are subsampled * level of chrominance subsampling. If the chrominance components are
* along the horizontal dimension, then the width of the luminance plane is * subsampled along the horizontal dimension, then the width of the luminance
* padded to the nearest multiple of 2 in the output image (same goes for the * plane is padded to the nearest multiple of 2 in the output image (same goes
* height of the luminance plane, if the chrominance components are subsampled * for the height of the luminance plane, if the chrominance components are
* along the vertical dimension.) * subsampled along the vertical dimension.)
* <p>
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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.
* *
* @param handle a handle to a TurboJPEG compressor or transformer instance * @param handle a handle to a TurboJPEG compressor or transformer instance
* @param srcBuf pointer to an image buffer containing RGB or grayscale pixels * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels
@@ -848,6 +853,10 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,
* that, if the width or height of the JPEG image is not an even multiple of * that, if the width or height of the JPEG image is not an even multiple of
* the MCU block size (see #tjMCUWidth and #tjMCUHeight), then an intermediate * the MCU block size (see #tjMCUWidth and #tjMCUHeight), then an intermediate
* buffer copy will be performed within TurboJPEG. * buffer copy will be performed within TurboJPEG.
* <p>
* NOTE: Technically, the JPEG format uses the YCbCr colorspace, 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.
* *
* @param handle a handle to a TurboJPEG decompressor or transformer instance * @param handle a handle to a TurboJPEG decompressor or transformer instance
* @param jpegBuf pointer to a buffer containing the JPEG image to decompress * @param jpegBuf pointer to a buffer containing the JPEG image to decompress