Catalano.Imaging.Filters
Class Grayscale
- java.lang.Object
-
- Catalano.Imaging.Filters.Grayscale
-
- All Implemented Interfaces:
- IApplyInPlace
public class Grayscale extends java.lang.Object implements IApplyInPlace
Base class for image grayscaling.- Supported types: RGB.
- Coordinate System: Independent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classGrayscale.AlgorithmThree methods for grayscale.
-
Constructor Summary
Constructors Constructor and Description Grayscale()Initializes a new instance of the Grayscale class.Grayscale(double redCoefficient, double greenCoefficient, double blueCoefficient)Initializes a new instance of the Grayscale class.Grayscale(Grayscale.Algorithm grayscaleMethod)Initializes a new instance of the Grayscale class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyInPlace(FastBitmap fastBitmap)Apply filter to a FastBitmap.doublegetBlueCoefficient()Get blue coefficientGrayscale.AlgorithmgetGrayscaleMethod()Get Grayscale MethoddoublegetGreenCoefficient()Get green coefficientdoublegetRedCoefficient()Get red coefficientvoidsetBlueCoefficient(double blueCoefficient)Set blue coefficientvoidsetGrayscaleMethod(Grayscale.Algorithm grayscaleMethod)Set Grayscale MethodvoidsetGreenCoefficient(double greenCoefficient)Set green coefficientvoidsetRedCoefficient(double redCoefficient)Set red coefficient
-
-
-
Constructor Detail
-
Grayscale
public Grayscale()
Initializes a new instance of the Grayscale class. In this constructor, will be 0.2125B + 0.7154G + 0.0721B.
-
Grayscale
public Grayscale(double redCoefficient, double greenCoefficient, double blueCoefficient)Initializes a new instance of the Grayscale class.- Parameters:
redCoefficient- Portion of red channel's value to use during conversion from RGB to grayscale.greenCoefficient- Portion of green channel's value to use during conversion from RGB to grayscale.blueCoefficient- Portion of blue channel's value to use during conversion from RGB to grayscale.
-
Grayscale
public Grayscale(Grayscale.Algorithm grayscaleMethod)
Initializes a new instance of the Grayscale class.- Parameters:
grayscaleMethod- Methods for grayscaling.
-
-
Method Detail
-
getRedCoefficient
public double getRedCoefficient()
Get red coefficient- Returns:
- red coefficient
-
setRedCoefficient
public void setRedCoefficient(double redCoefficient)
Set red coefficient- Parameters:
redCoefficient- red coefficient
-
getGreenCoefficient
public double getGreenCoefficient()
Get green coefficient- Returns:
- green coefficient
-
setGreenCoefficient
public void setGreenCoefficient(double greenCoefficient)
Set green coefficient- Parameters:
greenCoefficient- green coefficient
-
getBlueCoefficient
public double getBlueCoefficient()
Get blue coefficient- Returns:
- blue coefficient
-
setBlueCoefficient
public void setBlueCoefficient(double blueCoefficient)
Set blue coefficient- Parameters:
blueCoefficient- blue coefficient
-
getGrayscaleMethod
public Grayscale.Algorithm getGrayscaleMethod()
Get Grayscale Method- Returns:
- Grayscale Method
-
setGrayscaleMethod
public void setGrayscaleMethod(Grayscale.Algorithm grayscaleMethod)
Set Grayscale Method- Parameters:
grayscaleMethod- Grayscale Method
-
applyInPlace
public void applyInPlace(FastBitmap fastBitmap)
Apply filter to a FastBitmap.- Specified by:
applyInPlacein interfaceIApplyInPlace- Parameters:
fastBitmap- Image to be processed.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG