Class LightingOptions
- Namespace
- Egami.Operations
- Assembly
- Egami.dll
The surface and output settings of Lighting(Light, LightingModel, LightingOptions?).
public sealed record LightingOptions : IEquatable<LightingOptions>
- Inheritance
-
LightingOptions
- Implements
- Inherited Members
Examples
// A logo on a transparent canvas: alpha is the height, so soften its edges first to give them a slope.
logo.Apply(ops => ops
.Blur(2.5f)
.Lighting(new DistantLight(225, 35), LightingModel.Diffuse(1.4f),
new LightingOptions { SurfaceScale = 5, Blend = BlendMode.Multiply }) // shade the slopes
.Lighting(new DistantLight(225, 35), LightingModel.Specular(0.8f, 24),
new LightingOptions { SurfaceScale = 5, Blend = BlendMode.Screen }), Ct); // and add a highlight
logo.Save("bevel.png");
Properties
Blend
Gets how the light map is applied. null (the default) replaces the image with the light map, as SVG and Skia return it; a BlendMode blends the light map onto the image as the source, and the image keeps its alpha: Multiply shades it (a bevel), Screen or Plus adds highlights.
public BlendMode? Blend { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not a defined mode.
Height
Gets which channel is the height. Defaults to Alpha, as SVG and Skia.
public HeightSource Height { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not defined.
SurfaceScale
Gets how high the surface is where the height channel is 1, in pixels (SVG's surfaceScale, Skia's surfaceScale). Larger values give steeper slopes and stronger relief; negative values turn the surface inside out. Defaults to 1.
public float SurfaceScale { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not from −1000 to 1000.