From b2c4745aa3bb054b59e53001d3d2fb86ed37a060 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 23 Aug 2013 06:38:59 +0000 Subject: [PATCH] Wordsmithing git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1021 632fc199-4ca6-4c93-a231-07263d6284db --- doc/html/group___turbo_j_p_e_g.html | 11 +-- java/doc/org/libjpegturbo/turbojpeg/TJ.html | 25 +++---- .../libjpegturbo/turbojpeg/TJCompressor.html | 28 +++++--- .../turbojpeg/TJDecompressor.html | 4 ++ java/org/libjpegturbo/turbojpeg/TJ.java | 25 +++---- .../libjpegturbo/turbojpeg/TJCompressor.java | 28 +++++--- .../turbojpeg/TJDecompressor.java | 4 ++ turbojpeg.h | 69 +++++++++++-------- 8 files changed, 118 insertions(+), 76 deletions(-) diff --git a/doc/html/group___turbo_j_p_e_g.html b/doc/html/group___turbo_j_p_e_g.html index 92e1fe3..c1df193 100644 --- a/doc/html/group___turbo_j_p_e_g.html +++ b/doc/html/group___turbo_j_p_e_g.html @@ -737,7 +737,7 @@ Variables TJPF_CMYK 

CMYK pixel format.

-

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 TJCS_YCCK) and decompressing YCCK JPEG images into CMYK pixels.

+

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 TJCS_YCCK) and decompressing YCCK JPEG images into CMYK pixels.

@@ -754,7 +754,8 @@ Variables

Chrominance subsampling options.

-

When pixels are converted from the RGB colorspace to YCbCr (see TJCS_YCbCr) or from the CMYK colorspace to YCCK (see TJCS_YCCK) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity (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.)

+

When pixels are converted from RGB to YCbCr (see TJCS_YCbCr) or from CMYK to YCCK (see TJCS_YCCK) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity (the human eye is more sensitive to small changes in brightness than to small changes in color.) This is called "chrominance subsampling".

+

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.

Enumerator
TJSAMP_444 

4:4:4 chrominance subsampling (no chrominance subsampling).

@@ -1272,7 +1273,8 @@ If you choose option 1, *jpegSize should be set to the size of your

Decompress a JPEG image to a YUV planar image.

-

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 tjEncodeYUV3(). Note 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 buffer copy will be performed within TurboJPEG.

+

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 tjEncodeYUV3(). Note 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 buffer copy will be performed within TurboJPEG.

+

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.

Parameters
@@ -1388,7 +1390,8 @@ If you choose option 1, *jpegSize should be set to the size of your

Encode an RGB or grayscale image into a YUV planar image.

-

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.)

+

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.)

+

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.

Parameters
handlea handle to a TurboJPEG decompressor or transformer instance
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/java/doc/org/libjpegturbo/turbojpeg/TJ.html index b832cf8..3a94cba 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJ.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJ.html @@ -807,18 +807,19 @@ PF_CMYK
 public static final int PF_CMYK
-
CMYK pixel format. 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 CS_YCCK) and decompressing YCCK JPEG - images into CMYK pixels. +
CMYK pixel format. Unlike RGB, which is an additive color model used + primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive + color model used primarily for printing. In the CMYK color model, the + value of each color component typically corresponds to an amount of cyan, + magenta, yellow, or black ink that is applied to a white background. In + order to convert between CMYK and RGB, it is necessary to use a color + management system (CMS.) A CMS will attempt to map colors within the + printer's gamut to perceptually similar colors in the display's gamut and + vice versa, but the mapping is typically not 1:1 or reversible, nor can it + be defined with a simple formula. Thus, such a conversion is out of scope + for a codec library. However, the TurboJPEG API allows for compressing + CMYK pixels into a YCCK JPEG image (see CS_YCCK) and + decompressing YCCK JPEG images into CMYK pixels.

