Package org.micromanager.mmomezarr
Enum PixelType
- java.lang.Object
-
- java.lang.Enum<PixelType>
-
- org.micromanager.mmomezarr.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbitDepth()intbytesPerPixel()static PixelTypefromZarrDtype(String dtype)Resolve a pixel type from a Zarr dtype string (e.g.intnumComponents()static PixelTypeof(boolean rgb, int bitDepth)Resolve a pixel type from the(rgb, bitDepth)pair used by theputImageAPI (which mirrors NDTiffStorage's signature).intpixelCount(Object pixels)Number of pixels represented by a primitive pixel array of this type.static PixelTypevalueOf(String name)Returns the enum constant of this type with the specified name.static PixelType[]values()Returns an array containing the constants of this enum type, in the order they are declared.StringzarrDtype()
-
-
-
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 nameNullPointerException- 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 theputImageAPI (which mirrors NDTiffStorage's signature).- Parameters:
rgb- whether the image has multiple colour componentsbitDepth- 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.
-
-