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.BufferedImageOp
An 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 aTintCache
to 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.BufferedImage
filter(java.awt.image.BufferedImage source, java.awt.image.BufferedImage dest)
Apply the filter tosource
, storing the result indest
.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
setFactors(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()
Returnstrue
if applying this filter would have no effect. This can be used as an optimization hint.- Returns:
true
if 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:
filter
in interfacejava.awt.image.BufferedImageOp
- Parameters:
source
- the source imagedest
- the destination image (may benull
)- Returns:
- the destination image
-
-