Java doc tweaks

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@966 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2013-04-27 01:06:52 +00:00
parent bd096ba10d
commit aba6c404c3
25 changed files with 243 additions and 270 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -182,11 +182,11 @@ final public class TJ {
/**
* Returns the pixel size (in bytes) of the given pixel format.
* Returns the pixel size (in bytes) for the given pixel format.
*
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
*
* @return the pixel size (in bytes) of the given pixel format
* @return the pixel size (in bytes) for the given pixel format
*/
public static int getPixelSize(int pixelFormat) throws Exception {
if(pixelFormat < 0 || pixelFormat >= NUMPF)
@@ -291,11 +291,11 @@ final public class TJ {
*/
final public static int FLAG_FORCESSE3 = 128;
/**
* When decompressing, use the fastest chrominance upsampling algorithm
* available in the underlying codec. The default is to use smooth
* upsampling, which creates a smooth transition between neighboring
* chrominance components in order to reduce upsampling artifacts in the
* decompressed image.
* When decompressing an image that was compressed using chrominance
* subsampling, use the fastest chrominance upsampling algorithm available in
* the underlying codec. The default is to use smooth upsampling, which
* creates a smooth transition between neighboring chrominance components in
* order to reduce upsampling artifacts in the decompressed image.
*/
final public static int FLAG_FASTUPSAMPLE = 256;
/**
@@ -321,8 +321,7 @@ final public class TJ {
/**
* Returns the maximum size of the buffer (in bytes) required to hold a JPEG
* image with the given width and height, and level of chrominance
* subsampling.
* image with the given width, height, and level of chrominance subsampling.
*
* @param width the width (in pixels) of the JPEG image
*
@@ -332,8 +331,7 @@ final public class TJ {
* generating the JPEG image (one of {@link TJ TJ.SAMP_*})
*
* @return the maximum size of the buffer (in bytes) required to hold a JPEG
* image with the given width and height, and level of chrominance
* subsampling
* image with the given width, height, and level of chrominance subsampling
*/
public native static int bufSize(int width, int height, int jpegSubsamp)
throws Exception;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -59,7 +59,8 @@ public class TJCompressor {
*
* @param height see {@link #setSourceImage} for description
*
* @param pixelFormat see {@link #setSourceImage} for description
* @param pixelFormat pixel format of the source image (one of
* {@link TJ TJ.PF_*})
*/
public TJCompressor(byte[] srcImage, int width, int pitch, int height,
int pixelFormat) throws Exception {
@@ -83,7 +84,8 @@ public class TJCompressor {
*
* @param height see {@link #setSourceImage} for description
*
* @param pixelFormat see {@link #setSourceImage} for description
* @param pixelFormat pixel format of the source image (one of
* {@link TJ TJ.PF_*})
*/
public TJCompressor(byte[] srcImage, int x, int y, int width, int pitch,
int height, int pixelFormat) throws Exception {
@@ -137,28 +139,9 @@ public class TJCompressor {
}
/**
* Associate an uncompressed source image with this compressor instance.
*
* @param srcImage see
* {@link #setSourceImage(byte[], int, int, int, int, int, int)} for
* description
*
* @param width see
* {@link #setSourceImage(byte[], int, int, int, int, int, int)} for
* description
*
* @param pitch see
* {@link #setSourceImage(byte[], int, int, int, int, int, int)} for
* description
*
* @param height see
* {@link #setSourceImage(byte[], int, int, int, int, int, int)} for
* description
*
* @param pixelFormat pixel format of the source image (one of
* {@link TJ TJ.PF_*})
* @deprecated Use
* {@link #setSourceImage(byte[], int, int, int, int, int, int)} instead.
*/
public void setSourceImage(byte[] srcImage, int width, int pitch,
int height, int pixelFormat) throws Exception {
setSourceImage(srcImage, 0, 0, width, pitch, height, pixelFormat);
@@ -197,7 +180,7 @@ 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 and height.
* the image width, height, and level of chrominance subsampling.
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
*/
@@ -242,7 +225,7 @@ 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 and height.
* the image width, height, and level of chrominance subsampling.
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
*/
@@ -342,13 +325,13 @@ public class TJCompressor {
* TurboJPEG's underlying codec to produce a planar YUV image that is
* suitable for direct video display. Specifically, if the chrominance
* components are subsampled along the horizontal dimension, then the width
* of the luminance plane is padded to 2 in the output image (same goes for
* the height of the luminance plane, if the chrominance components are
* subsampled along the vertical dimension.) Also, each line of each plane
* in the output image is padded to 4 bytes. Although this will work with
* any subsampling option, it is really only useful in combination with
* {@link TJ#SAMP_420}, which produces an image compatible with the I420 (AKA
* "YUV420P") format.
* 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.)
* Also, each line of each plane in the output image is padded to 4 bytes.
* Although this will work with any subsampling option, it is really only
* useful in combination with {@link TJ#SAMP_420}, which produces an image
* compatible with the I420 (AKA "YUV420P") format.
*
* @param dstBuf buffer that will receive the YUV planar image. Use
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
* Copyright (C)2011, 2013 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -58,12 +58,12 @@ public interface TJCustomFilter {
* component plane to which <code>coeffBuffer</code> belongs
*
* @param componentID ID number of the component plane to which
* <code>coeffBuffer</code>belongs (Y, Cb, and Cr have, respectively, ID's of
* <code>coeffBuffer</code> belongs (Y, U, and V have, respectively, ID's of
* 0, 1, and 2 in typical JPEG images.)
*
* @param transformID ID number of the transformed image to which
* <code>coeffBuffer</code> belongs. This is the same as the index of the
* transform in the transforms array that was passed to {@link
* transform in the <code>transforms</code> array that was passed to {@link
* TJTransformer#transform TJTransformer.transform()}.
*
* @param transform a {@link TJTransform} instance that specifies the

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
* Copyright (C)2011-2013 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -151,7 +151,7 @@ public class TJDecompressor {
/**
* Returns the width of the largest scaled down image that the TurboJPEG
* Returns the width of the largest scaled-down image that the TurboJPEG
* decompressor can generate without exceeding the desired image width and
* height.
*
@@ -165,7 +165,7 @@ public class TJDecompressor {
* image (in other words, the height will not be considered when determining
* the scaled image size.)
*
* @return the width of the largest scaled down image that the TurboJPEG
* @return the width of the largest scaled-down image that the TurboJPEG
* decompressor can generate without exceeding the desired image width and
* height
*/
@@ -191,7 +191,7 @@ public class TJDecompressor {
}
/**
* Returns the height of the largest scaled down image that the TurboJPEG
* Returns the height of the largest scaled-down image that the TurboJPEG
* decompressor can generate without exceeding the desired image width and
* height.
*
@@ -205,7 +205,7 @@ public class TJDecompressor {
* image (in other words, the height will not be considered when determining
* the scaled image size.)
*
* @return the height of the largest scaled down image that the TurboJPEG
* @return the height of the largest scaled-down image that the TurboJPEG
* decompressor can generate without exceeding the desired image width and
* height
*/
@@ -251,13 +251,13 @@ public class TJDecompressor {
* @param y y offset (in pixels) of the region into which the JPEG image
* should be decompressed, relative to the start of <code>dstBuf</code>.
*
* @param desiredWidth desired width (in pixels) of the decompressed image.
* If the desired image dimensions are smaller than the dimensions of the
* JPEG image being decompressed, then TurboJPEG will use 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 width of the JPEG image (in other words, the width will not be
* considered when determining the scaled image size.)
* @param desiredWidth desired width (in pixels) of the decompressed image
* (or image region.) If the desired image dimensions are different than the
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
* 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 width of the JPEG image (in other words, the
* width will not be considered when determining the scaled image size.)
*
* @param pitch bytes per line of the destination image. Normally, this
* should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if
@@ -270,13 +270,13 @@ public class TJDecompressor {
* 0 is the equivalent of setting it to <code>scaledWidth *
* TJ.pixelSize(pixelFormat)</code>.
*
* @param desiredHeight desired height (in pixels) of the decompressed image.
* If the desired image dimensions are smaller than the dimensions of the
* JPEG image being decompressed, then TurboJPEG will use 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.)
* @param desiredHeight desired height (in pixels) of the decompressed image
* (or image region.) If the desired image dimensions are different than the
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
* 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.)
*
* @param pixelFormat pixel format of the decompressed image (one of
* {@link TJ TJ.PF_*})
@@ -296,29 +296,8 @@ public class TJDecompressor {
}
/**
* Decompress the JPEG source image associated with this decompressor
* instance and output a decompressed image to the given destination buffer.
*
* @param dstBuf see
* {@link #decompress(byte[], int, int, int, int, int, int, int)}
* for description
*
* @param desiredWidth see
* {@link #decompress(byte[], int, int, int, int, int, int, int)}
* for description
*
* @param pitch see
* {@link #decompress(byte[], int, int, int, int, int, int, int)}
* for description
*
* @param desiredHeight see
* {@link #decompress(byte[], int, int, int, int, int, int, int)}
* for description
*
* @param pixelFormat pixel format of the decompressed image (one of
* {@link TJ TJ.PF_*})
*
* @param flags the bitwise OR of one or more of {@link TJ TJ.FLAG_*}
* @deprecated Use
* {@link #decompress(byte[], int, int, int, int, int, int, int)} instead.
*/
public void decompress(byte[] dstBuf, int desiredWidth, int pitch,
int desiredHeight, int pixelFormat, int flags)
@@ -369,11 +348,11 @@ public class TJDecompressor {
* instance and output a YUV planar image to the given destination buffer.
* 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 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.
* 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.
*
* @param dstBuf buffer that will receive the YUV planar image. Use
* {@link TJ#bufSizeYUV} to determine the appropriate size for this buffer
@@ -431,13 +410,13 @@ public class TJDecompressor {
* @param y y offset (in pixels) of the region into which the JPEG image
* should be decompressed, relative to the start of <code>dstBuf</code>.
*
* @param desiredWidth desired width (in pixels) of the decompressed image.
* If the desired image dimensions are smaller than the dimensions of the
* JPEG image being decompressed, then TurboJPEG will use 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 width of the JPEG image (in other words, the width will not be
* considered when determining the scaled image size.)
* @param desiredWidth desired width (in pixels) of the decompressed image
* (or image region.) If the desired image dimensions are different than the
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
* 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 width of the JPEG image (in other words, the
* width will not be considered when determining the scaled image size.)
*
* @param stride pixels per line of the destination image. Normally, this
* should be set to <code>scaledWidth</code>, but you can use this to, for
@@ -447,13 +426,13 @@ public class TJDecompressor {
* </code> or by calling {@link #getScaledWidth}. Setting this parameter to
* 0 is the equivalent of setting it to <code>scaledWidth</code>.
*
* @param desiredHeight desired height (in pixels) of the decompressed image.
* If the desired image dimensions are smaller than the dimensions of the
* JPEG image being decompressed, then TurboJPEG will use 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.)
* @param desiredHeight desired height (in pixels) of the decompressed image
* (or image region.) If the desired image dimensions are different than the
* dimensions of the JPEG image being decompressed, then TurboJPEG will use
* 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.)
*
* @param pixelFormat pixel format of the decompressed image (one of
* {@link TJ TJ.PF_*})

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
* Copyright (C)2011, 2013 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -144,10 +144,12 @@ public class TJTransform extends Rectangle {
* divisible by the MCU block height (see {@link TJ#getMCUHeight})
*
* @param w the width of the cropping region. Setting this to 0 is the
* equivalent of setting it to the width of the source JPEG image - x.
* equivalent of setting it to (width of the source JPEG image -
* <code>x</code>).
*
* @param h the height of the cropping region. Setting this to 0 is the
* equivalent of setting it to the height of the source JPEG image - y.
* equivalent of setting it to (height of the source JPEG image -
* <code>y</code>).
*
* @param op one of the transform operations (<code>OP_*</code>)
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2011 D. R. Commander. All Rights Reserved.
* Copyright (C)2011, 2013 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -73,17 +73,18 @@ public class TJTransformer extends TJDecompressor {
* JPEG image structure to another without altering the values of the
* coefficients. While this is typically faster than decompressing the
* image, transforming it, and re-compressing it, lossless transforms are not
* free. Each lossless transform requires reading and Huffman decoding all
* of the coefficients in the source image, regardless of the size of the
* destination image. Thus, this method provides a means of generating
* multiple transformed images from the same source or of applying multiple
* transformations simultaneously, in order to eliminate the need to read the
* source coefficients multiple times.
* free. Each lossless transform requires reading and performing Huffman
* decoding on all of the coefficients in the source image, regardless of the
* size of the destination image. Thus, this method provides a means of
* generating multiple transformed images from the same source or of applying
* multiple transformations simultaneously, in order to eliminate the need to
* read the source coefficients multiple times.
*
* @param dstBufs an array of image buffers. <code>dstbufs[i]</code> will
* receive a JPEG image that has been transformed using the parameters in
* <code>transforms[i]</code>. Use {@link TJ#bufSize} to determine the
* maximum size for each buffer based on the cropped width and height.
* maximum size for each buffer based on the transformed or cropped width and
* height.
*
* @param transforms an array of {@link TJTransform} instances, each of
* which specifies the transform parameters and/or cropping region for the