Package ca.cgjennings.graphics.filters
Interface TintingFilter
-
- All Superinterfaces:
java.awt.image.BufferedImageOp
- All Known Implementing Classes:
AbstractTintingFilter,ReplaceHueSaturationFilter,ShiftHReplaceSBFilter,TintFilter,TintFilter.ScaledTintFilter,TintOverlayFilter
public interface TintingFilter extends java.awt.image.BufferedImageOpAn interface implemented by filters that filter an image by adjusting them in the HSB colour space. Classes that implement this interface can be used with aTintCacheto optimize performance when a tinted image is drawn repeatedly with infrequent factor changes.- Author:
- Chris Jennings
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage source, java.awt.image.BufferedImage dest)Apply the filter tosource, storing the result indest.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.voidsetFactors(float h, float s, float b)Sets the factors that will be used during tinting.
-
-
-
Method Detail
-
getHFactor
float getHFactor()
Returns the hue adjustment factor.- Returns:
- hue factor
-
getSFactor
float getSFactor()
Returns the saturation adjustment factor.- Returns:
- saturation factor
-
getBFactor
float getBFactor()
Returns the brightness adjustment factor.- Returns:
- brightness factor
-
setFactors
void setFactors(float h, float s, float b)Sets the factors that will be used during tinting. The exact effect depends on the particular filter.- Parameters:
h- hue factors- saturation factorb- brightness factor
-
isIdentity
boolean isIdentity()
Returnstrueif applying this filter would have no effect. This can be used as an optimization hint.- Returns:
trueif a filtered image would not change
-
filter
java.awt.image.BufferedImage filter(java.awt.image.BufferedImage source, java.awt.image.BufferedImage dest)Apply the filter tosource, storing the result indest.- Specified by:
filterin interfacejava.awt.image.BufferedImageOp- Parameters:
source- the source imagedest- the destination image (may benull)- Returns:
- the destination image
-
-