Package limn.graphics

Enum Class BlendMode

java.lang.Object
java.lang.Enum<BlendMode>
limn.graphics.BlendMode
All Implemented Interfaces:
Serializable, Comparable<BlendMode>, Constable

public enum BlendMode extends Enum<BlendMode>
How subsequent Canvas painting combines with what is already on the target. Part of the canvas state (Canvas.setBlendMode(limn.graphics.BlendMode)), so it is saved/restored with Canvas.save()/Canvas.restore() and applies to every primitive: shapes, text, images.

The pipeline is premultiplied-alpha end to end; each mode maps to a single fixed blend equation, and switching modes mid-frame is a batch break (one extra draw call), so group same-mode painting where possible.

  • Enum Constant Details

    • NORMAL

      public static final BlendMode NORMAL
      Source-over: ordinary painting, the default.
    • ADDITIVE

      public static final BlendMode ADDITIVE
      Additive: source adds to the destination, for light, glow, fire, laser and particle effects that brighten whatever they overlap. Black is neutral; overlapping strokes accumulate toward white.
    • MULTIPLY

      public static final BlendMode MULTIPLY
      Multiply: source darkens the destination, for shadows, vignettes, tint layers. White is neutral; overlapping strokes accumulate toward black.
  • Method Details

    • values

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

      public static BlendMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null