Qt Jambi Home

com.trolltech.qt.gui
Enum QPainter.CompositionMode

java.lang.Object
  extended by java.lang.Enum<QPainter.CompositionMode>
      extended by com.trolltech.qt.gui.QPainter.CompositionMode
All Implemented Interfaces:
QtEnumerator, java.io.Serializable, java.lang.Comparable<QPainter.CompositionMode>
Enclosing class:
QPainter

public static enum QPainter.CompositionMode
extends java.lang.Enum<QPainter.CompositionMode>
implements QtEnumerator

Defines the Porter-Duff rules for digital image compositing. Composition modes are used to specify how the pixels in one image, the source, are merged with the pixel in another image, the destination.

The most common type is SourceOver (often referred to as just alpha blending) where the source pixel is blended on top of the destination pixel in such a way that the alpha component of the source defines the translucency of the pixel.

When the paint device is a QImage, the image format must be set to Format_ARGB32Premultiplied or Format_ARGB32 for the composition modes to have any effect. For performance the premultiplied version is the preferred format.

When a composition mode is set it applies to all painting operator, pens, brushes, gradients and pixmap/image drawing.

See Also:
compositionMode, setCompositionMode, Modes, Composition Example

Enum Constant Summary
CompositionMode_Clear
          The pixels in the destination are cleared (set to fully transparent) independent of the source.
CompositionMode_ColorBurn
          The destination color is darkened to reflect the source color.
CompositionMode_ColorDodge
          The destination color is brightened to reflect the source color.
CompositionMode_Darken
          The darker of the source and destination colors is selected.
CompositionMode_Destination
          The output is the destination pixel.
CompositionMode_DestinationAtop
          The destination pixel is blended on top of the source, with the alpha of the destination pixel is reduced by the alpha of the destination pixel.
CompositionMode_DestinationIn
          The output is the destination, where the alpha is reduced by that of the source.
CompositionMode_DestinationOut
          The output is the destination, where the alpha is reduced by the inverse of the source.
CompositionMode_DestinationOver
          The alpha of the destination is used to blend it on top of the source pixels.
CompositionMode_Difference
          Subtracts the darker of the colors from the lighter.
CompositionMode_Exclusion
          Similar to CompositionMode_Difference, but with a lower contrast.
CompositionMode_HardLight
          Multiplies or screens the colors depending on the source color.
CompositionMode_Lighten
          The lighter of the source and destination colors is selected.
CompositionMode_Multiply
          The output is the source color multiplied by the destination.
CompositionMode_Overlay
          Multiplies or screens the colors depending on the destination color.
CompositionMode_Plus
          Both the alpha and color of the source and destination pixels are added together.
CompositionMode_Screen
          The source and destination colors are inverted and then multiplied.
CompositionMode_SoftLight
          Darkens or lightens the colors depending on the source color.
CompositionMode_Source
          The output is the source pixel.
CompositionMode_SourceAtop
          The source pixel is blended on top of the destination, with the alpha of the source pixel reduced by the alpha of the destination pixel.
CompositionMode_SourceIn
          The output is the source, where the alpha is reduced by that of the destination.
CompositionMode_SourceOut
          The output is the source, where the alpha is reduced by the inverse of destination.
CompositionMode_SourceOver
          This is the default mode.
CompositionMode_Xor
          The source, whose alpha is reduced with the inverse of the destination alpha, is merged with the destination, whose alpha is reduced by the inverse of the source alpha.
 
Method Summary
static QPainter.CompositionMode resolve(int value)
           
 int value()
          This function should return an integer value for the enum values of the enumeration that implements this interface.
