Class DefaultPixelSamplingStrategy
A pixel sampling strategy that enumerates a limited amount of rows from different frames, if the total number of pixels is over a threshold.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Processing.Processors.Quantization
Assembly: SixLabors.ImageSharp.dll
Syntax
public class DefaultPixelSamplingStrategy : IPixelSamplingStrategyConstructors
| Improve this Doc View SourceDefaultPixelSamplingStrategy()
Initializes a new instance of the DefaultPixelSamplingStrategy class.
Declaration
public DefaultPixelSamplingStrategy()DefaultPixelSamplingStrategy(Int32, Double)
Initializes a new instance of the DefaultPixelSamplingStrategy class.
Declaration
public DefaultPixelSamplingStrategy(int maximumPixels, double minimumScanRatio)Parameters
| Type | Name | Description | 
|---|---|---|
| Int32 | maximumPixels | The maximum number of pixels to process. | 
| Double | minimumScanRatio | always scan at least this portion of total pixels within the image. | 
Properties
| Improve this Doc View SourceMaximumPixels
Gets the maximum number of pixels to process. (The threshold.)
Declaration
public long MaximumPixels { get; }Property Value
| Type | Description | 
|---|---|
| Int64 | 
MinimumScanRatio
Gets a value indicating: always scan at least this portion of total pixels within the image. The default is 0.1 (10%).
Declaration
public double MinimumScanRatio { get; }Property Value
| Type | Description | 
|---|---|
| Double | 
Methods
| Improve this Doc View SourceEnumeratePixelRegions<TPixel>(Image<TPixel>)
Enumerates pixel regions within the image as Buffer2DRegion<T>.
Declaration
public IEnumerable<Buffer2DRegion<TPixel>> EnumeratePixelRegions<TPixel>(Image<TPixel> image)
    where TPixel : struct, IPixel<TPixel>Parameters
| Type | Name | Description | 
|---|---|---|
| Image<TPixel> | image | The image. | 
Returns
| Type | Description | 
|---|---|
| IEnumerable<Buffer2DRegion<TPixel>> | An enumeration of pixel regions. | 
Type Parameters
| Name | Description | 
|---|---|
| TPixel | The pixel type. |