loci.formats.codec

## Enum CompressionType

- java.lang.Object
- - java.lang.Enum<CompressionType>
  - - loci.formats.codec.CompressionType

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CompressionType>, loci.common.enumeration.CodedEnum

      public enum CompressionType
      extends java.lang.Enum<CompressionType>
      implements loci.common.enumeration.CodedEnum

  An enumeration of compression types.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `ANIMATION`
    `CINEPAK`
    `H_263`
    `J2K`
    `J2K_LOSSY`
    `JPEG`
    `LZW`
    `MPEG_4`
    `SORENSON`
    `SORENSON_3`
    `UNCOMPRESSED`
    `ZLIB`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `code` Code for the compression.
    `private java.lang.String` | `compression` The compression used.
    `private static java.util.Map<java.lang.Integer,CompressionType>` | `lookup` Map used to retrieve the compression type corresponding to the code.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static CompressionType` | `get(Codec c)` Look up the compression type by Codec instance.
    `static CompressionType` | `get(int code)` Retrieves the compression by reverse lookup of its "code".
    `int` | `getCode()` Implemented as specified by the `CodedEnum` I/F.
    `java.lang.String` | `getCompression()` Returns the compression.
    `static CompressionType` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static CompressionType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### UNCOMPRESSED

          public static final CompressionType UNCOMPRESSED

    - #### ZLIB

          public static final CompressionType ZLIB

    - #### CINEPAK

          public static final CompressionType CINEPAK

    - #### ANIMATION

          public static final CompressionType ANIMATION

    - #### H_263

          public static final CompressionType H_263

    - #### SORENSON

          public static final CompressionType SORENSON

    - #### SORENSON_3

          public static final CompressionType SORENSON_3

    - #### MPEG_4

          public static final CompressionType MPEG_4

    - #### LZW

          public static final CompressionType LZW

    - #### J2K

          public static final CompressionType J2K

    - #### J2K_LOSSY

          public static final CompressionType J2K_LOSSY

    - #### JPEG

          public static final CompressionType JPEG

  - ### Field Detail

    - #### code

          private int code

      Code for the compression.

    - #### compression

          private java.lang.String compression

      The compression used.

    - #### lookup

          private static final java.util.Map<java.lang.Integer,CompressionType> lookup

      Map used to retrieve the compression type corresponding to the code.

  - ### Method Detail

    - #### values

          public static CompressionType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (CompressionType c : CompressionType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static CompressionType valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### get

          public static CompressionType get(int code)

      Retrieves the compression by reverse lookup of its "code".
      Parameters:
        `code` - The code to look up.
      Returns:
        The `CompressionType` instance for the `code` or `null` if it does not exist.

    - #### getCode

          public int getCode()

      Implemented as specified by the `CodedEnum` I/F.
      Specified by:
        `getCode` in interface `loci.common.enumeration.CodedEnum`
      See Also:
        `CodedEnum.getCode()`

    - #### getCompression

          public java.lang.String getCompression()

      Returns the compression.
      Returns:
        See above.

    - #### get

          public static CompressionType get(Codec c)

      Look up the compression type by Codec instance.

Copyright © 2026 Open Microscopy Environment