Class DefaultPixelSamplingStrategy
- Namespace
- SixLabors.ImageSharp.Processing.Processors.Quantization
- Assembly
- SixLabors.ImageSharp.dll
A pixel sampling strategy that enumerates a limited amount of rows from different frames, if the total number of pixels is over a threshold.
public class DefaultPixelSamplingStrategy : IPixelSamplingStrategy
- Inheritance
-
DefaultPixelSamplingStrategy
- Implements
- Inherited Members
Constructors
DefaultPixelSamplingStrategy()
Initializes a new instance of the DefaultPixelSamplingStrategy class.
public DefaultPixelSamplingStrategy()
DefaultPixelSamplingStrategy(int, double)
Initializes a new instance of the DefaultPixelSamplingStrategy class.
public DefaultPixelSamplingStrategy(int maximumPixels, double minimumScanRatio)
Parameters
maximumPixelsintThe maximum number of pixels to process.
minimumScanRatiodoublealways scan at least this portion of total pixels within the image.
Properties
MaximumPixels
Gets the maximum number of pixels to process. (The threshold.)
public long MaximumPixels { get; }
Property Value
MinimumScanRatio
Gets a value indicating: always scan at least this portion of total pixels within the image. The default is 0.1 (10%).
public double MinimumScanRatio { get; }
Property Value
Methods
EnumeratePixelRegions<TPixel>(ImageFrame<TPixel>)
public IEnumerable<Buffer2DRegion<TPixel>> EnumeratePixelRegions<TPixel>(ImageFrame<TPixel> frame) where TPixel : unmanaged, IPixel<TPixel>
Parameters
frameImageFrame<TPixel>
Returns
- IEnumerable<Buffer2DRegion<TPixel>>
Type Parameters
TPixel
EnumeratePixelRegions<TPixel>(Image<TPixel>)
public IEnumerable<Buffer2DRegion<TPixel>> EnumeratePixelRegions<TPixel>(Image<TPixel> image) where TPixel : unmanaged, IPixel<TPixel>
Parameters
imageImage<TPixel>
Returns
- IEnumerable<Buffer2DRegion<TPixel>>
Type Parameters
TPixel