diff --git a/java/doc/index-all.html b/java/doc/index-all.html index e38d2302..66427697 100644 --- a/java/doc/index-all.html +++ b/java/doc/index-all.html @@ -300,8 +300,8 @@ Method in class org.libjpegturbo.turbojpeg.getTransformedSizes() - Method in class org.libjpegturbo.turbojpeg.TJTransformer -
Returns an array containing the sizes of the transformed JPEG images from - the most recent call to transform(). +
Returns an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation.
getWidth() - Method in class org.libjpegturbo.turbojpeg.TJDecompressor
Returns the width of the JPEG image associated with this decompressor @@ -502,7 +502,7 @@ Constructor for class org.libjpegturbo.turbojpeg.TJCompressor(byte[], int, int, int, int, int, int) - Constructor for class org.libjpegturbo.turbojpeg.TJCompressor
Create a TurboJPEG compressor instance and associate the uncompressed - source image stored in srcImage with the newly-created + source image stored in srcImage with the newly created instance.
TJCompressor(byte[], int, int, int, int) - Constructor for class org.libjpegturbo.turbojpeg.TJCompressor @@ -514,12 +514,12 @@ Constructor for class org.libjpegturbo.turbojpeg.TJDecompressor(byte[]) - Constructor for class org.libjpegturbo.turbojpeg.TJDecompressor
Create a TurboJPEG decompressor instance and associate the JPEG image - stored in jpegImage with the newly-created instance. + stored in jpegImage with the newly created instance.
TJDecompressor(byte[], int) - Constructor for class org.libjpegturbo.turbojpeg.TJDecompressor
Create a TurboJPEG decompressor instance and associate the JPEG image of length imageSize bytes stored in jpegImage - with the newly-created instance. + with the newly created instance.
TJScalingFactor - Class in org.libjpegturbo.turbojpeg
Fractional scaling factor
TJScalingFactor(int, int) - Constructor for class org.libjpegturbo.turbojpeg.TJScalingFactor
  @@ -538,12 +538,12 @@ Constructor for class org.libjpegturbo.turbojpeg.TJTransformer(byte[]) - Constructor for class org.libjpegturbo.turbojpeg.TJTransformer
