|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<QPainter.CompositionMode>
com.trolltech.qt.gui.QPainter.CompositionMode
public static enum QPainter.CompositionMode
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.
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 |
---|
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.
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.
public static final QPainter.CompositionMode CompositionMode_Clear
The pixels in the destination are cleared (set to fully transparent) independent of the 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).
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.
public static final QPainter.CompositionMode CompositionMode_SourceIn
The output is the source, where the alpha is reduced by that of the destination.
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.
public static final QPainter.CompositionMode CompositionMode_SourceOut
The output is the source, where the alpha is reduced by the inverse of destination.
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.
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.
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.
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.
public static final QPainter.CompositionMode CompositionMode_Plus
Both the alpha and color of the source and destination pixels are added together.
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.
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.
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.
public static final QPainter.CompositionMode CompositionMode_Darken
The darker of the source and destination colors is selected.
public static final QPainter.CompositionMode CompositionMode_Lighten
The lighter of the source and destination colors is selected.
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.
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.
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.
public static final QPainter.CompositionMode CompositionMode_SoftLight
Darkens or lightens the colors depending on the source color. Similar to CompositionMode_HardLight.
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.
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 |
---|
public static final QPainter.CompositionMode[] values()
for(QPainter.CompositionMode c : QPainter.CompositionMode.values()) System.out.println(c);
public static QPainter.CompositionMode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namepublic int value()
QtEnumerator
value
in interface QtEnumerator
public static QPainter.CompositionMode resolve(int value)
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |