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 : FilterPrimitiveRemarks
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
FilterPrimitiveSpecularLightingPrimitive
Constructors
| Name | Description |
|---|---|
| SpecularLightingPrimitive(FilterLightSource, Rgba64) | Initializes a new instance of the SpecularLightingPrimitive class. |
SpecularLightingPrimitive(FilterLightSource, Rgba64)
SpecularLightingPrimitive.csInitializes a new instance of the SpecularLightingPrimitive class.
public SpecularLightingPrimitive(FilterLightSource light, Rgba64 color)Parameters
lightFilterLightSource- The light.
colorRgba64- The color of the light:
lighting-color. Its alpha is not used. AnRgba32converts implicitly.
Exceptions
ArgumentNullExceptionlightisnull.
Properties
| Name | Description |
|---|---|
| Color | Gets the color of the light. |
| Input | Gets the input: in. |
| Light | Gets the light. |
| SpecularConstant | Gets the factor of the light: specularConstant. Defaults to 1. |
| SpecularExponent | Gets how shiny the surface is: specularExponent, from 1 to 128. Defaults to 1. |
| SurfaceScale | Gets the height of the surface where the alpha is 1: surfaceScale. Defaults to 1. |
SpecularConstant
SpecularLightingPrimitive.csGets the factor of the light: specularConstant. Defaults to 1.
public double SpecularConstant { get; init; }Property value
Exceptions
ArgumentException- The value is not a finite number.
ArgumentOutOfRangeException- The value is negative or exceeds 16777216.
SpecularExponent
SpecularLightingPrimitive.csGets how shiny the surface is: specularExponent, from 1 to 128. Defaults to 1.
public double SpecularExponent { get; init; }Property value
Exceptions
ArgumentException- The value is not a finite number.
ArgumentOutOfRangeException- The value is less than 1 or more than 128.
SurfaceScale
SpecularLightingPrimitive.csGets the height of the surface where the alpha is 1: surfaceScale. Defaults to 1.
public double SurfaceScale { get; init; }Property value
Exceptions
ArgumentException- The value is not a finite number.
ArgumentOutOfRangeException- The magnitude of the value exceeds 16777216.