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
interestRectangleDestination bounds to rasterize into.
intersectionRuleIntersectionRulePolygon intersection rule.
rasterizationModeRasterizationModeRasterization coverage mode.
coverageBoostfloatPerceptual 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
Interest
Gets destination bounds to rasterize into.
public Rectangle Interest { get; }
Property Value
IntersectionRule
Gets the polygon intersection rule.
public IntersectionRule IntersectionRule { get; }
Property Value
RasterizationMode
Gets the rasterization coverage mode.
public RasterizationMode RasterizationMode { get; }
Property Value
Methods
WithInterest(Rectangle)
Creates a copy of the current options with a different interest rectangle.
public RasterizerOptions WithInterest(Rectangle interest)
Parameters
interestRectangleThe replacement interest rectangle.
Returns
- RasterizerOptions
A new RasterizerOptions value.