Enum Class TiffCompression

java.lang.Object
java.lang.Enum<TiffCompression>
loci.formats.tiff.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
  • Enum Constant Details

  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • code

      private int code
      Code for the TIFF compression in the actual TIFF file.
    • codec

      private Codec codec
      TIFF compression codec.
    • codecName

      private String codecName
      Name of the TIFF compression codec.
    • lookup

      private static final Map<Integer,TiffCompression> lookup
      Reverse lookup of code to TIFF compression enumerate value.
  • Constructor Details

    • TiffCompression

      private TiffCompression(int code, Codec codec, String codecName)
      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

      public static TiffCompression[] 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

      public static TiffCompression valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCompressionMap

      private static Map<Integer,TiffCompression> getCompressionMap()
    • get

      public static TiffCompression get(int code)
      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:
      getCode in interface loci.common.enumeration.CodedEnum
    • getCodecName

      public String getCodecName()
      Retrieves the name of the TIFF compression codec.
      Returns:
      See above.
    • getCodec

      public Codec getCodec()
      Returns:
      the codec instance for this TIFF compression.
    • decompress

      public byte[] decompress(byte[] input, CodecOptions options) throws FormatException, IOException
      Decodes a strip of data.
      Throws:
      FormatException
      IOException
    • undifference

      public static void undifference(byte[] input, IFD ifd) throws FormatException
      Undoes in-place differencing according to the given predictor value.
      Throws:
      FormatException
    • getCompressionCodecOptions

      public CodecOptions getCompressionCodecOptions(IFD ifd) throws 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:
      FormatException
    • getCompressionCodecOptions

      public CodecOptions getCompressionCodecOptions(IFD ifd, CodecOptions opt) throws 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:
      FormatException
    • compress

      public byte[] compress(byte[] input, CodecOptions options) throws FormatException, IOException
      Encodes a strip of data.
      Throws:
      FormatException
      IOException
    • difference

      public static void difference(byte[] input, IFD ifd) throws FormatException
      Performs in-place differencing according to the given predictor value.
      Throws:
      FormatException