Catalano.Imaging.Concurrent.Filters
Class HSLFiltering
- java.lang.Object
-
- Catalano.Imaging.Concurrent.Filters.HSLFiltering
-
- All Implemented Interfaces:
- IApplyInPlace
public class HSLFiltering extends java.lang.Object implements IApplyInPlace
Color filtering in HSL color space.The filter operates in HSL color space and filters pixels, which color is inside/outside of the specified HSL range - it keeps pixels with colors inside/outside of the specified range and fills the rest with FillColor specified color.
-
-
Constructor Summary
Constructors Constructor and Description HSLFiltering()Initializes a new instance of the HSLFiltering class.HSLFiltering(IntRange hue, FloatRange saturation, FloatRange luminance)Initializes a new instance of the HSLFiltering class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyInPlace(FastBitmap fastBitmap)Apply filter to an image.float[]getFillColor()Get fill color used to fill filtered pixels.IntRangegetHue()Get Range of hue component, [0, 359].FloatRangegetLuminance()Get Range of luminance component, [0, 1].FloatRangegetSaturation()Get Range of saturation component, [0, 1].booleanisFillOutsideRange()Verify if pixels should be filled inside or outside specified color range.booleanisUpdatedHue()Verify if hue value of filtered pixels should be updated.booleanisUpdatedLuminance()Verify if luminance value of filtered pixels should be updated.booleanisUpdatedSaturation()Verify if saturation value of filtered pixels should be updated.voidsetFillColor(int hue, float saturation, float luminance)Set fill color used to fill filtered pixels.voidsetFillOutsideRange(boolean fillOutsideRange)Determines, if pixels should be filled inside or outside specified.voidsetHue(IntRange hue)Set Range of hue component, [0, 359].voidsetLuminance(FloatRange luminance)Set Range of luminance component, [0, 1].voidsetSaturation(FloatRange saturation)Set Range of saturation component, [0, 1].voidsetUpdateHue(boolean update)Determines, if hue value of filtered pixels should be updated.voidsetUpdateLuminance(boolean update)Determines, if luminance value of filtered pixels should be updated.voidsetUpdateSaturation(boolean update)Determines, if saturation value of filtered pixels should be updated.
-
-
-
Constructor Detail
-
HSLFiltering
public HSLFiltering()
Initializes a new instance of the HSLFiltering class.
-
HSLFiltering
public HSLFiltering(IntRange hue, FloatRange saturation, FloatRange luminance)
Initializes a new instance of the HSLFiltering class.- Parameters:
hue- Range of hue component.saturation- Range of saturation component.luminance- Range of luminance component.
-
-
Method Detail
-
getHue
public IntRange getHue()
Get Range of hue component, [0, 359].- Returns:
- Hue component.
-
setHue
public void setHue(IntRange hue)
Set Range of hue component, [0, 359].- Parameters:
hue- Hue component.
-
getSaturation
public FloatRange getSaturation()
Get Range of saturation component, [0, 1].- Returns:
- Saturation component.
-
setSaturation
public void setSaturation(FloatRange saturation)
Set Range of saturation component, [0, 1].- Parameters:
saturation- Saturation component.
-
getLuminance
public FloatRange getLuminance()
Get Range of luminance component, [0, 1].- Returns:
- Luminance component.
-
setLuminance
public void setLuminance(FloatRange luminance)
Set Range of luminance component, [0, 1].- Parameters:
luminance- Luminance component.
-
getFillColor
public float[] getFillColor()
Get fill color used to fill filtered pixels.- Returns:
- Hue color.
-
setFillColor
public void setFillColor(int hue, float saturation, float luminance)Set fill color used to fill filtered pixels.- Parameters:
hue- Hue, [0, 359].saturation- Saturation, [0, 1].luminance- Luminance, [0, 1].
-
isFillOutsideRange
public boolean isFillOutsideRange()
Verify if pixels should be filled inside or outside specified color range.- Returns:
- True if fill outside the range, otherwise false.
-
setFillOutsideRange
public void setFillOutsideRange(boolean fillOutsideRange)
Determines, if pixels should be filled inside or outside specified.- Parameters:
fillOutsideRange- True if fill outside the range, otherwise false.
-
isUpdatedHue
public boolean isUpdatedHue()
Verify if hue value of filtered pixels should be updated.- Returns:
- True if should be updated, otherwise false.
-
setUpdateHue
public void setUpdateHue(boolean update)
Determines, if hue value of filtered pixels should be updated.- Parameters:
update- True if should be updated, otherwise false.
-
isUpdatedSaturation
public boolean isUpdatedSaturation()
Verify if saturation value of filtered pixels should be updated.- Returns:
- True if should be updated, otherwise false.
-
setUpdateSaturation
public void setUpdateSaturation(boolean update)
Determines, if saturation value of filtered pixels should be updated.- Parameters:
update- True if should be updated, otherwise false.
-
isUpdatedLuminance
public boolean isUpdatedLuminance()
Verify if luminance value of filtered pixels should be updated.- Returns:
- True if should be updated, otherwise false.
-
setUpdateLuminance
public void setUpdateLuminance(boolean update)
Determines, if luminance value of filtered pixels should be updated.- Parameters:
update- True if should be updated, otherwise false.
-
applyInPlace
public void applyInPlace(FastBitmap fastBitmap)
Description copied from interface:IApplyInPlaceApply filter to an image.- Specified by:
applyInPlacein interfaceIApplyInPlace- Parameters:
fastBitmap- Image to be processed.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG