Package org.apache.batik.ext.awt.image
Class CompositeRule
- java.lang.Object
-
- org.apache.batik.ext.awt.image.CompositeRule
-
- All Implemented Interfaces:
java.io.Serializable
public final class CompositeRule extends java.lang.Object implements java.io.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static CompositeRule
ATOP
Porter-Duff Source Atop Destination rule.static CompositeRule
DARKEN
FeBlend Darken rule.static CompositeRule
IN
Porter-Duff Source In Destination rule.private float
k1
private float
k2
private float
k3
private float
k4
static CompositeRule
LIGHTEN
FeBlend Lighten rule.static CompositeRule
MULTIPLY
FeBlend Multiply rule.static CompositeRule
OUT
Porter-Duff Source Out Destination rule.static CompositeRule
OVER
Porter-Duff Source Over Destination rule.private int
rule
The composite rule for this object.static int
RULE_ARITHMETIC
Arithmatic rule 'out = k1*i1*i2 + k2*i1 + k3*i2 + k4'.static int
RULE_ATOP
Porter-Duff src atop rule.static int
RULE_DARKEN
SVG feBlend Darken rulestatic int
RULE_IN
Porter-Duff src in rule.static int
RULE_LIGHTEN
SVG feBlend Lighten rulestatic int
RULE_MULTIPLY
SVG feBlend Multiply rulestatic int
RULE_OUT
Porter-Duff src out rule.static int
RULE_OVER
Porter-Duff src over rule, also used for feBlendnormal
.static int
RULE_SCREEN
SVG feBlend Screen rulestatic int
RULE_XOR
Porter-Duff src xor rule.static CompositeRule
SCREEN
FeBlend Screen rule.static CompositeRule
XOR
Xor rule.
-
Constructor Summary
Constructors Modifier Constructor Description private
CompositeRule(float k1, float k2, float k3, float k4)
private
CompositeRule(int rule)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompositeRule
ARITHMETIC(float k1, float k2, float k3, float k4)
Factory to create artithmatic CompositeRules.float[]
getCoefficients()
int
getRule()
Returns the type of this composite ruleprivate java.lang.Object
readResolve()
This is called by the serialization code before it returns an unserialized object.java.lang.String
toString()
This is called by the serialization code before it returns an unserialized object.
-
-
-
Field Detail
-
RULE_OVER
public static final int RULE_OVER
Porter-Duff src over rule, also used for feBlendnormal
.- See Also:
- Constant Field Values
-
RULE_IN
public static final int RULE_IN
Porter-Duff src in rule.- See Also:
- Constant Field Values
-
RULE_OUT
public static final int RULE_OUT
Porter-Duff src out rule.- See Also:
- Constant Field Values
-
RULE_ATOP
public static final int RULE_ATOP
Porter-Duff src atop rule.- See Also:
- Constant Field Values
-
RULE_XOR
public static final int RULE_XOR
Porter-Duff src xor rule.- See Also:
- Constant Field Values
-
RULE_ARITHMETIC
public static final int RULE_ARITHMETIC
Arithmatic rule 'out = k1*i1*i2 + k2*i1 + k3*i2 + k4'.- See Also:
- Constant Field Values
-
RULE_MULTIPLY
public static final int RULE_MULTIPLY
SVG feBlend Multiply rule- See Also:
- Constant Field Values
-
RULE_SCREEN
public static final int RULE_SCREEN
SVG feBlend Screen rule- See Also:
- Constant Field Values
-
RULE_DARKEN
public static final int RULE_DARKEN
SVG feBlend Darken rule- See Also:
- Constant Field Values
-
RULE_LIGHTEN
public static final int RULE_LIGHTEN
SVG feBlend Lighten rule- See Also:
- Constant Field Values
-
OVER
public static final CompositeRule 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
public static final CompositeRule 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
public static final CompositeRule 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
public static final CompositeRule 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
public static final CompositeRule 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
public static final CompositeRule MULTIPLY
FeBlend Multiply rule.Cd = Cs*(1-Ad) + Cd*(1-As) + Cs*Cd Ad = 1 - (1-Ad)*(1-As)
-
SCREEN
public static final CompositeRule SCREEN
FeBlend Screen rule.Cd = Cs + Cd - Cs*Cd Ad = 1 - (1-Ad)*(1-As)
-
DARKEN
public static final CompositeRule DARKEN
FeBlend Darken rule.Cd = Min(Cs*(1-Ad) + Cd, Cd*(1-As) + Cs) Ad = 1 - (1-Ad)*(1-As)
-
LIGHTEN
public static final CompositeRule LIGHTEN
FeBlend Lighten rule.Cd = Max(Cs*(1-Ad) + Cd, Cd*(1-As) + Cs) Ad = 1 - (1-Ad)*(1-As)
-
rule
private int rule
The composite rule for this object.
-
k1
private float k1
-
k2
private float k2
-
k3
private float k3
-
k4
private float k4
-
-
Method Detail
-
ARITHMETIC
public static CompositeRule ARITHMETIC(float k1, float k2, float k3, float k4)
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
private java.lang.Object readResolve() throws java.io.ObjectStreamException
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:
java.io.ObjectStreamException
-
toString
public java.lang.String 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.- Overrides:
toString
in classjava.lang.Object
-
-