Package org.apache.batik.ext.awt.image
Class CompositeRule
java.lang.Object
org.apache.batik.ext.awt.image.CompositeRule
- All Implemented Interfaces:
Serializable
This is a typesafe enumeration of the standard Composite rules for
the CompositeRable operation. (over, in, out, atop, xor, arith)
- Version:
- $Id: CompositeRule.java 1808888 2017-09-19 14:22:11Z ssteiner $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CompositeRule
Porter-Duff Source Atop Destination rule.static final CompositeRule
FeBlend Darken rule.static final CompositeRule
Porter-Duff Source In Destination rule.private float
private float
private float
private float
static final CompositeRule
FeBlend Lighten rule.static final CompositeRule
FeBlend Multiply rule.static final CompositeRule
Porter-Duff Source Out Destination rule.static final CompositeRule
Porter-Duff Source Over Destination rule.private int
The composite rule for this object.static final int
Arithmatic rule 'out = k1*i1*i2 + k2*i1 + k3*i2 + k4'.static final int
Porter-Duff src atop rule.static final int
SVG feBlend Darken rulestatic final int
Porter-Duff src in rule.static final int
SVG feBlend Lighten rulestatic final int
SVG feBlend Multiply rulestatic final int
Porter-Duff src out rule.static final int
Porter-Duff src over rule, also used for feBlendnormal
.static final int
SVG feBlend Screen rulestatic final int
Porter-Duff src xor rule.static final CompositeRule
FeBlend Screen rule.static final CompositeRule
Xor rule. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CompositeRule
(float k1, float k2, float k3, float k4) private
CompositeRule
(int rule) -
Method Summary
Modifier and TypeMethodDescriptionstatic CompositeRule
ARITHMETIC
(float k1, float k2, float k3, float k4) Factory to create artithmatic CompositeRules.float[]
int
getRule()
Returns the type of this composite ruleprivate Object
This is called by the serialization code before it returns an unserialized object.toString()
This is called by the serialization code before it returns an unserialized object.
-
Field Details
-
RULE_OVER
public static final int RULE_OVERPorter-Duff src over rule, also used for feBlendnormal
.- See Also:
-
RULE_IN
public static final int RULE_INPorter-Duff src in rule.- See Also:
-
RULE_OUT
public static final int RULE_OUTPorter-Duff src out rule.- See Also:
-
RULE_ATOP
public static final int RULE_ATOPPorter-Duff src atop rule.- See Also:
-
RULE_XOR
public static final int RULE_XORPorter-Duff src xor rule.- See Also:
-
RULE_ARITHMETIC
public static final int RULE_ARITHMETICArithmatic rule 'out = k1*i1*i2 + k2*i1 + k3*i2 + k4'.- See Also:
-
RULE_MULTIPLY
public static final int RULE_MULTIPLYSVG feBlend Multiply rule- See Also:
-
RULE_SCREEN
public static final int RULE_SCREENSVG feBlend Screen rule- See Also:
-
RULE_DARKEN
public static final int RULE_DARKENSVG feBlend Darken rule- See Also:
-
RULE_LIGHTEN
public static final int RULE_LIGHTENSVG feBlend Lighten rule- See Also:
-
OVER
Porter-Duff Source Over Destination rule. The source is composited over the destination.Fs = 1 and Fd = (1-As), thus: Cd = Cs + Cd*(1-As) Ad = As + Ad*(1-As)
-
IN
Porter-Duff Source In Destination rule. The part of the source lying inside of the destination replaces the destination.Fs = Ad and Fd = 0, thus: Cd = Cs*Ad Ad = As*Ad
-
OUT
Porter-Duff Source Out Destination rule. The part of the source lying outside of the destination replaces the destination.Fs = (1-Ad) and Fd = 0, thus: Cd = Cs*(1-Ad) Ad = As*(1-Ad)
-
ATOP
Porter-Duff Source Atop Destination rule. The part of the source lying inside of the destination replaces the destination, destination remains outside of source.Fs = Ad and Fd = (1-As), thus: Cd = Cs*Ad + Cd*(1-As) Ad = As*Ad + Ad*(1-As)
-
XOR
Xor rule. The source and destination are Xor'ed togeather.Fs = (1-Ad) and Fd = (1-As), thus: Cd = Cs*(1-Ad) + Cd*(1-As) Ad = As*(1-Ad) + Ad*(1-As)
-
MULTIPLY
FeBlend Multiply rule.Cd = Cs*(1-Ad) + Cd*(1-As) + Cs*Cd Ad = 1 - (1-Ad)*(1-As)
-
SCREEN
FeBlend Screen rule.Cd = Cs + Cd - Cs*Cd Ad = 1 - (1-Ad)*(1-As)
-
DARKEN
FeBlend Darken rule.Cd = Min(Cs*(1-Ad) + Cd, Cd*(1-As) + Cs) Ad = 1 - (1-Ad)*(1-As)
-
LIGHTEN
FeBlend Lighten rule.Cd = Max(Cs*(1-Ad) + Cd, Cd*(1-As) + Cs) Ad = 1 - (1-Ad)*(1-As)
-
rule
private int ruleThe composite rule for this object. -
k1
private float k1 -
k2
private float k2 -
k3
private float k3 -
k4
private float k4
-
-
Constructor Details
-
CompositeRule
private CompositeRule(int rule) -
CompositeRule
private CompositeRule(float k1, float k2, float k3, float k4)
-
-
Method Details
-
ARITHMETIC
Factory to create artithmatic CompositeRules. 'out = k1*i1*i2 + k2*i1 + k3*i2 + k4' Note that arithmatic CompositeRules are not singletons. -
getRule
public int getRule()Returns the type of this composite rule -
getCoefficients
public float[] getCoefficients() -
readResolve
This is called by the serialization code before it returns an unserialized object. To provide for unicity of instances, the instance that was read is replaced by its static equivalent. See the serialiazation specification for further details on this method's logic.- Throws:
ObjectStreamException
-
toString
This is called by the serialization code before it returns an unserialized object. To provide for unicity of instances, the instance that was read is replaced by its static equivalent. See the serialiazation specification for further details on this method's logic.
-