Catalano.Imaging.Filters
Class YCbCrFiltering
- java.lang.Object
-
- Catalano.Imaging.Filters.YCbCrFiltering
-
- All Implemented Interfaces:
- IApplyInPlace
public class YCbCrFiltering extends java.lang.Object implements IApplyInPlace
Color filtering in YCbCr color space.The filter operates in YCbCr color space and filters pixels, which color is inside/outside of the specified YCbCr 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 YCbCrFiltering()Initializes a new instance of the YCbCrFiltering class.YCbCrFiltering(FloatRange y, FloatRange cb, FloatRange cr)Initializes a new instance of the YCbCrFiltering class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyInPlace(FastBitmap fastBitmap)Apply filter to an image.FloatRangegetCb()Get Range of cb component, [-0.5, 0.5].FloatRangegetCr()Get Range of cr component, [-0.5, 0.5].float[]getFillColor()Get fill color used to fill filtered pixels.FloatRangegetY()Get Range of Y component, [0, 1].booleanisFillOutsideRange()Verify if pixels should be filled inside or outside specified color range.booleanisUpdatedCb()Verify if cb value of filtered pixels should be updated.booleanisUpdatedCr()Verify if cr value of filtered pixels should be updated.booleanisUpdatedY()Verify if y value of filtered pixels should be updated.voidsetCb(FloatRange cb)Set Range of cb component, [-0.5, 0.5].voidsetCr(FloatRange cr)Set Range of cr component, [-0.5, 0.5].voidsetFillColor(float y, float cb, float cr)Set fill color used to fill filtered pixels.voidsetFillOutsideRange(boolean fillOutsideRange)Determines, if pixels should be filled inside or outside specified.voidsetHue(FloatRange y)Set Range of Y component, [0, 1].voidsetUpdateCb(boolean update)Determines, if cb value of filtered pixels should be updated.voidsetUpdateCr(boolean update)Determines, if cr value of filtered pixels should be updated.voidsetUpdateY(boolean update)Determines, if y value of filtered pixels should be updated.
-
-
-
Constructor Detail
-
YCbCrFiltering
public YCbCrFiltering()
Initializes a new instance of the YCbCrFiltering class.
-
YCbCrFiltering
public YCbCrFiltering(FloatRange y, FloatRange cb, FloatRange cr)
Initializes a new instance of the YCbCrFiltering class.- Parameters:
y- Range of y component.cb- Range of cb component.cr- Range of cr component.
-
-
Method Detail
-
getY
public FloatRange getY()
Get Range of Y component, [0, 1].- Returns:
- Y component.
-
setHue
public void setHue(FloatRange y)
Set Range of Y component, [0, 1].- Parameters:
yRange- Y component.
-
getCb
public FloatRange getCb()
Get Range of cb component, [-0.5, 0.5].- Returns:
- Cb component.
-
setCb
public void setCb(FloatRange cb)
Set Range of cb component, [-0.5, 0.5].- Parameters:
cb- Cb component.
-
getCr
public FloatRange getCr()
Get Range of cr component, [-0.5, 0.5].- Returns:
- Cr component.
-
setCr
public void setCr(FloatRange cr)
Set Range of cr component, [-0.5, 0.5].- Parameters:
cr- Cr component.
-
getFillColor
public float[] getFillColor()
Get fill color used to fill filtered pixels.- Returns:
- YCbCr color.
-
setFillColor
public void setFillColor(float y, float cb, float cr)Set fill color used to fill filtered pixels.- Parameters:
y- Y, [0, 1].cb- Cb, [-0.5, 0.5].cr- Cr, [-0.5, 0.5].
-
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.
-
isUpdatedY
public boolean isUpdatedY()
Verify if y value of filtered pixels should be updated.- Returns:
- True if should be updated, otherwise false.
-
setUpdateY
public void setUpdateY(boolean update)
Determines, if y value of filtered pixels should be updated.- Parameters:
update- True if should be updated, otherwise false.
-
isUpdatedCb
public boolean isUpdatedCb()
Verify if cb value of filtered pixels should be updated.- Returns:
- True if should be updated, otherwise false.
-
setUpdateCb
public void setUpdateCb(boolean update)
Determines, if cb value of filtered pixels should be updated.- Parameters:
update- True if should be updated, otherwise false.
-
isUpdatedCr
public boolean isUpdatedCr()
Verify if cr value of filtered pixels should be updated.- Returns:
- True if should be updated, otherwise false.
-
setUpdateCr
public void setUpdateCr(boolean update)
Determines, if cr 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