Various doc tweaks
- "Optimized baseline entropy coding" = "Huffman table optimization" "Optimized baseline entropy coding" was meant to emphasize that the feature is only useful when generating baseline (single-scan lossy 8-bit-per-sample Huffman-coded) JPEG images, because it is automatically enabled when generating Huffman-coded progressive (multi-scan), 12-bit-per-sample, and lossless JPEG images. However, Huffman table optimization isn't actually an integral part of those non-baseline modes. You can forego Huffman table optimization with 12-bit data precision if you supply your own Huffman tables. The spec doesn't require it with progressive or lossless mode, either, although our implementation does. Furthermore, "baseline" describes more than just the type of entropy coding used. It was incorrect to say that optimized "baseline" entropy coding is automatically enabled for Huffman-coded progressive, 12-bit-per-sample, and lossless JPEG images, since those are clearly not baseline images. - "Progressive entropy coding" = "Progressive JPEG" "Progressive" describes more than just the type of entropy coding used. (In fact, both Huffman-coded and arithmetic-coded images can be progressive.) - Mention that TJPARAM_OPTIMIZE/TJ.PARAM_OPTIMIZE can be used with lossless transformation as well. - General wordsmithing - Formatting tweaks
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011, 2013, 2018, 2022-2023 D. R. Commander.
|
||||
* Copyright (C)2011, 2013, 2018, 2022-2024 D. R. Commander.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -92,69 +92,64 @@ public class TJTransform extends Rectangle {
|
||||
|
||||
|
||||
/**
|
||||
* This option will cause {@link TJTransformer#transform
|
||||
* This option causes {@link TJTransformer#transform
|
||||
* TJTransformer.transform()} to throw an exception if the transform is not
|
||||
* perfect. Lossless transforms operate on MCU blocks, whose size depends on
|
||||
* the level of chrominance subsampling used. If the image's width or height
|
||||
* is not evenly divisible by the MCU block size (see {@link TJ#getMCUWidth
|
||||
* TJ.getMCUWidth()} and {@link TJ#getMCUHeight TJ.getMCUHeight()}), then
|
||||
* there will be partial MCU blocks on the right and/or bottom edges. It is
|
||||
* not possible to move these partial MCU blocks to the top or left of the
|
||||
* image, so any transform that would require that is "imperfect." If this
|
||||
* option is not specified, then any partial MCU blocks that cannot be
|
||||
* transformed will be left in place, which will create odd-looking strips on
|
||||
* the right or bottom edge of the image.
|
||||
* perfect. Lossless transforms operate on MCU blocks, the size of which
|
||||
* depends on the level of chrominance subsampling used. If the image's
|
||||
* width or height is not evenly divisible by the MCU block size (see
|
||||
* {@link TJ#getMCUWidth TJ.getMCUWidth()} and {@link TJ#getMCUHeight
|
||||
* TJ.getMCUHeight()}), then there will be partial MCU blocks on the right
|
||||
* and/or bottom edges. It is not possible to move these partial MCU blocks
|
||||
* to the top or left of the image, so any transform that would require that
|
||||
* is "imperfect." If this option is not specified, then any partial MCU
|
||||
* blocks that cannot be transformed will be left in place, which will create
|
||||
* odd-looking strips on the right or bottom edge of the image.
|
||||
*/
|
||||
public static final int OPT_PERFECT = (1 << 0);
|
||||
/**
|
||||
* This option will discard any partial MCU blocks that cannot be
|
||||
* transformed.
|
||||
* Discard any partial MCU blocks that cannot be transformed.
|
||||
*/
|
||||
public static final int OPT_TRIM = (1 << 1);
|
||||
/**
|
||||
* This option will enable lossless cropping.
|
||||
* Enable lossless cropping.
|
||||
*/
|
||||
public static final int OPT_CROP = (1 << 2);
|
||||
/**
|
||||
* This option will discard the color data in the source image and produce a
|
||||
* grayscale destination image.
|
||||
* Discard the color data in the source image, and generate a grayscale
|
||||
* destination image.
|
||||
*/
|
||||
public static final int OPT_GRAY = (1 << 3);
|
||||
/**
|
||||
* This option will prevent {@link TJTransformer#transform
|
||||
* TJTransformer.transform()} from outputting a JPEG image for this
|
||||
* particular transform. This can be used in conjunction with a custom
|
||||
* filter to capture the transformed DCT coefficients without transcoding
|
||||
* them.
|
||||
* Do not generate a destination image. This can be used in conjunction with
|
||||
* a custom filter to capture the transformed DCT coefficients without
|
||||
* transcoding them.
|
||||
*/
|
||||
public static final int OPT_NOOUTPUT = (1 << 4);
|
||||
/**
|
||||
* This option will enable progressive entropy coding in the JPEG image
|
||||
* generated by this particular transform. Progressive entropy coding will
|
||||
* generally improve compression relative to baseline entropy coding (the
|
||||
* default), but it will reduce decompression performance considerably.
|
||||
* Can be combined with {@link #OPT_ARITHMETIC}. Implies
|
||||
* {@link #OPT_OPTIMIZE} unless {@link #OPT_ARITHMETIC} is also specified.
|
||||
* Generate a progressive destination image instead of a single-scan
|
||||
* destination image. Progressive JPEG images generally have better
|
||||
* compression ratios than single-scan JPEG images (much better if the image
|
||||
* has large areas of solid color), but progressive JPEG decompression is
|
||||
* considerably slower than single-scan JPEG decompression. Can be combined
|
||||
* with {@link #OPT_ARITHMETIC}. Implies {@link #OPT_OPTIMIZE} unless
|
||||
* {@link #OPT_ARITHMETIC} is also specified.
|
||||
*/
|
||||
public static final int OPT_PROGRESSIVE = (1 << 5);
|
||||
/**
|
||||
* This option will prevent {@link TJTransformer#transform
|
||||
* TJTransformer.transform()} from copying any extra markers (including EXIF
|
||||
* and ICC profile data) from the source image to the destination image.
|
||||
* Do not copy any extra markers (including EXIF and ICC profile data) from
|
||||
* the source image to the destination image.
|
||||
*/
|
||||
public static final int OPT_COPYNONE = (1 << 6);
|
||||
/**
|
||||
* This option will enable arithmetic entropy coding in the JPEG image
|
||||
* generated by this particular transform. Arithmetic entropy coding will
|
||||
* generally improve compression relative to Huffman entropy coding (the
|
||||
* default), but it will reduce decompression performance considerably. Can
|
||||
* be combined with {@link #OPT_PROGRESSIVE}.
|
||||
* Enable arithmetic entropy coding in the destination image. Arithmetic
|
||||
* entropy coding generally improves compression relative to Huffman entropy
|
||||
* coding (the default), but it reduces decompression performance
|
||||
* considerably. Can be combined with {@link #OPT_PROGRESSIVE}.
|
||||
*/
|
||||
public static final int OPT_ARITHMETIC = (1 << 7);
|
||||
/**
|
||||
* This option will enable optimized baseline entropy coding in the JPEG
|
||||
* image generated by this particular transform. Optimized baseline entropy
|
||||
* coding will improve compression slightly (generally 5% or less.)
|
||||
* Enable Huffman table optimization for the destination image. Huffman
|
||||
* table optimization improves compression slightly (generally 5% or less.)
|
||||
*/
|
||||
public static final int OPT_OPTIMIZE = (1 << 8);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user