Enum PixelType

  • All Implemented Interfaces:
    Serializable, Comparable<PixelType>

    public enum PixelType
    extends Enum<PixelType>
    Pixel formats the storage understands, and their mapping to Zarr dtypes.

    v1 supports single-component grayscale in 8-, 16- and 32-bit forms. RGB is not yet supported (see README); OME-NGFF has no canonical interleaved-RGB representation.

    • Enum Constant Detail

      • GRAY16

        public static final PixelType GRAY16
      • GRAY32

        public static final PixelType GRAY32
    • Method Detail

      • values

        public static PixelType[] 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 (PixelType c : PixelType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PixelType valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • zarrDtype

        public String zarrDtype()
      • bytesPerPixel

        public int bytesPerPixel()
      • numComponents

        public int numComponents()
      • bitDepth

        public int bitDepth()
      • of

        public static PixelType of​(boolean rgb,
                                   int bitDepth)
        Resolve a pixel type from the (rgb, bitDepth) pair used by the putImage API (which mirrors NDTiffStorage's signature).
        Parameters:
        rgb - whether the image has multiple colour components
        bitDepth - nominal bits per component (8, 16 or 32)
      • fromZarrDtype

        public static PixelType fromZarrDtype​(String dtype)
        Resolve a pixel type from a Zarr dtype string (e.g. "uint16").
        Throws:
        IllegalArgumentException - for dtypes this library cannot represent, rather than silently mis-reading the data
      • pixelCount

        public int pixelCount​(Object pixels)
        Number of pixels represented by a primitive pixel array of this type.