org.apache.poi.hwmf.record

## Enum HwmfBinaryRasterOp

- java.lang.Object
- - java.lang.Enum<HwmfBinaryRasterOp>
  - - org.apache.poi.hwmf.record.HwmfBinaryRasterOp

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<HwmfBinaryRasterOp>

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

  The BinaryRasterOperation Enumeration section lists the binary raster-operation codes. Rasteroperation codes define how metafile processing combines the bits from the selected pen with the bits in the destination bitmap. Each raster-operation code represents a Boolean operation in which the values of the pixels in the selected pen and the destination bitmap are combined. Following are the two operands used in these operations.

  Operand | Meaning
  --- | ---
  P | Selected pen
  D | Destination bitmap

  Following are the Boolean operators used in these operations.

  Operand | Meaning
  --- | ---
  a | Bitwise AND
  n | Bitwise NOT (inverse)
  o | Bitwise OR
  x | Bitwise exclusive OR (XOR)

  All Boolean operations are presented in reverse Polish notation. For example, the following operation replaces the values of the pixels in the destination bitmap with a combination of the pixel values of the pen and the selected brush: DPo. Each raster-operation code is a 32-bit integer whose high-order word is a Boolean operation index and whose low-order word is the operation code. The 16-bit operation index is a zero-extended, 8-bit value that represents all possible outcomes resulting from the Boolean operation on two parameters (in this case, the pen and destination values). For example, the operation indexes for the DPo and DPan operations are shown in the following list.

  P | D | DPo | DPan
  --- | --- | --- | ---
  0 | 0 | 0 | 1
  0 | 1 | 1 | 1
  1 | 0 | 1 | 1
  1 | 1 | 1 | 0

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `R2_BLACK` 0, Pixel is always 0
    `R2_COPYPEN` P, Pixel is the pen color.
    `R2_MASKNOTPEN` DPna, Pixel is a combination of the screen color and the inverse of the pen color.
    `R2_MASKPEN` DPa, Pixel is a combination of the colors common to both the pen and the screen.
    `R2_MASKPENNOT` PDna, Pixel is a combination of the colors common to both the pen and the inverse of the screen.
    `R2_MERGENOTPEN` DPno, Pixel is a combination of the colors common to both the screen and the inverse of the pen.
    `R2_MERGEPEN` DPo, Pixel is a combination of the pen color and the screen color.
    `R2_MERGEPENNOT` PDno, Pixel is a combination of the pen color and the inverse of the screen color.
    `R2_NOP` D, Pixel remains unchanged.
    `R2_NOT` Dn, Pixel is the inverse of the screen color.
    `R2_NOTCOPYPEN` Pn, Pixel is the inverse of the pen color.
    `R2_NOTMASKPEN` DPan, Pixel is the inverse of the R2_MASKPEN color.
    `R2_NOTMERGEPEN` DPon, Pixel is the inverse of the R2_MERGEPEN color.
    `R2_NOTXORPEN` DPxn, Pixel is the inverse of the R2_XORPEN color.
    `R2_WHITE` 1, Pixel is always 1
    `R2_XORPEN` DPx, Pixel is a combination of the colors in the pen or in the screen, but not in both.

  - ### Method Summary

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

    - #### R2_BLACK

          public static final HwmfBinaryRasterOp R2_BLACK

      0, Pixel is always 0

    - #### R2_NOTMERGEPEN

          public static final HwmfBinaryRasterOp R2_NOTMERGEPEN

      DPon, Pixel is the inverse of the R2_MERGEPEN color.

    - #### R2_MASKNOTPEN

          public static final HwmfBinaryRasterOp R2_MASKNOTPEN

      DPna, Pixel is a combination of the screen color and the inverse of the pen color.

    - #### R2_NOTCOPYPEN

          public static final HwmfBinaryRasterOp R2_NOTCOPYPEN

      Pn, Pixel is the inverse of the pen color.

    - #### R2_MASKPENNOT

          public static final HwmfBinaryRasterOp R2_MASKPENNOT

      PDna, Pixel is a combination of the colors common to both the pen and the inverse of the screen.

    - #### R2_NOT

          public static final HwmfBinaryRasterOp R2_NOT

      Dn, Pixel is the inverse of the screen color.

    - #### R2_XORPEN

          public static final HwmfBinaryRasterOp R2_XORPEN

      DPx, Pixel is a combination of the colors in the pen or in the screen, but not in both.

    - #### R2_NOTMASKPEN

          public static final HwmfBinaryRasterOp R2_NOTMASKPEN

      DPan, Pixel is the inverse of the R2_MASKPEN color.

    - #### R2_MASKPEN

          public static final HwmfBinaryRasterOp R2_MASKPEN

      DPa, Pixel is a combination of the colors common to both the pen and the screen.

    - #### R2_NOTXORPEN

          public static final HwmfBinaryRasterOp R2_NOTXORPEN

      DPxn, Pixel is the inverse of the R2_XORPEN color.

    - #### R2_NOP

          public static final HwmfBinaryRasterOp R2_NOP

      D, Pixel remains unchanged.

    - #### R2_MERGENOTPEN

          public static final HwmfBinaryRasterOp R2_MERGENOTPEN

      DPno, Pixel is a combination of the colors common to both the screen and the inverse of the pen.

    - #### R2_COPYPEN

          public static final HwmfBinaryRasterOp R2_COPYPEN

      P, Pixel is the pen color.

    - #### R2_MERGEPENNOT

          public static final HwmfBinaryRasterOp R2_MERGEPENNOT

      PDno, Pixel is a combination of the pen color and the inverse of the screen color.

    - #### R2_MERGEPEN

          public static final HwmfBinaryRasterOp R2_MERGEPEN

      DPo, Pixel is a combination of the pen color and the screen color.

    - #### R2_WHITE

          public static final HwmfBinaryRasterOp R2_WHITE

      1, Pixel is always 1

  - ### Method Detail

    - #### values

          public static HwmfBinaryRasterOp[] 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 (HwmfBinaryRasterOp c : HwmfBinaryRasterOp.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

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

    - #### valueOf

          public static HwmfBinaryRasterOp valueOf(int opIndex)

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.