Table of Contents

Class ColorMatrixLayerEffect

Namespace
SixLabors.ImageSharp.Drawing.Processing
Assembly
SixLabors.ImageSharp.Drawing.dll

Transforms the colours of a compositing layer's contents through a colour matrix when the layer is restored. Covers the CSS filter family: grayscale, sepia, saturation, hue rotation, brightness, contrast, and invert are all colour matrices.

public sealed class ColorMatrixLayerEffect : LayerEffect
Inheritance
ColorMatrixLayerEffect
Inherited Members

Constructors

ColorMatrixLayerEffect(ColorMatrix)

Initializes a new instance of the ColorMatrixLayerEffect class.

public ColorMatrixLayerEffect(ColorMatrix matrix)

Parameters

matrix ColorMatrix

The colour matrix applied to the layer content.

Properties

IsPassThrough

Gets a value indicating whether the effect leaves the layer content unchanged, in which case its application is skipped entirely.

public override bool IsPassThrough { get; }

Property Value

bool

Matrix

Gets the colour matrix applied to the layer content.

public ColorMatrix Matrix { get; }

Property Value

ColorMatrix

Reach

Gets the distance, in pixels, the effect can push content beyond its source region. Layer and processing bounds are expanded by this reach so the effect output is not cut off. Effects constructed over a fallback inherit the fallback's reach.

public override int Reach { get; }

Property Value

int

WriteBackOffset

Gets the offset, in pixels, at which the processed pixels are written back relative to the region they were read from.

public override Point WriteBackOffset { get; }

Property Value

Point

WriteBackOptions

Gets the graphics options used to composite the processed pixels back onto the layer, or null to replace the processed region outright.

public override GraphicsOptions? WriteBackOptions { get; }

Property Value

GraphicsOptions