SpecularLightingPrimitive Class

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

public sealed class SpecularLightingPrimitive : FilterPrimitive

Remarks

Each pixel of the result is ks (N.H)^exponent C: ks the SpecularLightingPrimitive.SpecularConstant, N the normal of the surface (from the alpha of the input, scaled by SpecularLightingPrimitive.SurfaceScale), H the unit vector half way between the light and the eye (0, 0, 1), and C the color of the light in the colors of the primitive, each component clamped to the range from 0 to 1; its alpha is the largest of its components. It is meant to be added to what it lights (FilterCompositeOperator.Arithmetic).

Inheritance
FilterPrimitive SpecularLightingPrimitive

Constructors

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

SpecularLightingPrimitive(FilterLightSource, Rgba64)

SpecularLightingPrimitive.cs

Initializes a new instance of the SpecularLightingPrimitive class.

public SpecularLightingPrimitive(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.
InputGets the input: in.
LightGets the light.
SpecularConstantGets the factor of the light: specularConstant. Defaults to 1.
SpecularExponentGets how shiny the surface is: specularExponent, from 1 to 128. Defaults to 1.
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 input: in.

public FilterInput Input { get; init; }

Property value

FilterInput

Gets the light.

public FilterLightSource Light { get; }

Property value

FilterLightSource

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

public double SpecularConstant { get; init; }

Property value

double

Exceptions

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

Gets how shiny the surface is: specularExponent, from 1 to 128. Defaults to 1.

public double SpecularExponent { get; init; }

Property value

double

Exceptions

ArgumentException
The value is not a finite number.
ArgumentOutOfRangeException
The value is less than 1 or more than 128.

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.