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>)

Enumerates pixel regions within a single image frame as Buffer2DRegion<T>.

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

Parameters

frame ImageFrame<TPixel>

The image frame.

Returns

IEnumerable<Buffer2DRegion<TPixel>>

An enumeration of pixel regions.

Type Parameters

TPixel

The pixel type.

EnumeratePixelRegions<TPixel>(Image<TPixel>)

Enumerates pixel regions for all frames within the image as Buffer2DRegion<T>.

public IEnumerable<Buffer2DRegion<TPixel>> EnumeratePixelRegions<TPixel>(Image<TPixel> image) where TPixel : unmanaged, IPixel<TPixel>

Parameters

image Image<TPixel>

The image.

Returns

IEnumerable<Buffer2DRegion<TPixel>>

An enumeration of pixel regions.

Type Parameters

TPixel

The pixel type.