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 : FilterPrimitiveRemarks
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
FilterPrimitiveDiffuseLightingPrimitive
Constructors
| Name | Description |
|---|---|
| DiffuseLightingPrimitive(FilterLightSource, Rgba64) | Initializes a new instance of the DiffuseLightingPrimitive class. |
DiffuseLightingPrimitive(FilterLightSource, Rgba64)
DiffuseLightingPrimitive.csInitializes a new instance of the DiffuseLightingPrimitive class.
public DiffuseLightingPrimitive(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. |
| DiffuseConstant | Gets the factor of the light: diffuseConstant. Defaults to 1. |
| Input | Gets the input: in. |
| Light | Gets the light. |
| SurfaceScale | Gets the height of the surface where the alpha is 1: surfaceScale. Defaults to 1. |
DiffuseConstant
DiffuseLightingPrimitive.csGets the factor of the light: diffuseConstant. Defaults to 1.
public double DiffuseConstant { get; init; }Property value
Exceptions
ArgumentException- The value is not a finite number.
ArgumentOutOfRangeException- The value is negative or exceeds 16777216.
SurfaceScale
DiffuseLightingPrimitive.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.