Table of Contents

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

maximumPixels int

The maximum number of pixels to process.

minimumScanRatio double

always 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

long

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

double

Methods

EnumeratePixelRegions<TPixel>(ImageFrame<TPixel>)

public IEnumerable<Buffer2DRegion<TPixel>> EnumeratePixelRegions<TPixel>(ImageFrame<TPixel> frame) where TPixel : unmanaged, IPixel<TPixel>

Parameters

frame ImageFrame<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

image Image<TPixel>

Returns

IEnumerable<Buffer2DRegion<TPixel>>

Type Parameters

TPixel