Table of Contents

Class LensBlurOptions

Namespace
Egami.Operations
Assembly
Egami.dll

The aperture and highlights of LensBlur(float, LensBlurOptions?). The defaults give a round aperture in linear light with no highlight boost.

public sealed record LensBlurOptions : IEquatable<LensBlurOptions>
Inheritance
LensBlurOptions
Implements
Inherited Members

Examples

// Blur the background like a wide-open lens with a six-blade aperture: bright points become hexagons.
LensBlurOptions lens = new() { Blades = 6, Rotation = 15, HighlightGain = 4, HighlightThreshold = 0.8f };
photo.Apply(ops => ops.Within(new Rect(0, 0, photo.Width, photo.Height / 3), o => o.LensBlur(12, lens)), Ct);

Properties

Blades

Gets the number of aperture blades: 0 for a round aperture, else 5 to 12 for a regular polygon.

public int Blades { get; init; }

Property Value

int

ColorSpace

Gets where the blur adds light. Defaults to Linear, as a lens adds light, not encoded values.

public ColorSpace ColorSpace { get; init; }

Property Value

ColorSpace

Default

Gets the default options.

public static LensBlurOptions Default { get; }

Property Value

LensBlurOptions

HighlightGain

Gets how much brighter than the rest highlights blur: light above HighlightThreshold is multiplied by this before the blur, as a camera sees a bright point as more light than the pixel can hold, so small lights bloom into bright discs. 1, the default, changes nothing.

public float HighlightGain { get; init; }

Property Value

float

HighlightThreshold

Gets the level, 0 to 1 in the blur's color space, above which HighlightGain applies. Defaults to 0.9.

public float HighlightThreshold { get; init; }

Property Value

float

Rotation

Gets the polygon's turn in degrees, clockwise; at 0 one corner points straight up.

public float Rotation { get; init; }

Property Value

float