Enum ColorModelType

java.lang.Object
java.lang.Enum<ColorModelType>
org.apache.sis.internal.coverage.j2d.ColorModelType
All Implemented Interfaces:
Serializable, Comparable<ColorModelType>, java.lang.constant.Constable

public enum ColorModelType extends Enum<ColorModelType>
Information about the color model. This enumeration provides an easier way of determining whether the color ramp can be replaced, and whether it should be replaced for performance reasons.
Since:
1.1
Version:
1.3
  • Enum Constant Details

    • DIRECT

      public static final ColorModelType DIRECT
      Color model uses directly RGB colors. This model is efficient and should not be changed. Color palette cannot be changed.
    • INDEXED

      public static final ColorModelType INDEXED
      Color model uses indexed colors. This model is efficient and does not need to be changed. Color palette can be changed.
    • SCALED

      public static final ColorModelType SCALED
      Color model uses colors computed on the fly from floating point values. This model is inefficient and should be changed if possible.
    • OTHER

      public static final ColorModelType OTHER
      Unrecognized color model. Includes the case where the color model is null. Must be flagged as "slow" for forcing the creation of a new color model.
  • Field Details

    • useColorRamp

      public final boolean useColorRamp
      Whether the color model uses a color palette. A true value implies that the color ramp is replaceable.
    • isSlow

      public final boolean isSlow
      Whether rendering with this color model is slow. In such case, the color model may need to be changed using Colorizer.
  • Constructor Details

    • ColorModelType

      private ColorModelType(boolean useColorRamp, boolean isSlow)
      Creates a new enumeration value.
  • Method Details

    • values

      public static ColorModelType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ColorModelType 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
    • find

      public static ColorModelType find(ColorModel model)
      Gets the type of given color model.
      Parameters:
      model - the color model (may be null).
      Returns:
      type of given color model (never null).