Package ca.cgjennings.apps.arkham.sheet
Class ShiftHReplaceSBFilter
- java.lang.Object
-
- ca.cgjennings.graphics.filters.AbstractImageFilter
-
- ca.cgjennings.graphics.filters.AbstractPixelwiseFilter
-
- ca.cgjennings.graphics.filters.AbstractTintingFilter
-
- ca.cgjennings.graphics.filters.TintOverlayFilter
-
- ca.cgjennings.graphics.filters.TintFilter
-
- ca.cgjennings.apps.arkham.sheet.ShiftHReplaceSBFilter
-
- All Implemented Interfaces:
TintingFilter
,java.awt.image.BufferedImageOp
public class ShiftHReplaceSBFilter extends TintFilter
This filter shifts the hue of each pixel by a fixed amount, sets the saturation to a fixed value, and scales the brightness. An optional brightness adjustment factor allows compensation for darker images to allow a greater dynamic range.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ca.cgjennings.graphics.filters.TintFilter
TintFilter.ScaledTintFilter
-
-
Field Summary
-
Fields inherited from class ca.cgjennings.graphics.filters.AbstractTintingFilter
bFactor, hFactor, sFactor
-
-
Constructor Summary
Constructors Constructor Description ShiftHReplaceSBFilter()
ShiftHReplaceSBFilter(float h, float s, float b)
-
Method Summary
All Methods Instance Methods Concrete 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
.void
filterPixels(int[] argb, int start, int end)
This method is called with a block of ARGB values to be filtered.float
getBrightAdjust()
void
setBrightAdjust(float bAdjust)
void
setFactors(float h, float s, float b)
Sets the hue, saturation, and brightness factors to use for tinting.-
Methods inherited from class ca.cgjennings.graphics.filters.TintFilter
adjustColor, isIdentity
-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractTintingFilter
getBFactor, getHFactor, getSFactor, setBFactor, setHFactor, setSFactor
-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractPixelwiseFilter
filter, filterPixel, 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
-
-
-
-
Method Detail
-
setFactors
public void setFactors(float h, float s, float b)
Description copied from class:AbstractTintingFilter
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
- Overrides:
setFactors
in classTintFilter
- Parameters:
h
- the hue factors
- the saturation factorb
- the brightness factor
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage source, java.awt.image.BufferedImage dest)
Description copied from interface:TintingFilter
Apply the filter tosource
, storing the result indest
.- Specified by:
filter
in interfacejava.awt.image.BufferedImageOp
- Specified by:
filter
in interfaceTintingFilter
- Overrides:
filter
in classAbstractPixelwiseFilter
- Parameters:
source
- the source imagedest
- the destination image (may benull
)- Returns:
- the destination image
-
filterPixels
public void filterPixels(int[] argb, int start, int end)
Description copied from class:AbstractPixelwiseFilter
This method is called with a block of ARGB values to be filtered. Subclasses must override this method to implement the actual filtering algorithm by replacing each pixel value in the rangeargb[start] ... argb[end-1]
with the filtered value.- Overrides:
filterPixels
in classTintFilter
- Parameters:
argb
- an array of pixel data to filterstart
- the index of the first pixel to filterend
- the index of the last pixel to filter, plus one
-
getBrightAdjust
public float getBrightAdjust()
-
setBrightAdjust
public void setBrightAdjust(float bAdjust)
-
-