Class BinaryThresholdProcessor
- Namespace
- SixLabors.ImageSharp.Processing.Processors.Binarization
- Assembly
- SixLabors.ImageSharp.dll
Performs simple binary threshold filtering against an image.
public class BinaryThresholdProcessor : IImageProcessor
- Inheritance
-
BinaryThresholdProcessor
- Implements
- Inherited Members
Constructors
BinaryThresholdProcessor(float)
Initializes a new instance of the BinaryThresholdProcessor class with Luminance as color component to be compared to threshold.
public BinaryThresholdProcessor(float threshold)
Parameters
thresholdfloatThe threshold to split the image. Must be between 0 and 1.
BinaryThresholdProcessor(float, Color, Color)
Initializes a new instance of the BinaryThresholdProcessor class with Luminance as color component to be compared to threshold.
public BinaryThresholdProcessor(float threshold, Color upperColor, Color lowerColor)
Parameters
thresholdfloatThe threshold to split the image. Must be between 0 and 1.
upperColorColorThe color to use for pixels that are above the threshold.
lowerColorColorThe color to use for pixels that are below the threshold.
BinaryThresholdProcessor(float, Color, Color, BinaryThresholdMode)
Initializes a new instance of the BinaryThresholdProcessor class.
public BinaryThresholdProcessor(float threshold, Color upperColor, Color lowerColor, BinaryThresholdMode mode)
Parameters
thresholdfloatThe threshold to split the image. Must be between 0 and 1.
upperColorColorThe color to use for pixels that are above the threshold.
lowerColorColorThe color to use for pixels that are below the threshold.
modeBinaryThresholdModeThe color component to be compared to threshold.
BinaryThresholdProcessor(float, BinaryThresholdMode)
Initializes a new instance of the BinaryThresholdProcessor class.
public BinaryThresholdProcessor(float threshold, BinaryThresholdMode mode)
Parameters
thresholdfloatThe threshold to split the image. Must be between 0 and 1.
modeBinaryThresholdModeThe color component to be compared to threshold.
Properties
LowerColor
Gets the color to use for pixels that fall below the threshold.
public Color LowerColor { get; }
Property Value
Mode
Gets the BinaryThresholdMode defining the value to be compared to threshold.
public BinaryThresholdMode Mode { get; }
Property Value
Threshold
Gets the threshold value.
public float Threshold { get; }
Property Value
UpperColor
Gets the color to use for pixels that are above the threshold.
public Color UpperColor { get; }
Property Value
Methods
CreatePixelSpecificProcessor<TPixel>(Configuration, Image<TPixel>, Rectangle)
Creates a pixel specific IImageProcessor<TPixel> that is capable of executing the processing algorithm on an Image<TPixel>.
public IImageProcessor<TPixel> CreatePixelSpecificProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle) where TPixel : unmanaged, IPixel<TPixel>
Parameters
configurationConfigurationThe configuration which allows altering default behaviour or extending the library.
sourceImage<TPixel>The source image. Cannot be null.
sourceRectangleRectangleThe Rectangle structure that specifies the portion of the image object to draw.
Returns
- IImageProcessor<TPixel>
Type Parameters
TPixelThe pixel type.