Top Description Inners Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics.blend

public Class BlendMode

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, org.apache.pdfbox.cos.COSArray, .COSBase, .COSName

Blend mode.
Author
Kühn & Weyh Software GmbH

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static interface

Field Summary

Modifier and TypeField and Description
private final BlendMode.BlendFunction
private static final Map<COSName, BlendMode>
private final BlendMode.BlendChannelFunction
public static final BlendMode
public static final BlendMode
public static final BlendMode
public static final BlendMode
public static final BlendMode
public static final BlendMode
public static final BlendMode
private static final BlendMode.BlendFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendFunction
fHue

Functions for the blend operation of non-separable blend modes

private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendChannelFunction
fNormal

Functions for the blend operation of separable blend modes

private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendFunction
private static final BlendMode.BlendChannelFunction
private static final BlendMode.BlendChannelFunction
public static final BlendMode
public static final BlendMode
HUE

Non-separable blend modes as defined in the PDF specification

private final boolean
public static final BlendMode
public static final BlendMode
public static final BlendMode
private final COSName
public static final BlendMode
NORMAL

Separable blend modes as defined in the PDF specification

public static final BlendMode
public static final BlendMode
public static final BlendMode
public static final BlendMode

Constructor Summary

AccessConstructor and Description
private
BlendMode(COSName
the corresponding COSName of the blend mode
name
,
BlendMode.BlendChannelFunction
the blend function for separable blend modes
blendChannel
,
BlendMode.BlendFunction
the blend function for non-separable blend modes
blend
)

Private constructor due to the limited set of possible blend modes.

Method Summary

Modifier and TypeMethod and Description
private static Map<COSName, BlendMode>
private static int
get255Value(float val)

public BlendMode.BlendChannelFunction

Returns:

the blend channel function
getBlendChannelFunction
()

Returns the blend channel function, only available for separable blend modes.

public BlendMode.BlendFunction

Returns:

the blend function
getBlendFunction
()

Returns the blend function, only available for non separable blend modes.

public COSName

Returns:

name of blend mode.
getCOSName
()

The blend mode name from the BM object.

public static BlendMode

Returns:

blending mode
getInstance
(COSBase
name or array
cosBlendMode
)

Determines the blend mode from the BM entry in the COS ExtGState.

private static void
getLuminosityRGB(float[] srcValues, float[] dstValues, float[] result)

private static void
getSaturationRGB(float[] srcValues, float[] dstValues, float[] result)

public boolean

Returns:

true for separable blend modes
isSeparableBlendMode
()

Determines if the blend mode is a separable blend mode.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blendback to summary
private final BlendMode.BlendFunction blend
BLEND_MODESback to summary
private static final Map<COSName, BlendMode> BLEND_MODES
blendChannelback to summary
private final BlendMode.BlendChannelFunction blendChannel
COLORback to summary
public static final BlendMode COLOR
COLOR_BURNback to summary
public static final BlendMode COLOR_BURN
COLOR_DODGEback to summary
public static final BlendMode COLOR_DODGE
COMPATIBLEback to summary
public static final BlendMode COMPATIBLE
DARKENback to summary
public static final BlendMode DARKEN
DIFFERENCEback to summary
public static final BlendMode DIFFERENCE
EXCLUSIONback to summary
public static final BlendMode EXCLUSION
fColorback to summary
private static final BlendMode.BlendFunction fColor
fColorBurnback to summary
private static final BlendMode.BlendChannelFunction fColorBurn
fColorDodgeback to summary
private static final BlendMode.BlendChannelFunction fColorDodge
fDarkenback to summary
private static final BlendMode.BlendChannelFunction fDarken
fDifferenceback to summary
private static final BlendMode.BlendChannelFunction fDifference
fExclusionback to summary
private static final BlendMode.BlendChannelFunction fExclusion
fHardLightback to summary
private static final BlendMode.BlendChannelFunction fHardLight
fHueback to summary
private static final BlendMode.BlendFunction fHue

Functions for the blend operation of non-separable blend modes

fLightenback to summary
private static final BlendMode.BlendChannelFunction fLighten
fLuminosityback to summary
private static final BlendMode.BlendFunction fLuminosity
fMultiplyback to summary
private static final BlendMode.BlendChannelFunction fMultiply
fNormalback to summary
private static final BlendMode.BlendChannelFunction fNormal

Functions for the blend operation of separable blend modes

fOverlayback to summary
private static final BlendMode.BlendChannelFunction fOverlay
fSaturationback to summary
private static final BlendMode.BlendFunction fSaturation
fScreenback to summary
private static final BlendMode.BlendChannelFunction fScreen
fSoftLightback to summary
private static final BlendMode.BlendChannelFunction fSoftLight
HARD_LIGHTback to summary
public static final BlendMode HARD_LIGHT
HUEback to summary
public static final BlendMode HUE

Non-separable blend modes as defined in the PDF specification

isSeparableback to summary
private final boolean isSeparable
LIGHTENback to summary
public static final BlendMode LIGHTEN
LUMINOSITYback to summary
public static final BlendMode LUMINOSITY
MULTIPLYback to summary
public static final BlendMode MULTIPLY
nameback to summary
private final COSName name
NORMALback to summary
public static final BlendMode NORMAL

Separable blend modes as defined in the PDF specification

OVERLAYback to summary
public static final BlendMode OVERLAY
SATURATIONback to summary
public static final BlendMode SATURATION
SCREENback to summary
public static final BlendMode SCREEN
SOFT_LIGHTback to summary
public static final BlendMode SOFT_LIGHT

Constructor Detail

BlendModeback to summary
private BlendMode(COSName name, BlendMode.BlendChannelFunction blendChannel, BlendMode.BlendFunction blend)

Private constructor due to the limited set of possible blend modes.

Parameters
name:COSName

the corresponding COSName of the blend mode

blendChannel:BlendMode.BlendChannelFunction

the blend function for separable blend modes

blend:BlendMode.BlendFunction

the blend function for non-separable blend modes

Method Detail

createBlendModeMapback to summary
private static Map<COSName, BlendMode> createBlendModeMap()
get255Valueback to summary
private static int get255Value(float val)
getBlendChannelFunctionback to summary
public BlendMode.BlendChannelFunction getBlendChannelFunction()

Returns the blend channel function, only available for separable blend modes.

Returns:BlendMode.BlendChannelFunction

the blend channel function

getBlendFunctionback to summary
public BlendMode.BlendFunction getBlendFunction()

Returns the blend function, only available for non separable blend modes.

Returns:BlendMode.BlendFunction

the blend function

getCOSNameback to summary
public COSName getCOSName()

The blend mode name from the BM object.

Returns:COSName

name of blend mode.

getInstanceback to summary
public static BlendMode getInstance(COSBase cosBlendMode)

Determines the blend mode from the BM entry in the COS ExtGState.

Parameters
cosBlendMode:COSBase

name or array

Returns:BlendMode

blending mode

getLuminosityRGBback to summary
private static void getLuminosityRGB(float[] srcValues, float[] dstValues, float[] result)
getSaturationRGBback to summary
private static void getSaturationRGB(float[] srcValues, float[] dstValues, float[] result)
isSeparableBlendModeback to summary
public boolean isSeparableBlendMode()

Determines if the blend mode is a separable blend mode.

Returns:boolean

true for separable blend modes

org.apache.pdfbox.pdmodel.graphics.blend back to summary

public Interface BlendMode.BlendChannelFunction

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public float

Returns:

the function result
blendChannel
(float
the source value
src
,
float
the destination value
dest
)

BlendChannel function for separable blend modes.

Method Detail

blendChannelback to summary
public float blendChannel(float src, float dest)

BlendChannel function for separable blend modes.

Parameters
src:float

the source value

dest:float

the destination value

Returns:float

the function result

org.apache.pdfbox.pdmodel.graphics.blend back to summary

public Interface BlendMode.BlendFunction

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
blend(float[]
the source values
src
,
float[]
the destination values
dest
,
float[]
the function result values
result
)

Blend function for non separable blend modes.

Method Detail

blendback to summary
public void blend(float[] src, float[] dest, float[] result)

Blend function for non separable blend modes.

Parameters
src:float[]

the source values

dest:float[]

the destination values

result:float[]

the function result values