Table of Contents

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

offsetX int
offsetY int
blurRadius int
shadowR byte
shadowG byte
shadowB byte
opacity float

Properties

BlurRadius

Blur radius in pixels. 0 = hard shadow, higher values produce a softer edge.

public int BlurRadius { get; }

Property Value

int

OffsetX

Pixels to shift the shadow right. Negative goes left.

public int OffsetX { get; }

Property Value

int

OffsetY

Pixels to shift the shadow down. Negative goes up.

public int OffsetY { get; }

Property Value

int

Opacity

Shadow opacity from 0.0 (invisible) to 1.0 (fully opaque).

public float Opacity { get; }

Property Value

float

ShadowB

Shadow color blue (0-255).

public byte ShadowB { get; }

Property Value

byte

ShadowG

Shadow color green (0-255).

public byte ShadowG { get; }

Property Value

byte

ShadowR

Shadow color red (0-255).

public byte ShadowR { get; }

Property Value

byte

Methods

Process(RasterizedGlyph)

Takes a rendered glyph and returns a new one with the effect applied.

public RasterizedGlyph Process(RasterizedGlyph glyph)

Parameters

glyph RasterizedGlyph

The glyph to modify.

Returns

RasterizedGlyph