Class ShadowPostProcessor
- Namespace
- KernSmith.Rasterizer
- Assembly
- KernSmith.dll
Adds a drop shadow behind each glyph with configurable offset, color, blur radius, and opacity.
public sealed class ShadowPostProcessor : IGlyphPostProcessor
- Inheritance
-
ShadowPostProcessor
- Implements
- Inherited Members
Constructors
ShadowPostProcessor(int, int, int, byte, byte, byte, float)
Creates a drop shadow effect.
public ShadowPostProcessor(int offsetX = 2, int offsetY = 2, int blurRadius = 0, byte shadowR = 0, byte shadowG = 0, byte shadowB = 0, float opacity = 1)
Parameters
Properties
BlurRadius
Blur radius in pixels. 0 = hard shadow, higher values produce a softer edge.
public int BlurRadius { get; }
Property Value
OffsetX
Pixels to shift the shadow right. Negative goes left.
public int OffsetX { get; }
Property Value
OffsetY
Pixels to shift the shadow down. Negative goes up.
public int OffsetY { get; }
Property Value
Opacity
Shadow opacity from 0.0 (invisible) to 1.0 (fully opaque).
public float Opacity { get; }
Property Value
ShadowB
Shadow color blue (0-255).
public byte ShadowB { get; }
Property Value
ShadowG
Shadow color green (0-255).
public byte ShadowG { get; }
Property Value
ShadowR
Shadow color red (0-255).
public byte ShadowR { get; }
Property Value
Methods
Process(RasterizedGlyph)
Takes a rendered glyph and returns a new one with the effect applied.
public RasterizedGlyph Process(RasterizedGlyph glyph)
Parameters
glyphRasterizedGlyphThe glyph to modify.