Package ca.cgjennings.graphics.filters
Class AbstractTintingFilter
- java.lang.Object
-
- ca.cgjennings.graphics.filters.AbstractImageFilter
-
- ca.cgjennings.graphics.filters.AbstractPixelwiseFilter
-
- ca.cgjennings.graphics.filters.AbstractTintingFilter
-
- All Implemented Interfaces:
TintingFilter
,java.awt.image.BufferedImageOp
- Direct Known Subclasses:
ReplaceHueSaturationFilter
,TintOverlayFilter
public abstract class AbstractTintingFilter extends AbstractPixelwiseFilter implements TintingFilter
An abstract base class forTintingFilter
s.- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description AbstractTintingFilter()
AbstractTintingFilter(float hFactor, float sFactor, float bFactor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getBFactor()
Returns the brightness adjustment factor.float
getHFactor()
Returns the hue adjustment factor.float
getSFactor()
Returns the saturation adjustment factor.boolean
isIdentity()
Returnstrue
if applying this filter would have no effect.void
setBFactor(float bFactor)
void
setFactors(float h, float s, float b)
Sets the hue, saturation, and brightness factors to use for tinting.void
setHFactor(float hFactor)
void
setSFactor(float sFactor)
-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractPixelwiseFilter
filter, filter, filterPixel, filterPixels, workFactor
-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractImageFilter
clamp, clamp, clamp, clampBoth, createCompatibleDestImage, fA, fB, fG, fR, getARGB, getARGB, getARGBSynch, getBounds2D, getPoint2D, getRenderingHints, iA, iB, iG, iR, setARGB, setARGB, setARGBSynch
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.awt.image.BufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints
-
Methods inherited from interface ca.cgjennings.graphics.filters.TintingFilter
filter
-
-
-
-
Method Detail
-
getHFactor
public float getHFactor()
Description copied from interface:TintingFilter
Returns the hue adjustment factor.- Specified by:
getHFactor
in interfaceTintingFilter
- Returns:
- hue factor
-
getSFactor
public float getSFactor()
Description copied from interface:TintingFilter
Returns the saturation adjustment factor.- Specified by:
getSFactor
in interfaceTintingFilter
- Returns:
- saturation factor
-
getBFactor
public float getBFactor()
Description copied from interface:TintingFilter
Returns the brightness adjustment factor.- Specified by:
getBFactor
in interfaceTintingFilter
- Returns:
- brightness factor
-
setHFactor
public void setHFactor(float hFactor)
-
setSFactor
public void setSFactor(float sFactor)
-
setBFactor
public void setBFactor(float bFactor)
-
setFactors
public void setFactors(float h, float s, float b)
Sets the hue, saturation, and brightness factors to use for tinting.Implementation Note: if saturation or brightness are less than 0, they are clamped to 0. Values over 1 are not clamped. If your subclass requires that saturation or brightness are clamped at 1, override this method to do so, then call the super implementation.
- Specified by:
setFactors
in interfaceTintingFilter
- Parameters:
h
- the hue factors
- the saturation factorb
- the brightness factor
-
isIdentity
public boolean isIdentity()
Description copied from interface:TintingFilter
Returnstrue
if applying this filter would have no effect. This can be used as an optimization hint.- Specified by:
isIdentity
in interfaceTintingFilter
- Returns:
true
if a filtered image would not change
-
-