Package loci.formats.tiff
Enum Class TiffCompression
- All Implemented Interfaces:
Serializable,Comparable<TiffCompression>,java.lang.constant.Constable,loci.common.enumeration.CodedEnum
public enum TiffCompression
extends Enum<TiffCompression>
implements loci.common.enumeration.CodedEnum
Utility class for performing compression operations with a TIFF file.
- Author:
- Curtis Rueden ctrueden at wisc.edu, Eric Kjellman egkjellman at wisc.edu, Melissa Linkert melissa at glencoesoftware.com, Chris Allan callan at blackcat.ca
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intCode for the TIFF compression in the actual TIFF file.private CodecTIFF compression codec.private StringName of the TIFF compression codec.private static final org.slf4j.Loggerprivate static final Map<Integer, TiffCompression> Reverse lookup of code to TIFF compression enumerate value. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTiffCompression(int code, Codec codec, String codecName) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]compress(byte[] input, CodecOptions options) Encodes a strip of data.byte[]decompress(byte[] input, CodecOptions options) Decodes a strip of data.static voiddifference(byte[] input, IFD ifd) Performs in-place differencing according to the given predictor value.static TiffCompressionget(int code) Retrieves a TIFF compression instance by code.intgetCode()getCodec()Retrieves the name of the TIFF compression codec.Creates a set of codec options for compression.getCompressionCodecOptions(IFD ifd, CodecOptions opt) Creates a set of codec options for compression.private static Map<Integer, TiffCompression> static voidundifference(byte[] input, IFD ifd) Undoes in-place differencing according to the given predictor value.static TiffCompressionReturns the enum constant of this class with the specified name.static TiffCompression[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT_UNCOMPRESSED
-
UNCOMPRESSED
-
CCITT_1D
-
GROUP_3_FAX
-
GROUP_4_FAX
-
LZW
-
OLD_JPEG
-
JPEG
-
PACK_BITS
-
PROPRIETARY_DEFLATE
-
DEFLATE
-
THUNDERSCAN
-
JPEG_2000
-
JPEG_2000_LOSSY
-
ALT_JPEG2000
-
ALT_JPEG
-
OLYMPUS_JPEG2000
-
NIKON
-
JPEGXR
-
ZSTD
-
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
code
private int codeCode for the TIFF compression in the actual TIFF file. -
codec
TIFF compression codec. -
codecName
Name of the TIFF compression codec. -
lookup
Reverse lookup of code to TIFF compression enumerate value.
-
-
Constructor Details
-
TiffCompression
Default constructor.- Parameters:
code- Integer "code" for the TIFF compression type.codec- TIFF compression codec.codecName- String name of the compression type.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getCompressionMap
-
get
Retrieves a TIFF compression instance by code.- Parameters:
code- Integer "code" for the TIFF compression type.- Returns:
- See above.
-
getCode
public int getCode()- Specified by:
getCodein interfaceloci.common.enumeration.CodedEnum
-
getCodecName
Retrieves the name of the TIFF compression codec.- Returns:
- See above.
-
getCodec
- Returns:
- the codec instance for this TIFF compression.
-
decompress
Decodes a strip of data.- Throws:
FormatExceptionIOException
-
undifference
Undoes in-place differencing according to the given predictor value.- Throws:
FormatException
-
getCompressionCodecOptions
Creates a set of codec options for compression.- Parameters:
ifd- The IFD to create codec options for.- Returns:
- A new codec options instance populated using metadata from
ifd. - Throws:
FormatException
-
getCompressionCodecOptions
Creates a set of codec options for compression.- Parameters:
ifd- The IFD to create codec options for.opt- The codec options to copy.- Returns:
- A new codec options instance populated using metadata from
ifd. - Throws:
FormatException
-
compress
Encodes a strip of data.- Throws:
FormatExceptionIOException
-
difference
Performs in-place differencing according to the given predictor value.- Throws:
FormatException
-