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 forTintingFilters.- 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 floatgetBFactor()Returns the brightness adjustment factor.floatgetHFactor()Returns the hue adjustment factor.floatgetSFactor()Returns the saturation adjustment factor.booleanisIdentity()Returnstrueif applying this filter would have no effect.voidsetBFactor(float bFactor)voidsetFactors(float h, float s, float b)Sets the hue, saturation, and brightness factors to use for tinting.voidsetHFactor(float hFactor)voidsetSFactor(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:TintingFilterReturns the hue adjustment factor.- Specified by:
getHFactorin interfaceTintingFilter- Returns:
- hue factor
-
getSFactor
public float getSFactor()
Description copied from interface:TintingFilterReturns the saturation adjustment factor.- Specified by:
getSFactorin interfaceTintingFilter- Returns:
- saturation factor
-
getBFactor
public float getBFactor()
Description copied from interface:TintingFilterReturns the brightness adjustment factor.- Specified by:
getBFactorin 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:
setFactorsin interfaceTintingFilter- Parameters:
h- the hue factors- the saturation factorb- the brightness factor
-
isIdentity
public boolean isIdentity()
Description copied from interface:TintingFilterReturnstrueif applying this filter would have no effect. This can be used as an optimization hint.- Specified by:
isIdentityin interfaceTintingFilter- Returns:
trueif a filtered image would not change
-
-