diff --git a/java/TJBench.java b/java/TJBench.java index a91eb7c7..f1f3854b 100644 --- a/java/TJBench.java +++ b/java/TJBench.java @@ -971,8 +971,9 @@ final class TJBench { if ((sf.getNum() != 1 || sf.getDenom() != 1) && doTile) { System.out.println("Disabling tiled compression/decompression tests, because those tests do not"); - System.out.println("work when scaled decompression is enabled."); + System.out.println("work when scaled decompression is enabled.\n"); doTile = false; + xformOpt &= (~TJTransform.OPT_CROP); } if (!decompOnly) { diff --git a/java/TJExample.java b/java/TJExample.java index 9e6edd25..64e7ad13 100644 --- a/java/TJExample.java +++ b/java/TJExample.java @@ -1,6 +1,6 @@ /* - * Copyright (C)2011-2012, 2014-2015, 2017-2018, 2022 D. R. Commander. - * All Rights Reserved. + * Copyright (C)2011-2012, 2014-2015, 2017-2018, 2022-2023 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: @@ -136,14 +136,11 @@ class TJExample implements TJCustomFilter { System.out.println("-display = Display output image (Output filename need not be specified in this"); System.out.println(" case.)\n"); - System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in"); - System.out.println(" the underlying codec.\n"); + System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available\n"); - System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying"); - System.out.println(" codec.\n"); + System.out.println("-fastdct = Use the fastest DCT/IDCT algorithm available\n"); - System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the"); - System.out.println(" underlying codec.\n"); + System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithm available\n"); System.exit(1); } diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html index 4ed658c5..69b7a3e5 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html @@ -380,13 +380,15 @@ implements java.io.Closeable 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 row in the source image. Normally this should be - width * TJ.pixelSize(pixelFormat), if the source image is - unpadded. However, you can use this parameter to, for instance, specify - that the rows in the source image are padded to the nearest multiple of 4 - bytes or to 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 rows, - 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 + width * + TJ.getPixelSize(pixelFormat), + if the source image is unpadded. However, you can use this parameter to, + for instance, specify that the rows in the source image are padded to the + nearest multiple of 4 bytes or to 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 rows, etc. Setting this parameter to 0 is the + equivalent of setting it to width * + TJ.getPixelSize(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:
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html index ddbaf3d4..57b300d9 100644 --- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html +++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html @@ -819,17 +819,19 @@ implements java.io.Closeable it to the width of the JPEG image. (In other words, the width will not be considered when determining the scaled image size.) This parameter is ignored if the source image is a YUV image.
pitch - bytes per row in the destination image. Normally this should - be set to scaledWidth * TJ.pixelSize(pixelFormat), if the - destination image will be unpadded. However, you can use this to, for - instance, pad each row of the destination image to the nearest multiple of - 4 bytes or to decompress/decode the source image into a region of a larger - image. NOTE: if the source image is a JPEG image, then + be set to scaledWidth * + TJ.getPixelSize(pixelFormat), + if the destination image will be unpadded. However, you can use this to, + for instance, pad each row of the destination image to the nearest + multiple of 4 bytes or to decompress/decode the source image into a region + of a larger image. NOTE: if the source image is a JPEG image, then scaledWidth can be determined by calling scalingFactor.getScaled(jpegWidth) or by calling getScaledWidth(int, int). If the source image is a YUV image, then scaledWidth is the width of the YUV image. Setting this parameter to 0 is the equivalent of setting it to - scaledWidth * TJ.pixelSize(pixelFormat).
desiredHeight - If the source image is a JPEG image, then this + scaledWidth * + TJ.getPixelSize(pixelFormat).
desiredHeight - If the source image is a JPEG image, then this specifies the desired height (in pixels) of the decompressed image (or image region.) If the desired destination image dimensions are different than the source image dimensions, then TurboJPEG will use scaling in the diff --git a/java/org/libjpegturbo/turbojpeg/TJCompressor.java b/java/org/libjpegturbo/turbojpeg/TJCompressor.java index 1c98a98a..c6f9d149 100644 --- a/java/org/libjpegturbo/turbojpeg/TJCompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJCompressor.java @@ -116,13 +116,15 @@ public class TJCompressor implements Closeable { * which the JPEG or YUV image should be compressed/encoded * * @param pitch bytes per row in the source image. Normally this should be - * width * TJ.pixelSize(pixelFormat), if the source image is - * unpadded. However, you can use this parameter to, for instance, specify - * that the rows in the source image are padded to the nearest multiple of 4 - * bytes or to 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 rows, - * etc. Setting this parameter to 0 is the equivalent of setting it to - * width * TJ.pixelSize(pixelFormat). + * width * + * {@link TJ#getPixelSize TJ.getPixelSize}(pixelFormat), + * if the source image is unpadded. However, you can use this parameter to, + * for instance, specify that the rows in the source image are padded to the + * nearest multiple of 4 bytes or to 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 rows, etc. Setting this parameter to 0 is the + * equivalent of setting it to width * + * {@link TJ#getPixelSize TJ.getPixelSize}(pixelFormat). * * @param height height (in pixels) of the region in the source image from * which the JPEG or YUV image should be compressed/encoded diff --git a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java index 52787ba4..976d86a6 100644 --- a/java/org/libjpegturbo/turbojpeg/TJDecompressor.java +++ b/java/org/libjpegturbo/turbojpeg/TJDecompressor.java @@ -366,17 +366,19 @@ public class TJDecompressor implements Closeable { * ignored if the source image is a YUV image. * * @param pitch bytes per row in the destination image. Normally this should - * be set to scaledWidth * TJ.pixelSize(pixelFormat), if the - * destination image will be unpadded. However, you can use this to, for - * instance, pad each row of the destination image to the nearest multiple of - * 4 bytes or to decompress/decode the source image into a region of a larger - * image. NOTE: if the source image is a JPEG image, then + * be set to scaledWidth * + * {@link TJ#getPixelSize TJ.getPixelSize}(pixelFormat), + * if the destination image will be unpadded. However, you can use this to, + * for instance, pad each row of the destination image to the nearest + * multiple of 4 bytes or to decompress/decode the source image into a region + * of a larger image. NOTE: if the source image is a JPEG image, then * scaledWidth can be determined by calling * scalingFactor.{@link TJScalingFactor#getScaled getScaled}(jpegWidth) * or by calling {@link #getScaledWidth}. If the source image is a YUV * image, then scaledWidth is the width of the YUV image. * Setting this parameter to 0 is the equivalent of setting it to - * scaledWidth * TJ.pixelSize(pixelFormat). + * scaledWidth * + * {@link TJ#getPixelSize TJ.getPixelSize}(pixelFormat). * * @param desiredHeight If the source image is a JPEG image, then this * specifies the desired height (in pixels) of the decompressed image (or diff --git a/tjbench.c b/tjbench.c index dcf266c1..dd25552a 100644 --- a/tjbench.c +++ b/tjbench.c @@ -995,14 +995,14 @@ int main(int argc, char *argv[]) if ((sf.num != 1 || sf.denom != 1) && doTile) { printf("Disabling tiled compression/decompression tests, because those tests do not\n"); - printf("work when scaled decompression is enabled.\n"); - doTile = 0; + printf("work when scaled decompression is enabled.\n\n"); + doTile = 0; xformOpt &= (~TJXOPT_CROP); } if ((flags & TJFLAG_NOREALLOC) == 0 && doTile) { printf("Disabling tiled compression/decompression tests, because those tests do not\n"); printf("work when dynamic JPEG buffer allocation is enabled.\n\n"); - doTile = 0; + doTile = 0; xformOpt &= (~TJXOPT_CROP); } if (!decompOnly) { diff --git a/tjexample.c b/tjexample.c index 2142024e..857a7f63 100644 --- a/tjexample.c +++ b/tjexample.c @@ -1,5 +1,5 @@ /* - * Copyright (C)2011-2012, 2014-2015, 2017, 2019, 2021-2022 + * Copyright (C)2011-2012, 2014-2015, 2017, 2019, 2021-2023 * D. R. Commander. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without @@ -149,14 +149,11 @@ static void usage(char *programName) printf("General Options\n"); printf("---------------\n\n"); - printf("-fastupsample = Use the fastest chrominance upsampling algorithm available in\n"); - printf(" the underlying codec.\n\n"); + printf("-fastupsample = Use the fastest chrominance upsampling algorithm available\n\n"); - printf("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\n"); - printf(" codec.\n\n"); + printf("-fastdct = Use the fastest DCT/IDCT algorithm available\n\n"); - printf("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\n"); - printf(" underlying codec.\n\n"); + printf("-accuratedct = Use the most accurate DCT/IDCT algorithm available\n\n"); exit(1); }