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 : IImageProcessor
Constructors
| Edit this page View SourceBinaryThresholdProcessor(float)
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 |
---|---|---|
float | threshold | The 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.
Declaration
public BinaryThresholdProcessor(float threshold, Color upperColor, Color lowerColor)
Parameters
Type | Name | Description |
---|---|---|
float | 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(float, 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 |
---|---|---|
float | 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(float, BinaryThresholdMode)
Initializes a new instance of the BinaryThresholdProcessor class.
Declaration
public BinaryThresholdProcessor(float threshold, BinaryThresholdMode mode)
Parameters
Type | Name | Description |
---|---|---|
float | threshold | The threshold to split the image. Must be between 0 and 1. |
BinaryThresholdMode | mode | The color component to be compared to threshold. |
Properties
| Edit this page 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 |
---|---|
float |
UpperColor
Gets the color to use for pixels that are above the threshold.
Declaration
public Color UpperColor { get; }
Property Value
Type | Description |
---|---|
Color |
Methods
| Edit this page 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 : unmanaged, 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. |