Class BlendMode
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.blend.BlendMode
-
public class BlendMode extends java.lang.ObjectBlend mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBlendMode.BlendChannelFunctionstatic interfaceBlendMode.BlendFunction
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description privateBlendMode(COSName name, BlendMode.BlendChannelFunction blendChannel, BlendMode.BlendFunction blend)Private constructor due to the limited set of possible blend modes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.util.Map<COSName,BlendMode>createBlendModeMap()private static intget255Value(float val)BlendMode.BlendChannelFunctiongetBlendChannelFunction()Returns the blend channel function, only available for separable blend modes.BlendMode.BlendFunctiongetBlendFunction()Returns the blend function, only available for non separable blend modes.COSNamegetCOSName()The blend mode name from the BM object.static BlendModegetInstance(COSBase cosBlendMode)Determines the blend mode from the BM entry in the COS ExtGState.private static voidgetLuminosityRGB(float[] srcValues, float[] dstValues, float[] result)private static voidgetSaturationRGB(float[] srcValues, float[] dstValues, float[] result)booleanisSeparableBlendMode()Determines if the blend mode is a separable blend mode.java.lang.StringtoString()
-
-
-
Field Detail
-
fNormal
private static final BlendMode.BlendChannelFunction fNormal
Functions for the blend operation of separable blend modes
-
fMultiply
private static final BlendMode.BlendChannelFunction fMultiply
-
fScreen
private static final BlendMode.BlendChannelFunction fScreen
-
fOverlay
private static final BlendMode.BlendChannelFunction fOverlay
-
fDarken
private static final BlendMode.BlendChannelFunction fDarken
-
fLighten
private static final BlendMode.BlendChannelFunction fLighten
-
fColorDodge
private static final BlendMode.BlendChannelFunction fColorDodge
-
fColorBurn
private static final BlendMode.BlendChannelFunction fColorBurn
-
fHardLight
private static final BlendMode.BlendChannelFunction fHardLight
-
fSoftLight
private static final BlendMode.BlendChannelFunction fSoftLight
-
fDifference
private static final BlendMode.BlendChannelFunction fDifference
-
fExclusion
private static final BlendMode.BlendChannelFunction fExclusion
-
fHue
private static final BlendMode.BlendFunction fHue
Functions for the blend operation of non-separable blend modes
-
fSaturation
private static final BlendMode.BlendFunction fSaturation
-
fColor
private static final BlendMode.BlendFunction fColor
-
fLuminosity
private static final BlendMode.BlendFunction fLuminosity
-
NORMAL
public static final BlendMode NORMAL
Separable blend modes as defined in the PDF specification
-
COMPATIBLE
public static final BlendMode COMPATIBLE
-
MULTIPLY
public static final BlendMode MULTIPLY
-
SCREEN
public static final BlendMode SCREEN
-
OVERLAY
public static final BlendMode OVERLAY
-
DARKEN
public static final BlendMode DARKEN
-
LIGHTEN
public static final BlendMode LIGHTEN
-
COLOR_DODGE
public static final BlendMode COLOR_DODGE
-
COLOR_BURN
public static final BlendMode COLOR_BURN
-
HARD_LIGHT
public static final BlendMode HARD_LIGHT
-
SOFT_LIGHT
public static final BlendMode SOFT_LIGHT
-
DIFFERENCE
public static final BlendMode DIFFERENCE
-
EXCLUSION
public static final BlendMode EXCLUSION
-
HUE
public static final BlendMode HUE
Non-separable blend modes as defined in the PDF specification
-
SATURATION
public static final BlendMode SATURATION
-
COLOR
public static final BlendMode COLOR
-
LUMINOSITY
public static final BlendMode LUMINOSITY
-
name
private final COSName name
-
blendChannel
private final BlendMode.BlendChannelFunction blendChannel
-
blend
private final BlendMode.BlendFunction blend
-
isSeparable
private final boolean isSeparable
-
-
Constructor Detail
-
BlendMode
private BlendMode(COSName name, BlendMode.BlendChannelFunction blendChannel, BlendMode.BlendFunction blend)
Private constructor due to the limited set of possible blend modes.- Parameters:
name- the corresponding COSName of the blend modeblendChannel- the blend function for separable blend modesblend- the blend function for non-separable blend modes
-
-
Method Detail
-
getCOSName
public COSName getCOSName()
The blend mode name from the BM object.- Returns:
- name of blend mode.
-
isSeparableBlendMode
public boolean isSeparableBlendMode()
Determines if the blend mode is a separable blend mode.- Returns:
- true for separable blend modes
-
getBlendChannelFunction
public BlendMode.BlendChannelFunction getBlendChannelFunction()
Returns the blend channel function, only available for separable blend modes.- Returns:
- the blend channel function
-
getBlendFunction
public BlendMode.BlendFunction getBlendFunction()
Returns the blend function, only available for non separable blend modes.- Returns:
- the blend function
-
getInstance
public static BlendMode getInstance(COSBase cosBlendMode)
Determines the blend mode from the BM entry in the COS ExtGState.- Parameters:
cosBlendMode- name or array- Returns:
- blending mode
-
get255Value
private static int get255Value(float val)
-
getSaturationRGB
private static void getSaturationRGB(float[] srcValues, float[] dstValues, float[] result)
-
getLuminosityRGB
private static void getLuminosityRGB(float[] srcValues, float[] dstValues, float[] result)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-