See Also:
Constant Field Values
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html index 30d5ff3..a41ea06 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html @@ -469,7 +469,13 @@ public void setSubsamp(int newSubsamp) throws java.lang.Exception
Set the level of chrominance subsampling for subsequent compress/encode - operations. + operations. When pixels are converted from RGB to YCbCr (see + TJ.CS_YCbCr) or from CMYK to YCCK (see 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".

Parameters:
newSubsamp - the new level of chrominance subsampling (one of @@ -609,14 +615,18 @@ public void encodeYUV(byte[] dstBuf, instance and output a YUV planar image to the given destination buffer. 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 - 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.) + 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.) +

+ 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.

Parameters:
dstBuf - buffer that will receive the YUV planar image. Use diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html index 12a5e83..a3d3db5 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html @@ -887,6 +887,10 @@ public void decompressToYUV(byte[] dstBuf, that, if the width or height of the image is not an even multiple of the MCU block size (see TJ.getMCUWidth(int) and TJ.getMCUHeight(int)), then an intermediate buffer copy will be performed within TurboJPEG. +

+ 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.

Parameters:
dstBuf - buffer that will receive the YUV planar image. Use diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java index b3ca4b8..9fe3058 100644 --- a/java/org/libjpegturbo/turbojpeg/TJ.java +++ b/java/org/libjpegturbo/turbojpeg/TJ.java @@ -192,18 +192,19 @@ public final class TJ { */ public static final int PF_ARGB = 10; /** - * CMYK pixel format. 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 {@link #CS_YCCK}) and decompressing YCCK JPEG - * images into CMYK pixels. + * CMYK pixel format. Unlike RGB, which is an additive color model used + * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive + * color model used primarily for printing. In the CMYK color model, the + * value of each color component typically corresponds to an amount of cyan, + * magenta, yellow, or black ink that is applied to a white background. In + * order to convert between CMYK and RGB, it is necessary to use a color + * management system (CMS.) A CMS will attempt to map colors within the + * printer's gamut to perceptually similar colors in the display's gamut and + * vice versa, but the mapping is typically not 1:1 or reversible, nor can it + * be defined with a simple formula. Thus, such a conversion is out of scope + * for a codec library. However, the TurboJPEG API allows for compressing + * 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; diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java index 114c4a7..e8dd260 100644 --- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java @@ -155,7 +155,13 @@ public class TJCompressor { /** * 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 * {@link TJ TJ.SAMP_*}) @@ -351,14 +357,18 @@ public class TJCompressor { * instance and output a YUV planar image to the given destination buffer. * 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 - * 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.) + * 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.) + *

+ * 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 * {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java index 42c3691..ad61975 100644 --- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -369,6 +369,10 @@ public class TJDecompressor { * 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}), * then an intermediate buffer copy will be performed within TurboJPEG. + *

+ * 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 * {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer diff --git a/turbojpeg.h b/turbojpeg.h index 065150c..77019e0 100644 --- a/turbojpeg.h +++ b/turbojpeg.h @@ -53,16 +53,16 @@ /** * Chrominance subsampling options. - * When pixels are converted from the RGB colorspace to YCbCr (see #TJCS_YCbCr) - * or from the CMYK colorspace to YCCK (see #TJCS_YCCK) as part of the JPEG - * compression process, some of the Cb and Cr (chrominance) components can be - * discarded or averaged together to produce a smaller image with little - * perceptible loss of image clarity (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.) + * When pixels are converted from RGB to YCbCr (see #TJCS_YCbCr) or from CMYK + * to YCCK (see #TJCS_YCCK) as part of the JPEG compression process, some of + * the Cb and Cr (chrominance) components can be discarded or averaged together + * to produce a smaller image with little perceptible loss of image clarity + * (the human eye is more sensitive to small changes in brightness than to + * small changes in color.) This is called "chrominance subsampling". + *

+ * 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. */ enum TJSAMP { @@ -208,18 +208,19 @@ enum TJPF */ TJPF_ARGB, /** - * CMYK pixel format. 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 #TJCS_YCCK) and decompressing YCCK JPEG images - * into CMYK pixels. + * CMYK pixel format. Unlike RGB, which is an additive color model used + * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive + * color model used primarily for printing. In the CMYK color model, the + * value of each color component typically corresponds to an amount of cyan, + * magenta, yellow, or black ink that is applied to a white background. In + * order to convert between CMYK and RGB, it is necessary to use a color + * management system (CMS.) A CMS will attempt to map colors within the + * printer's gamut to perceptually similar colors in the display's gamut and + * vice versa, but the mapping is typically not 1:1 or reversible, nor can it + * be defined with a simple formula. Thus, such a conversion is out of scope + * for a codec library. However, the TurboJPEG API allows for compressing + * CMYK pixels into a YCCK JPEG image (see #TJCS_YCCK) and decompressing YCCK + * JPEG images into CMYK pixels. */ 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 * 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.) + * 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.) + *

+ * 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 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 * the MCU block size (see #tjMCUWidth and #tjMCUHeight), then an intermediate * buffer copy will be performed within TurboJPEG. + *

+ * 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 jpegBuf pointer to a buffer containing the JPEG image to decompress -- 2.40.0

handlea handle to a TurboJPEG compressor or transformer instance