Enum ColorAlphaType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ColorAlphaType>

    public enum ColorAlphaType
    extends java.lang.Enum<ColorAlphaType>

    Describes how to interpret the alpha component of a pixel. A pixel may be opaque, or alpha, describing multiple levels of transparency.

    In simple blending, alpha weights the draw color and the destination color to create a new color. If alpha describes a weight from zero to one:

    new color = draw color * alpha + destination color * (1 - alpha)

    In practice alpha is encoded in two or more bits, where 1.0 equals all bits set.

    RGB may have alpha included in each component value; the stored value is the original RGB multiplied by alpha. Premultiplied color components improve performance.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      OPAQUE
      pixel is opaque
      PREMUL
      pixel components are premultiplied by alpha
      UNKNOWN
      uninitialized
      UNPREMUL
      pixel components are independent of alpha
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ColorAlphaType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ColorAlphaType[] 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

      • PREMUL

        public static final ColorAlphaType PREMUL
        pixel components are premultiplied by alpha
      • UNPREMUL

        public static final ColorAlphaType UNPREMUL
        pixel components are independent of alpha
    • Method Detail

      • values

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

        public static ColorAlphaType 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