java.lang.Object
java.lang.Enum<BlendMode>
technology.sola.engine.graphics.renderer.BlendMode
All Implemented Interfaces:
Serializable, Comparable<BlendMode>, Constable, BlendFunction

@NullMarked public enum BlendMode extends Enum<BlendMode> implements BlendFunction
BlendMode is an enum of several prebuilt BlendFunctions.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Random chance of using color of top pixel based on alpha as the probability.
    Takes the max value of each channel for the destination pixel; alpha, red, green, blue.
    Adds the top and bottom pixels together ignoring alpha.
    Transparent if alpha < 255 (bottom pixel used).
    Takes the RGB channel values from 0 to 1 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer.
    No blending happens.
    Blends top onto bottom based on alpha of top pixel.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    set(int[] pixels, int pixelIndex, Color color)
    Method called to set the color of the pixel at pixelIndex.
    static BlendMode
    Returns the enum constant of this class with the specified name.
    static BlendMode[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • NO_BLENDING

      public static final BlendMode NO_BLENDING
      No blending happens. Top pixel is used.
    • MASK

      public static final BlendMode MASK
      Transparent if alpha < 255 (bottom pixel used).
    • NORMAL

      public static final BlendMode NORMAL
      Blends top onto bottom based on alpha of top pixel.
    • DISSOLVE

      public static final BlendMode DISSOLVE
      Random chance of using color of top pixel based on alpha as the probability. An alpha of 127 would be a 50% chance of using the top pixel.
    • LINEAR_DODGE

      public static final BlendMode LINEAR_DODGE
      Adds the top and bottom pixels together ignoring alpha.
    • MULTIPLY

      public static final BlendMode MULTIPLY
      Takes the RGB channel values from 0 to 1 of each pixel in the top layer and multiples them with the values for the corresponding pixel from the bottom layer.
    • LIGHTEN

      public static final BlendMode LIGHTEN
      Takes the max value of each channel for the destination pixel; alpha, red, green, blue.
  • 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
    • set

      public void set(int[] pixels, int pixelIndex, Color color)
      Description copied from interface: BlendFunction
      Method called to set the color of the pixel at pixelIndex.
      Specified by:
      set in interface BlendFunction
      Parameters:
      pixels - the array of pixels
      pixelIndex - the index of the destination pixel to modify
      color - the Color of the top pixel being applied