Table of Contents

Enum HeightSource

Namespace
Egami.Operations
Assembly
Egami.dll

Which channel Lighting(Light, LightingModel, LightingOptions?) reads as the surface's height.

public enum HeightSource

Fields

Alpha = 0

Alpha, as SVG and Skia do: opaque is high, transparent is low, so a logo on a transparent canvas stands up.

Luminance = 1

The Rec. 709 luminance of the stored (encoded) color, as ImageMagick's -shade: light is high, dark is low.

Examples

// A photo's luminance as the height: light areas stand up. SurfaceScale is the height of white, in pixels.
LightingOptions relief = new() { Height = HeightSource.Luminance, SurfaceScale = 6 };
using Raster lit = photo.Derive(ops => ops.Lighting(new DistantLight(300, 50), LightingModel.Diffuse(), relief), Ct);

// The same light blended onto the photo instead of replacing it.
using Raster shaded = photo.Derive(ops => ops.Lighting(new DistantLight(300, 50), LightingModel.Diffuse(1.3f), relief with { Blend = BlendMode.Overlay }), Ct);