static QPainter.CompositionMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static QPainter.CompositionMode[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CompositionMode_SourceOver

public static final QPainter.CompositionMode CompositionMode_SourceOver

This is the default mode. The alpha of the source is used to blend the pixel on top of the destination.


CompositionMode_DestinationOver

public static final QPainter.CompositionMode CompositionMode_DestinationOver

The alpha of the destination is used to blend it on top of the source pixels. This mode is the inverse of CompositionMode_SourceOver.


CompositionMode_Clear

public static final QPainter.CompositionMode CompositionMode_Clear

The pixels in the destination are cleared (set to fully transparent) independent of the source.


CompositionMode_Source

public static final QPainter.CompositionMode CompositionMode_Source

The output is the source pixel. (This means a basic copy operation and is identical to SourceOver when the source pixel is opaque).


CompositionMode_Destination

public static final QPainter.CompositionMode CompositionMode_Destination

The output is the destination pixel. This means that the blending has no effect. This mode is the inverse of CompositionMode_Source.


CompositionMode_SourceIn

public static final QPainter.CompositionMode CompositionMode_SourceIn

The output is the source, where the alpha is reduced by that of the destination.


CompositionMode_DestinationIn

public static final QPainter.CompositionMode CompositionMode_DestinationIn

The output is the destination, where the alpha is reduced by that of the source. This mode is the inverse of CompositionMode_SourceIn.


CompositionMode_SourceOut

public static final QPainter.CompositionMode CompositionMode_SourceOut

The output is the source, where the alpha is reduced by the inverse of destination.


CompositionMode_DestinationOut

public static final QPainter.CompositionMode CompositionMode_DestinationOut

The output is the destination, where the alpha is reduced by the inverse of the source. This mode is the inverse of CompositionMode_SourceOut.


CompositionMode_SourceAtop

public static final QPainter.CompositionMode CompositionMode_SourceAtop

The source pixel is blended on top of the destination, with the alpha of the source pixel reduced by the alpha of the destination pixel.


CompositionMode_DestinationAtop

public static final QPainter.CompositionMode CompositionMode_DestinationAtop

The destination pixel is blended on top of the source, with the alpha of the destination pixel is reduced by the alpha of the destination pixel. This mode is the inverse of CompositionMode_SourceAtop.


CompositionMode_Xor

public static final QPainter.CompositionMode CompositionMode_Xor

The source, whose alpha is reduced with the inverse of the destination alpha, is merged with the destination, whose alpha is reduced by the inverse of the source alpha. CompositionMode_Xor is not the same as the bitwise Xor.


CompositionMode_Plus

public static final QPainter.CompositionMode CompositionMode_Plus

Both the alpha and color of the source and destination pixels are added together.


CompositionMode_Multiply

public static final QPainter.CompositionMode CompositionMode_Multiply

The output is the source color multiplied by the destination. Multiplying a color with white leaves the color unchanged, while multiplying a color with black produces black.


CompositionMode_Screen

public static final QPainter.CompositionMode CompositionMode_Screen

The source and destination colors are inverted and then multiplied. Screening a color with white produces white, whereas screening a color with black leaves the color unchanged.


CompositionMode_Overlay

public static final QPainter.CompositionMode CompositionMode_Overlay

Multiplies or screens the colors depending on the destination color. The destination color is mixed with the source color to reflect the lightness or darkness of the destination.


CompositionMode_Darken

public static final QPainter.CompositionMode CompositionMode_Darken

The darker of the source and destination colors is selected.


CompositionMode_Lighten

public static final QPainter.CompositionMode CompositionMode_Lighten

The lighter of the source and destination colors is selected.


CompositionMode_ColorDodge

public static final QPainter.CompositionMode CompositionMode_ColorDodge

The destination color is brightened to reflect the source color. A black source color leaves the destination color unchanged.


CompositionMode_ColorBurn

public static final QPainter.CompositionMode CompositionMode_ColorBurn

The destination color is darkened to reflect the source color. A white source color leaves the destination color unchanged.


CompositionMode_HardLight

public static final QPainter.CompositionMode CompositionMode_HardLight

Multiplies or screens the colors depending on the source color. A light source color will lighten the destination color, whereas a dark source color will darken the destination color.


CompositionMode_SoftLight

public static final QPainter.CompositionMode CompositionMode_SoftLight

Darkens or lightens the colors depending on the source color. Similar to CompositionMode_HardLight.


CompositionMode_Difference

public static final QPainter.CompositionMode CompositionMode_Difference

Subtracts the darker of the colors from the lighter. Painting with white inverts the destination color, whereas painting with black leaves the destination color unchanged.


CompositionMode_Exclusion

public static final QPainter.CompositionMode CompositionMode_Exclusion

Similar to CompositionMode_Difference, but with a lower contrast. Painting with white inverts the destination color, whereas painting with black leaves the destination color unchanged.

Method Detail

values

public static final QPainter.CompositionMode[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(QPainter.CompositionMode c : QPainter.CompositionMode.values())
        System.out.println(c);

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

valueOf

public static QPainter.CompositionMode 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

value

public int value()
Description copied from interface: QtEnumerator
This function should return an integer value for the enum values of the enumeration that implements this interface.

Specified by:
value in interface QtEnumerator

resolve

public static QPainter.CompositionMode resolve(int value)

Qt Jambi Home