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 -
Method Summary
Modifier and TypeMethodDescriptionbyte[]compress(byte[] input, loci.formats.codec.CodecOptions options) Encodes a strip of data.byte[]decompress(byte[] input, loci.formats.codec.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()loci.formats.codec.CodecgetCodec()Retrieves the name of the TIFF compression codec.loci.formats.codec.CodecOptionsCreates a set of codec options for compression.loci.formats.codec.CodecOptionsgetCompressionCodecOptions(IFD ifd, loci.formats.codec.CodecOptions opt) Creates a set of codec options for compression.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
-
-
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
-
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
public loci.formats.codec.Codec getCodec()- Returns:
- the codec instance for this TIFF compression.
-
decompress
public byte[] decompress(byte[] input, loci.formats.codec.CodecOptions options) throws loci.formats.FormatException, IOException Decodes a strip of data.- Throws:
loci.formats.FormatExceptionIOException
-
undifference
Undoes in-place differencing according to the given predictor value.- Throws:
loci.formats.FormatException
-
getCompressionCodecOptions
public loci.formats.codec.CodecOptions getCompressionCodecOptions(IFD ifd) throws loci.formats.FormatException 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:
loci.formats.FormatException
-
getCompressionCodecOptions
public loci.formats.codec.CodecOptions getCompressionCodecOptions(IFD ifd, loci.formats.codec.CodecOptions opt) throws loci.formats.FormatException 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:
loci.formats.FormatException
-
compress
public byte[] compress(byte[] input, loci.formats.codec.CodecOptions options) throws loci.formats.FormatException, IOException Encodes a strip of data.- Throws:
loci.formats.FormatExceptionIOException
-
difference
Performs in-place differencing according to the given predictor value.- Throws:
loci.formats.FormatException
-