Package playn.core

Enum Class Canvas.Composite

java.lang.Object
java.lang.Enum<Canvas.Composite>
playn.core.Canvas.Composite
All Implemented Interfaces:
Serializable, Comparable<Canvas.Composite>, java.lang.constant.Constable
Enclosing class:
Canvas

public static enum Canvas.Composite extends Enum<Canvas.Composite>
Values that may be used with Canvas.setCompositeOperation(Composite).
  • Enum Constant Details

    • SRC

      public static final Canvas.Composite SRC
      A (B is ignored). Display the source image instead of the destination image. [Sa, Sc]
    • DST_ATOP

      public static final Canvas.Composite DST_ATOP
      B atop A. Same as source-atop but using the destination image instead of the source image and vice versa. [Sa, Sa * Dc + Sc * (1 - Da)].
    • SRC_OVER

      public static final Canvas.Composite SRC_OVER
      A over B. Display the source image wherever the source image is opaque. Display the destination image elsewhere. [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc].
    • DST_OVER

      public static final Canvas.Composite DST_OVER
      B over A. Same as source-over but using the destination image instead of the source image and vice versa. [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc].
    • SRC_IN

      public static final Canvas.Composite SRC_IN
      A in B. Display the source image wherever both the source image and destination image are opaque. Display transparency elsewhere. [Sa * Da, Sc * Da].
    • DST_IN

      public static final Canvas.Composite DST_IN
      B in A. Same as source-in but using the destination image instead of the source image and vice versa. [Sa * Da, Sa * Dc].
    • SRC_OUT

      public static final Canvas.Composite SRC_OUT
      A out B. Display the source image wherever the source image is opaque and the destination image is transparent. Display transparency elsewhere. [Sa * (1 - Da), Sc * (1 - Da)].
    • DST_OUT

      public static final Canvas.Composite DST_OUT
      B out A. Same as source-out but using the destination image instead of the source image and vice versa. [Da * (1 - Sa), Dc * (1 - Sa)].
    • SRC_ATOP

      public static final Canvas.Composite SRC_ATOP
      A atop B. Display the source image wherever both images are opaque. Display the destination image wherever the destination image is opaque but the source image is transparent. Display transparency elsewhere. [Da, Sc * Da + (1 - Sa) * Dc].
    • XOR

      public static final Canvas.Composite XOR
      A xor B. Exclusive OR of the source image and destination image. [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc].
    • MULTIPLY

      public static final Canvas.Composite MULTIPLY
      A * B. Multiplies the source and destination images. NOTE: this is not supported by the HTML5 and Flash backends. [Sa * Da, Sc * Dc].
  • Method Details

    • values

      public static Canvas.Composite[] 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 Canvas.Composite 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