Table of Contents

Struct RasterizerOptions

Namespace
SixLabors.ImageSharp.Drawing.Processing.Backends
Assembly
SixLabors.ImageSharp.Drawing.dll

Immutable options used by rasterizers when scan-converting vector geometry.

public readonly struct RasterizerOptions
Inherited Members

Constructors

RasterizerOptions(Rectangle, IntersectionRule, RasterizationMode, float)

Initializes a new instance of the RasterizerOptions struct.

public RasterizerOptions(Rectangle interest, IntersectionRule intersectionRule, RasterizationMode rasterizationMode, float coverageBoost = 0)

Parameters

interest Rectangle

Destination bounds to rasterize into.

intersectionRule IntersectionRule

Polygon intersection rule.

rasterizationMode RasterizationMode

Rasterization coverage mode.

coverageBoost float

Perceptual coverage boost for antialiased mode (0 disables).

Properties

CoverageBoost

Gets the perceptual coverage boost used when RasterizationMode is Antialiased. Partial coverage values are remapped by the S-curve a + boost * a * (1 - a) * (2a - 1), darkening mostly covered pixels and lightening mostly empty ones while 0, 0.5, and 1 stay fixed; at 1 the remap is exactly smoothstep. 0 disables the boost. Text rendering uses this to counter the soft, washed-out appearance of small blended glyphs.

public float CoverageBoost { get; }

Property Value

float

Interest

Gets destination bounds to rasterize into.

public Rectangle Interest { get; }

Property Value

Rectangle

IntersectionRule

Gets the polygon intersection rule.

public IntersectionRule IntersectionRule { get; }

Property Value

IntersectionRule

RasterizationMode

Gets the rasterization coverage mode.

public RasterizationMode RasterizationMode { get; }

Property Value

RasterizationMode

Methods

WithInterest(Rectangle)

Creates a copy of the current options with a different interest rectangle.

public RasterizerOptions WithInterest(Rectangle interest)

Parameters

interest Rectangle

The replacement interest rectangle.

Returns

RasterizerOptions

A new RasterizerOptions value.