Create a TurboJPEG lossless transformer instance and associate the JPEG - image stored in jpegImage with the newly-created instance. + image stored in jpegImage with the newly created instance.
TJTransformer(byte[], int) - Constructor for class org.libjpegturbo.turbojpeg.TJTransformer
Create a TurboJPEG lossless transformer instance and associate the JPEG image of length imageSize bytes stored in - jpegImage with the newly-created instance. + jpegImage with the newly created instance.
transform(byte[][], TJTransform[], int) - Method in class org.libjpegturbo.turbojpeg.TJTransformer
Losslessly transform the JPEG image associated with this transformer diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html index 46feb376..935db0eb 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html @@ -141,7 +141,7 @@ TurboJPEG compressor
          Create a TurboJPEG compressor instance and associate the uncompressed - source image stored in srcImage with the newly-created + source image stored in srcImage with the newly created instance. @@ -354,12 +354,12 @@ public TJCompressor(byte[] srcImage, throws java.lang.Exception
Create a TurboJPEG compressor instance and associate the uncompressed - source image stored in srcImage with the newly-created + source image stored in srcImage with the newly created instance.

Parameters:
srcImage - see setSourceImage(byte[], int, int, int, int, int, int) for description
x - see setSourceImage(byte[], int, int, int, int, int, int) for description
y - see setSourceImage(byte[], int, int, int, int, int, int) for description
width - see setSourceImage(byte[], int, int, int, int, int, int) for description
pitch - see setSourceImage(byte[], int, int, int, int, int, int) for description
height - see setSourceImage(byte[], int, int, int, int, int, int) for description
pixelFormat - pixel format of the source image (one of - TJ.PF_*) + TJ.PF_*)
Throws:
java.lang.Exception
@@ -411,19 +411,19 @@ public void setSourceImage(byte[] srcImage,

Parameters:
srcImage - image buffer containing RGB or grayscale pixels to be - compressed
x - x offset (in pixels) of the region from which the JPEG image - should be compressed, relative to the start of srcImage.
y - y offset (in pixels) of the region from which the JPEG image - should be compressed, relative to the start of srcImage.
width - width (in pixels) of the region in the source image from - which the JPEG image should be compressed.
pitch - bytes per line of the source image. Normally, this should be + compressed or encoded
x - x offset (in pixels) of the region in the source image from which + the JPEG or YUV image should be compressed/encoded
y - y offset (in pixels) of the region in the source image from which + the JPEG or YUV image should be compressed/encoded
width - width (in pixels) of the region in the source image from + which the JPEG or YUV image should be compressed/encoded
pitch - bytes per line of the source image. Normally, this should be width * TJ.pixelSize(pixelFormat) if the source image is unpadded, but you can use this parameter to, for instance, specify that the scanlines in the source image are padded to a 4-byte boundary or to - compress a JPEG image from a region of a larger source image. You can - also be clever and use this parameter to skip lines, etc. Setting this - parameter to 0 is the equivalent of setting it to width * - TJ.pixelSize(pixelFormat).
height - height (in pixels) of the region in the source image from - which the JPEG image should be compressed.
pixelFormat - pixel format of the source image (one of - TJ.PF_*) + compress/encode a JPEG or YUV image from a region of a larger source + image. You can also be clever and use this parameter to skip lines, etc. + Setting this parameter to 0 is the equivalent of setting it to + width * TJ.pixelSize(pixelFormat).
height - height (in pixels) of the region in the source image from + which the JPEG or YUV image should be compressed/encoded
pixelFormat - pixel format of the source image (one of + TJ.PF_*)
Throws:
java.lang.Exception
@@ -462,8 +462,9 @@ public void setSubsamp(int newSubsamp) operations.

-
Parameters:
newSubsamp - the new level of chrominance subsampling (one of - TJ.SAMP_*) +
Parameters:
newSubsamp - the level of chrominance subsampling to use in + subsequent compress/encode operations (one of + TJ.SAMP_*)
Throws:
java.lang.Exception
@@ -500,7 +501,9 @@ public void compress(byte[] dstBuf,
Parameters:
dstBuf - buffer that will receive the JPEG image. Use TJ.bufSize(int, int, int) to determine the maximum size for this buffer based on - the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of TJ.FLAG_* + the source image's width and height and the desired level of chrominance + subsampling.
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -517,7 +520,8 @@ public byte[] compress(int flags) instance and return a buffer containing a JPEG image.

-
Parameters:
flags - the bitwise OR of one or more of TJ.FLAG_* +
Parameters:
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
a buffer containing a JPEG image. The length of this buffer will not be equal to the size of the JPEG image. Use getCompressedSize() to obtain the size of the JPEG image.
Throws: @@ -541,7 +545,8 @@ public void compress(java.awt.image.BufferedImage srcImage,
Parameters:
srcImage - a BufferedImage instance containing RGB or grayscale pixels to be compressed
dstBuf - buffer that will receive the JPEG image. Use TJ.bufSize(int, int, int) to determine the maximum size for this buffer based on - the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of TJ.FLAG_* + the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -560,7 +565,8 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,

Parameters:
srcImage - a BufferedImage instance containing RGB or - grayscale pixels to be compressed
flags - the bitwise OR of one or more of TJ.FLAG_* + grayscale pixels to be compressed
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
a buffer containing a JPEG image. The length of this buffer will not be equal to the size of the JPEG image. Use getCompressedSize() to obtain the size of the JPEG image.
Throws: @@ -597,7 +603,8 @@ public void encodeYUV(byte[] dstBuf,
Parameters:
dstBuf - buffer that will receive the YUV planar image. Use TJ.bufSizeYUV(int, int, int) to determine the appropriate size for this buffer - based on the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of TJ.FLAG_* + based on the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -615,7 +622,8 @@ public byte[] encodeYUV(int flags) encodeYUV(byte[], int) for more detail.

-
Parameters:
flags - the bitwise OR of one or more of TJ.FLAG_* +
Parameters:
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
a buffer containing a YUV planar image
Throws:
java.lang.Exception
@@ -639,7 +647,8 @@ public void encodeYUV(java.awt.image.BufferedImage srcImage,
Parameters:
srcImage - a BufferedImage instance containing RGB or grayscale pixels to be encoded
dstBuf - buffer that will receive the YUV planar image. Use TJ.bufSizeYUV(int, int, int) to determine the appropriate size for this buffer - based on the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of TJ.FLAG_* + based on the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -659,7 +668,8 @@ public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,

Parameters:
srcImage - a BufferedImage instance containing RGB or - grayscale pixels to be encoded
flags - the bitwise OR of one or more of TJ.FLAG_* + grayscale pixels to be encoded
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
a buffer containing a YUV planar image
Throws:
java.lang.Exception
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html index 5d24f312..d69f943d 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html @@ -184,7 +184,7 @@ TurboJPEG decompressor
          Create a TurboJPEG decompressor instance and associate the JPEG image - stored in jpegImage with the newly-created instance. + stored in jpegImage with the newly created instance. TJDecompressor(byte[] jpegImage, @@ -193,7 +193,7 @@ TurboJPEG decompressor
          Create a TurboJPEG decompressor instance and associate the JPEG image of length imageSize bytes stored in jpegImage - with the newly-created instance. + with the newly created instance.   @@ -513,7 +513,7 @@ public TJDecompressor(byte[] jpegImage) throws java.lang.Exception
Create a TurboJPEG decompressor instance and associate the JPEG image - stored in jpegImage with the newly-created instance. + stored in jpegImage with the newly created instance.

Parameters:
jpegImage - JPEG image buffer (size of the JPEG image is assumed to @@ -532,7 +532,7 @@ public TJDecompressor(byte[] jpegImage,
Create a TurboJPEG decompressor instance and associate the JPEG image of length imageSize bytes stored in jpegImage - with the newly-created instance. + with the newly created instance.

Parameters:
jpegImage - JPEG image buffer
imageSize - size of the JPEG image (in bytes) @@ -766,8 +766,9 @@ public void decompress(byte[] dstBuf, scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired dimensions. Setting this to 0 is the same as setting it to the height of the JPEG image (in other words, the - height will not be considered when determining the scaled image size.)
pixelFormat - pixel format of the decompressed image (one of - TJ.PF_*)
flags - the bitwise OR of one or more of TJ.FLAG_* + height will not be considered when determining the scaled image size.)
pixelFormat - pixel format of the decompressed/decoded image (one of + TJ.PF_*)
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -818,7 +819,8 @@ public byte[] decompress(int desiredWidth, for description
desiredHeight - see decompress(byte[], int, int, int, int, int, int, int) for description
pixelFormat - pixel format of the decompressed image (one of - TJ.PF_*)
flags - the bitwise OR of one or more of TJ.FLAG_* + TJ.PF_*)
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
a buffer containing the decompressed image
Throws:
java.lang.Exception
@@ -838,10 +840,7 @@ public void decompressToYUV(byte[] dstBuf, This method performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image. The padding of the planes in this image is the same as in the - images generated by TJCompressor.encodeYUV(byte[], int). Note - 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. + images generated by TJCompressor.encodeYUV(byte[], int).

NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to @@ -850,7 +849,8 @@ public void decompressToYUV(byte[] dstBuf,

Parameters:
dstBuf - buffer that will receive the YUV planar image. Use TJ.bufSizeYUV(int, int, int) to determine the appropriate size for this buffer - based on the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of TJ.FLAG_* + based on the image width, height, and level of chrominance subsampling.
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -867,7 +867,8 @@ public byte[] decompressToYUV(int flags) instance and return a buffer containing a YUV planar image. See decompressToYUV(byte[], int) for more detail.

-
Parameters:
flags - the bitwise OR of one or more of TJ.FLAG_* +
Parameters:
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
a buffer containing a YUV planar image
Throws:
java.lang.Exception
@@ -921,7 +922,8 @@ public void decompress(int[] dstBuf, that will fit within the desired dimensions. Setting this to 0 is the same as setting it to the height of the JPEG image (in other words, the height will not be considered when determining the scaled image size.)
pixelFormat - pixel format of the decompressed image (one of - TJ.PF_*)
flags - the bitwise OR of one or more of TJ.FLAG_* + TJ.PF_*)
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -941,7 +943,10 @@ public void decompress(java.awt.image.BufferedImage dstImage,

Parameters:
dstImage - a BufferedImage instance that will receive - the decompressed image
flags - the bitwise OR of one or more of TJ.FLAG_* + the decompressed image. The width and height of the + BufferedImage instance must match one of the scaled image + sizes that TurboJPEG is capable of generating from the JPEG image.
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -966,9 +971,10 @@ public java.awt.image.BufferedImage decompress(int desiredWidth, decompress(byte[], int, int, int, int, int, int, int) for description
desiredHeight - see decompress(byte[], int, int, int, int, int, int, int) for - description
bufferedImageType - the image type of the newly-created - BufferedImage instance (for instance, - BufferedImage.TYPE_INT_RGB)
flags - the bitwise OR of one or more of TJ.FLAG_* + description
bufferedImageType - the image type of the BufferedImage + instance that will be created (for instance, + BufferedImage.TYPE_INT_RGB)
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
a BufferedImage instance containing the decompressed image
Throws: diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html index 1e76ac8e..c08f3585 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html @@ -143,7 +143,7 @@ TurboJPEG lossless transformer
          Create a TurboJPEG lossless transformer instance and associate the JPEG - image stored in jpegImage with the newly-created instance. + image stored in jpegImage with the newly created instance. TJTransformer(byte[] jpegImage, @@ -152,7 +152,7 @@ TurboJPEG lossless transformer
          Create a TurboJPEG lossless transformer instance and associate the JPEG image of length imageSize bytes stored in - jpegImage with the newly-created instance. + jpegImage with the newly created instance.   @@ -170,8 +170,8 @@ TurboJPEG lossless transformer getTransformedSizes()
-          Returns an array containing the sizes of the transformed JPEG images from - the most recent call to transform(). +          Returns an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation. @@ -250,7 +250,7 @@ public TJTransformer(byte[] jpegImage) throws java.lang.Exception
Create a TurboJPEG lossless transformer instance and associate the JPEG - image stored in jpegImage with the newly-created instance. + image stored in jpegImage with the newly created instance.

Parameters:
jpegImage - JPEG image buffer (size of the JPEG image is assumed to @@ -269,7 +269,7 @@ public TJTransformer(byte[] jpegImage,
Create a TurboJPEG lossless transformer instance and associate the JPEG image of length imageSize bytes stored in - jpegImage with the newly-created instance. + jpegImage with the newly created instance.

Parameters:
jpegImage - JPEG image buffer
imageSize - size of the JPEG image (in bytes) @@ -313,9 +313,10 @@ public void transform(byte[][] dstBufs, receive a JPEG image that has been transformed using the parameters in transforms[i]. Use TJ.bufSize(int, int, int) to determine the maximum size for each buffer based on the transformed or cropped width and - height.
transforms - an array of TJTransform instances, each of + height and the level of subsampling used in the source image.
transforms - an array of TJTransform instances, each of which specifies the transform parameters and/or cropping region for the - corresponding transformed output image
flags - the bitwise OR of one or more of TJ.FLAG_* + corresponding transformed output image
flags - the bitwise OR of one or more of + TJ.FLAG_*
Throws:
java.lang.Exception
@@ -336,7 +337,8 @@ public TJTransform instances, each of which specifies the transform parameters and/or cropping region for the - corresponding transformed output image
flags - the bitwise OR of one or more of TJ.FLAG_* + corresponding transformed output image
flags - the bitwise OR of one or more of + TJ.FLAG_*
Returns:
an array of TJDecompressor instances, each of which has a transformed JPEG image associated with it
Throws: @@ -351,13 +353,13 @@ getTransformedSizes public int[] getTransformedSizes() throws java.lang.Exception
-
Returns an array containing the sizes of the transformed JPEG images from - the most recent call to transform(). +
Returns an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation.

-
Returns:
an array containing the sizes of the transformed JPEG images from - the most recent call to transform() +
Returns:
an array containing the sizes of the transformed JPEG images + generated by the most recent transform operation
Throws:
java.lang.Exception
diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java index 8c4afdfc..6fb653f0 100644 --- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java @@ -48,7 +48,7 @@ public class TJCompressor { /** * Create a TurboJPEG compressor instance and associate the uncompressed - * source image stored in srcImage with the newly-created + * source image stored in srcImage with the newly created * instance. * * @param srcImage see {@link #setSourceImage} for description @@ -64,7 +64,7 @@ public class TJCompressor { * @param height see {@link #setSourceImage} for description * * @param pixelFormat pixel format of the source image (one of - * {@link TJ TJ.PF_*}) + * {@link TJ#PF_RGB TJ.PF_*}) */ public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch, int height, int pixelFormat) throws Exception { @@ -85,31 +85,31 @@ public class TJCompressor { * Associate an uncompressed source image with this compressor instance. * * @param srcImage image buffer containing RGB or grayscale pixels to be - * compressed + * compressed or encoded * - * @param x x offset (in pixels) of the region from which the JPEG image - * should be compressed, relative to the start of srcImage. + * @param x x offset (in pixels) of the region in the source image from which + * the JPEG or YUV image should be compressed/encoded * - * @param y y offset (in pixels) of the region from which the JPEG image - * should be compressed, relative to the start of srcImage. + * @param y y offset (in pixels) of the region in the source image from which + * the JPEG or YUV image should be compressed/encoded * * @param width width (in pixels) of the region in the source image from - * which the JPEG image should be compressed. + * which the JPEG or YUV image should be compressed/encoded * * @param pitch bytes per line of the source image. Normally, this should be * width * TJ.pixelSize(pixelFormat) if the source image is * unpadded, but you can use this parameter to, for instance, specify that * the scanlines in the source image are padded to a 4-byte boundary or to - * compress a JPEG image from a region of a larger source image. You can - * also be clever and use this parameter to skip lines, etc. Setting this - * parameter to 0 is the equivalent of setting it to width * - * TJ.pixelSize(pixelFormat). + * compress/encode a JPEG or YUV image from a region of a larger source + * image. You can also be clever and use this parameter to skip lines, etc. + * Setting this parameter to 0 is the equivalent of setting it to + * width * TJ.pixelSize(pixelFormat). * * @param height height (in pixels) of the region in the source image from - * which the JPEG image should be compressed. + * which the JPEG or YUV image should be compressed/encoded * * @param pixelFormat pixel format of the source image (one of - * {@link TJ TJ.PF_*}) + * {@link TJ#PF_RGB TJ.PF_*}) */ public void setSourceImage(byte[] srcImage, int x, int y, int width, int pitch, int height, int pixelFormat) @@ -146,8 +146,9 @@ public class TJCompressor { * Set the level of chrominance subsampling for subsequent compress/encode * operations. * - * @param newSubsamp the new level of chrominance subsampling (one of - * {@link TJ TJ.SAMP_*}) + * @param newSubsamp the level of chrominance subsampling to use in + * subsequent compress/encode operations (one of + * {@link TJ#SAMP_444 TJ.SAMP_*}) */ public void setSubsamp(int newSubsamp) throws Exception { if (newSubsamp < 0 || newSubsamp >= TJ.NUMSAMP) @@ -173,9 +174,11 @@ public class TJCompressor { * * @param dstBuf buffer that will receive the JPEG image. Use * {@link TJ#bufSize} to determine the maximum size for this buffer based on - * the image width, height, and level of chrominance subsampling. + * the source image's width and height and the desired level of chrominance + * subsampling. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void compress(byte[] dstBuf, int flags) throws Exception { if (dstBuf == null || flags < 0) @@ -200,7 +203,8 @@ public class TJCompressor { * Compress the uncompressed source image associated with this compressor * instance and return a buffer containing a JPEG image. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} * * @return a buffer containing a JPEG image. The length of this buffer will * not be equal to the size of the JPEG image. Use {@link @@ -225,7 +229,8 @@ public class TJCompressor { * {@link TJ#bufSize} to determine the maximum size for this buffer based on * the image width, height, and level of chrominance subsampling. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void compress(BufferedImage srcImage, byte[] dstBuf, int flags) throws Exception { @@ -306,7 +311,8 @@ public class TJCompressor { * @param srcImage a BufferedImage instance containing RGB or * grayscale pixels to be compressed * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} * * @return a buffer containing a JPEG image. The length of this buffer will * not be equal to the size of the JPEG image. Use {@link @@ -343,7 +349,8 @@ public class TJCompressor { * {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer * based on the image width, height, and level of chrominance subsampling. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void encodeYUV(byte[] dstBuf, int flags) throws Exception { if (dstBuf == null || flags < 0) @@ -362,7 +369,8 @@ public class TJCompressor { * instance and return a buffer containing a YUV planar image. See * {@link #encodeYUV(byte[], int)} for more detail. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} * * @return a buffer containing a YUV planar image */ @@ -388,7 +396,8 @@ public class TJCompressor { * {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer * based on the image width, height, and level of chrominance subsampling. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void encodeYUV(BufferedImage srcImage, byte[] dstBuf, int flags) throws Exception { @@ -457,7 +466,8 @@ public class TJCompressor { * @param srcImage a BufferedImage instance containing RGB or * grayscale pixels to be encoded * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} * * @return a buffer containing a YUV planar image */ diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java index 1b7efbea..ec8ab772 100644 --- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -48,7 +48,7 @@ public class TJDecompressor { /** * Create a TurboJPEG decompressor instance and associate the JPEG image - * stored in jpegImage with the newly-created instance. + * stored in jpegImage with the newly created instance. * * @param jpegImage JPEG image buffer (size of the JPEG image is assumed to * be the length of the array) @@ -61,7 +61,7 @@ public class TJDecompressor { /** * Create a TurboJPEG decompressor instance and associate the JPEG image * of length imageSize bytes stored in jpegImage - * with the newly-created instance. + * with the newly created instance. * * @param jpegImage JPEG image buffer * @@ -154,7 +154,6 @@ public class TJDecompressor { return jpegBufSize; } - /** * Returns the width of the largest scaled-down image that the TurboJPEG * decompressor can generate without exceeding the desired image width and @@ -287,10 +286,11 @@ public class TJDecompressor { * same as setting it to the height of the JPEG image (in other words, the * height will not be considered when determining the scaled image size.) * - * @param pixelFormat pixel format of the decompressed image (one of - * {@link TJ TJ.PF_*}) + * @param pixelFormat pixel format of the decompressed/decoded image (one of + * {@link TJ#PF_RGB TJ.PF_*}) * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void decompress(byte[] dstBuf, int x, int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat, @@ -338,9 +338,10 @@ public class TJDecompressor { * for description * * @param pixelFormat pixel format of the decompressed image (one of - * {@link TJ TJ.PF_*}) + * {@link TJ#PF_RGB TJ.PF_*}) * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} * * @return a buffer containing the decompressed image */ @@ -365,10 +366,7 @@ public class TJDecompressor { * This method performs JPEG decompression but leaves out the color * conversion step, so a planar YUV image is generated instead of an RGB * image. The padding of the planes in this image is the same as in the - * images generated by {@link TJCompressor#encodeYUV(byte[], int)}. Note - * 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. + * images generated by {@link TJCompressor#encodeYUV(byte[], int)}. *

* NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the * convention of the digital video community, the TurboJPEG API uses "YUV" to @@ -378,7 +376,8 @@ public class TJDecompressor { * {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer * based on the image width, height, and level of chrominance subsampling. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void decompressToYUV(byte[] dstBuf, int flags) throws Exception { if (jpegBuf == null) @@ -394,7 +393,8 @@ public class TJDecompressor { * instance and return a buffer containing a YUV planar image. See {@link * #decompressToYUV(byte[], int)} for more detail. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} * * @return a buffer containing a YUV planar image */ @@ -456,9 +456,10 @@ public class TJDecompressor { * height will not be considered when determining the scaled image size.) * * @param pixelFormat pixel format of the decompressed image (one of - * {@link TJ TJ.PF_*}) + * {@link TJ#PF_RGB TJ.PF_*}) * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void decompress(int[] dstBuf, int x, int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat, @@ -479,9 +480,13 @@ public class TJDecompressor { * BufferedImage instance. * * @param dstImage a BufferedImage instance that will receive - * the decompressed image + * the decompressed image. The width and height of the + * BufferedImage instance must match one of the scaled image + * sizes that TurboJPEG is capable of generating from the JPEG image. * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void decompress(BufferedImage dstImage, int flags) throws Exception { if (dstImage == null || flags < 0) @@ -491,7 +496,7 @@ public class TJDecompressor { int scaledWidth = getScaledWidth(desiredWidth, desiredHeight); int scaledHeight = getScaledHeight(desiredWidth, desiredHeight); if (scaledWidth != desiredWidth || scaledHeight != desiredHeight) - throw new Exception("BufferedImage dimensions do not match a scaled image size that TurboJPEG is capable of generating."); + throw new Exception("BufferedImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating."); int pixelFormat; boolean intPixels = false; if (byteOrder == null) byteOrder = ByteOrder.nativeOrder(); @@ -562,11 +567,12 @@ public class TJDecompressor { * {@link #decompress(byte[], int, int, int, int, int, int, int)} for * description * - * @param bufferedImageType the image type of the newly-created - * BufferedImage instance (for instance, + * @param bufferedImageType the image type of the BufferedImage + * instance that will be created (for instance, * BufferedImage.TYPE_INT_RGB) * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} * * @return a BufferedImage instance containing the * decompressed image diff --git a/java/org/libjpegturbo/turbojpeg/TJTransformer.java b/java/org/libjpegturbo/turbojpeg/TJTransformer.java index f84eaa12..da821633 100644 --- a/java/org/libjpegturbo/turbojpeg/TJTransformer.java +++ b/java/org/libjpegturbo/turbojpeg/TJTransformer.java @@ -42,7 +42,7 @@ public class TJTransformer extends TJDecompressor { /** * Create a TurboJPEG lossless transformer instance and associate the JPEG - * image stored in jpegImage with the newly-created instance. + * image stored in jpegImage with the newly created instance. * * @param jpegImage JPEG image buffer (size of the JPEG image is assumed to * be the length of the array) @@ -55,7 +55,7 @@ public class TJTransformer extends TJDecompressor { /** * Create a TurboJPEG lossless transformer instance and associate the JPEG * image of length imageSize bytes stored in - * jpegImage with the newly-created instance. + * jpegImage with the newly created instance. * * @param jpegImage JPEG image buffer * @@ -84,13 +84,14 @@ public class TJTransformer extends TJDecompressor { * receive a JPEG image that has been transformed using the parameters in * transforms[i]. Use {@link TJ#bufSize} to determine the * maximum size for each buffer based on the transformed or cropped width and - * height. + * height and the level of subsampling used in the source image. * * @param transforms an array of {@link TJTransform} instances, each of * which specifies the transform parameters and/or cropping region for the * corresponding transformed output image * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public void transform(byte[][] dstBufs, TJTransform[] transforms, int flags) throws Exception { @@ -112,7 +113,8 @@ public class TJTransformer extends TJDecompressor { * @return an array of {@link TJDecompressor} instances, each of * which has a transformed JPEG image associated with it * - * @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*} + * @param flags the bitwise OR of one or more of + * {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*} */ public TJDecompressor[] transform(TJTransform[] transforms, int flags) throws Exception { @@ -135,11 +137,11 @@ public class TJTransformer extends TJDecompressor { } /** - * Returns an array containing the sizes of the transformed JPEG images from - * the most recent call to {@link #transform transform()}. + * Returns an array containing the sizes of the transformed JPEG images + * generated by the most recent transform operation. * - * @return an array containing the sizes of the transformed JPEG images from - * the most recent call to {@link #transform transform()} + * @return an array containing the sizes of the transformed JPEG images + * generated by the most recent transform operation */ public int[] getTransformedSizes() throws Exception { if (transformedSizes == null)