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