Enum ImageUtil.BImageType
- java.lang.Object
-
- java.lang.Enum<ImageUtil.BImageType>
-
- dev.brachtendorf.graphics.ImageUtil.BImageType
-
- All Implemented Interfaces:
Serializable,Comparable<ImageUtil.BImageType>
- Enclosing class:
- ImageUtil
public static enum ImageUtil.BImageType extends Enum<ImageUtil.BImageType>
Buffered image types mapped to enum values for easier handling- Author:
- Kilian
-
-
Enum Constant Summary
Enum Constants Enum Constant Description TYPE_3BYTE_BGRRepresents an image with 8-bit RGB color components, corresponding to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes.TYPE_4BYTE_ABGRRepresents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.TYPE_4BYTE_ABGR_PRERepresents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha.TYPE_BYTE_BINARYRepresents an opaque byte-packed 1, 2, or 4 bit image.TYPE_BYTE_GRAYRepresents a unsigned byte grayscale image, non-indexed.TYPE_BYTE_INDEXEDRepresents an indexed byte image.TYPE_CUSTOMImage type is not recognized so it must be a customized image.TYPE_INT_ARGBRepresents an image with 8-bit RGBA color components packed into integer pixels.TYPE_INT_ARGB_PRERepresents an image with 8-bit RGBA color components packed into integer pixels.TYPE_INT_BGRRepresents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels.TYPE_INT_RGBRepresents an image with 8-bit RGB color components packed into integer pixels.TYPE_USHORT_555_RGBRepresents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha.TYPE_USHORT_565_RGBRepresents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha.TYPE_USHORT_GRAYRepresents an unsigned short grayscale image, non-indexed).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intget()static ImageUtil.BImageTypevalueOf(String name)Returns the enum constant of this type with the specified name.static ImageUtil.BImageType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TYPE_CUSTOM
public static final ImageUtil.BImageType TYPE_CUSTOM
Image type is not recognized so it must be a customized image. This type is only used as a return value for the getType() method.
-
TYPE_INT_RGB
public static final ImageUtil.BImageType TYPE_INT_RGB
Represents an image with 8-bit RGB color components packed into integer pixels. The image has aDirectColorModelwithout alpha. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in theAlphaCompositedocumentation.
-
TYPE_INT_ARGB
public static final ImageUtil.BImageType TYPE_INT_ARGB
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has aDirectColorModelwith alpha. The color data in this image is considered not to be premultiplied with alpha. When this type is used as theimageTypeargument to aBufferedImageconstructor, the created image is consistent with images created in the JDK1.1 and earlier releases.
-
TYPE_INT_ARGB_PRE
public static final ImageUtil.BImageType TYPE_INT_ARGB_PRE
Represents an image with 8-bit RGBA color components packed into integer pixels. The image has aDirectColorModelwith alpha. The color data in this image is considered to be premultiplied with alpha.
-
TYPE_INT_BGR
public static final ImageUtil.BImageType TYPE_INT_BGR
Represents an image with 8-bit RGB color components, corresponding to a Windows- or Solaris- style BGR color model, with the colors Blue, Green, and Red packed into integer pixels. There is no alpha. The image has aDirectColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in theAlphaCompositedocumentation.
-
TYPE_3BYTE_BGR
public static final ImageUtil.BImageType TYPE_3BYTE_BGR
Represents an image with 8-bit RGB color components, corresponding to a Windows-style BGR color model) with the colors Blue, Green, and Red stored in 3 bytes. There is no alpha. The image has aComponentColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in theAlphaCompositedocumentation.
-
TYPE_4BYTE_ABGR
public static final ImageUtil.BImageType TYPE_4BYTE_ABGR
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has aComponentColorModelwith alpha. The color data in this image is considered not to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.
-
TYPE_4BYTE_ABGR_PRE
public static final ImageUtil.BImageType TYPE_4BYTE_ABGR_PRE
Represents an image with 8-bit RGBA color components with the colors Blue, Green, and Red stored in 3 bytes and 1 byte of alpha. The image has aComponentColorModelwith alpha. The color data in this image is considered to be premultiplied with alpha. The byte data is interleaved in a single byte array in the order A, B, G, R from lower to higher byte addresses within each pixel.
-
TYPE_USHORT_565_RGB
public static final ImageUtil.BImageType TYPE_USHORT_565_RGB
Represents an image with 5-6-5 RGB color components (5-bits red, 6-bits green, 5-bits blue) with no alpha. This image has aDirectColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in theAlphaCompositedocumentation.
-
TYPE_USHORT_555_RGB
public static final ImageUtil.BImageType TYPE_USHORT_555_RGB
Represents an image with 5-5-5 RGB color components (5-bits red, 5-bits green, 5-bits blue) with no alpha. This image has aDirectColorModel. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in theAlphaCompositedocumentation.
-
TYPE_BYTE_GRAY
public static final ImageUtil.BImageType TYPE_BYTE_GRAY
Represents a unsigned byte grayscale image, non-indexed. This image has aComponentColorModelwith a CS_GRAYColorSpace. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in theAlphaCompositedocumentation.
-
TYPE_USHORT_GRAY
public static final ImageUtil.BImageType TYPE_USHORT_GRAY
Represents an unsigned short grayscale image, non-indexed). This image has aComponentColorModelwith a CS_GRAYColorSpace. When data with non-opaque alpha is stored in an image of this type, the color data must be adjusted to a non-premultiplied form and the alpha discarded, as described in theAlphaCompositedocumentation.
-
TYPE_BYTE_BINARY
public static final ImageUtil.BImageType TYPE_BYTE_BINARY
Represents an opaque byte-packed 1, 2, or 4 bit image. The image has anIndexColorModelwithout alpha. When this type is used as theimageTypeargument to theBufferedImageconstructor that takes animageTypeargument but noColorModelargument, a 1-bit image is created with anIndexColorModelwith two colors in the default sRGBColorSpace: {0, 0, 0} and {255, 255, 255}.Images with 2 or 4 bits per pixel may be constructed via the
BufferedImageconstructor that takes aColorModelargument by supplying aColorModelwith an appropriate map size.Images with 8 bits per pixel should use the image types
TYPE_BYTE_INDEXEDorTYPE_BYTE_GRAYdepending on theirColorModel.When color data is stored in an image of this type, the closest color in the colormap is determined by the
IndexColorModeland the resulting index is stored. Approximation and loss of alpha or color components can result, depending on the colors in theIndexColorModelcolormap.
-
TYPE_BYTE_INDEXED
public static final ImageUtil.BImageType TYPE_BYTE_INDEXED
Represents an indexed byte image. When this type is used as theimageTypeargument to theBufferedImageconstructor that takes animageTypeargument but noColorModelargument, anIndexColorModelis created with a 256-color 6/6/6 color cube palette with the rest of the colors from 216-255 populated by grayscale values in the default sRGB ColorSpace.When color data is stored in an image of this type, the closest color in the colormap is determined by the
IndexColorModeland the resulting index is stored. Approximation and loss of alpha or color components can result, depending on the colors in theIndexColorModelcolormap.
-
-
Method Detail
-
values
public static ImageUtil.BImageType[] 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 (ImageUtil.BImageType c : ImageUtil.BImageType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ImageUtil.BImageType 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
-
get
public int get()
-
-