DiffuseLightingPrimitive Class

A primitive that lights the surface whose height is the alpha of its input, as a matte surface: feDiffuseLighting of SVG.

public sealed class DiffuseLightingPrimitive : FilterPrimitive

Remarks

Each pixel of the result is opaque, of the color kd (N.L) C: kd the DiffuseLightingPrimitive.DiffuseConstant, N the normal of the surface (from the alpha of the input, scaled by DiffuseLightingPrimitive.SurfaceScale), L the unit vector toward the light, and C the color of the light in the colors of the primitive, each component clamped to the range from 0 to 1.

Inheritance
FilterPrimitive DiffuseLightingPrimitive

Constructors

NameDescription
DiffuseLightingPrimitive(FilterLightSource, Rgba64)Initializes a new instance of the DiffuseLightingPrimitive class.

DiffuseLightingPrimitive(FilterLightSource, Rgba64)

DiffuseLightingPrimitive.cs

Initializes a new instance of the DiffuseLightingPrimitive class.

public DiffuseLightingPrimitive(FilterLightSource light, Rgba64 color)

Parameters

light FilterLightSource
The light.
color Rgba64
The color of the light: lighting-color. Its alpha is not used. An Rgba32 converts implicitly.

Exceptions

ArgumentNullException
light is null.

Properties

NameDescription
ColorGets the color of the light.
DiffuseConstantGets the factor of the light: diffuseConstant. Defaults to 1.
InputGets the input: in.
LightGets the light.
SurfaceScaleGets the height of the surface where the alpha is 1: surfaceScale. Defaults to 1.

Gets the color of the light.

public Rgba64 Color { get; }

Property value

Rgba64

Gets the factor of the light: diffuseConstant. Defaults to 1.

public double DiffuseConstant { get; init; }

Property value

double

Exceptions

ArgumentException
The value is not a finite number.
ArgumentOutOfRangeException
The value is negative or exceeds 16777216.

Gets the input: in.

public FilterInput Input { get; init; }

Property value

FilterInput

Gets the light.

public FilterLightSource Light { get; }

Property value

FilterLightSource

Gets the height of the surface where the alpha is 1: surfaceScale. Defaults to 1.

public double SurfaceScale { get; init; }

Property value

double

Exceptions

ArgumentException
The value is not a finite number.
ArgumentOutOfRangeException
The magnitude of the value exceeds 16777216.