Table of Contents

Class PixelBlender<TPixel>

Namespace
SixLabors.ImageSharp.PixelFormats
Assembly
SixLabors.ImageSharp.dll

Abstract base class for calling pixel composition functions

public abstract class PixelBlender<TPixel> where TPixel : unmanaged, IPixel<TPixel>

Type Parameters

TPixel

The type of the pixel

Inheritance
PixelBlender<TPixel>
Inherited Members

Methods

Blend(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<float>)

Blends 2 rows together

public void Blend(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, ReadOnlySpan<TPixel> source, ReadOnlySpan<float> amount)

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source ReadOnlySpan<TPixel>

the source span

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

Blend(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<float>, Span<Vector4>)

Blends 2 rows together using caller-provided temporary vector scratch.

public void Blend(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, ReadOnlySpan<TPixel> source, ReadOnlySpan<float> amount, Span<Vector4> workingBuffer)

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source ReadOnlySpan<TPixel>

the source span

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

workingBuffer Span<Vector4>

Reusable temporary vector scratch with capacity for at least 3 rows.

Blend(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, TPixel, ReadOnlySpan<float>)

Blends a row against a constant source color.

public void Blend(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, TPixel source, ReadOnlySpan<float> amount)

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source TPixel

the source color

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

Blend(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, TPixel, ReadOnlySpan<float>, Span<Vector4>)

Blends a row against a constant source color using caller-provided temporary vector scratch.

public void Blend(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, TPixel source, ReadOnlySpan<float> amount, Span<Vector4> workingBuffer)

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source TPixel

the source color

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

workingBuffer Span<Vector4>

Reusable temporary vector scratch with capacity for at least 2 rows.

Blend(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, TPixel, float)

Blends a row against a constant source color.

public void Blend(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, TPixel source, float amount)

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source TPixel

the source color

amount float

A value between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

Blend(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, TPixel, float, Span<Vector4>)

Blends a row against a constant source color using caller-provided temporary vector scratch.

public void Blend(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, TPixel source, float amount, Span<Vector4> workingBuffer)

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source TPixel

the source color

amount float

A value between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

workingBuffer Span<Vector4>

Reusable temporary vector scratch with capacity for at least 2 rows.

Blend(TPixel, TPixel, float)

Blend 2 pixels together.

public abstract TPixel Blend(TPixel background, TPixel source, float amount)

Parameters

background TPixel

The background color.

source TPixel

The source color.

amount float

A value between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

Returns

TPixel

The final pixel value after composition.

BlendFunction(Span<Vector4>, ReadOnlySpan<Vector4>, Vector4, ReadOnlySpan<float>)

Blend a row against a constant source color.

protected abstract void BlendFunction(Span<Vector4> destination, ReadOnlySpan<Vector4> background, Vector4 source, ReadOnlySpan<float> amount)

Parameters

destination Span<Vector4>

destination span

background ReadOnlySpan<Vector4>

the background span

source Vector4

the source color vector

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

BlendFunction(Span<Vector4>, ReadOnlySpan<Vector4>, Vector4, float)

Blend a row against a constant source color.

protected abstract void BlendFunction(Span<Vector4> destination, ReadOnlySpan<Vector4> background, Vector4 source, float amount)

Parameters

destination Span<Vector4>

destination span

background ReadOnlySpan<Vector4>

the background span

source Vector4

the source color vector

amount float

A value between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

BlendFunction(Span<Vector4>, ReadOnlySpan<Vector4>, ReadOnlySpan<Vector4>, ReadOnlySpan<float>)

Blend 2 rows together.

protected abstract void BlendFunction(Span<Vector4> destination, ReadOnlySpan<Vector4> background, ReadOnlySpan<Vector4> source, ReadOnlySpan<float> amount)

Parameters

destination Span<Vector4>

destination span

background ReadOnlySpan<Vector4>

the background span

source ReadOnlySpan<Vector4>

the source span

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

BlendFunction(Span<Vector4>, ReadOnlySpan<Vector4>, ReadOnlySpan<Vector4>, float)

Blend 2 rows together.

protected abstract void BlendFunction(Span<Vector4> destination, ReadOnlySpan<Vector4> background, ReadOnlySpan<Vector4> source, float amount)

Parameters

destination Span<Vector4>

destination span

background ReadOnlySpan<Vector4>

the background span

source ReadOnlySpan<Vector4>

the source span

amount float

A value between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

Blend<TPixelSrc>(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<TPixelSrc>, ReadOnlySpan<float>)

Blends 2 rows together

public void Blend<TPixelSrc>(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, ReadOnlySpan<TPixelSrc> source, ReadOnlySpan<float> amount) where TPixelSrc : unmanaged, IPixel<TPixelSrc>

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source ReadOnlySpan<TPixelSrc>

the source span

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

Type Parameters

TPixelSrc

the pixel format of the source span

Blend<TPixelSrc>(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<TPixelSrc>, ReadOnlySpan<float>, Span<Vector4>)

Blends 2 rows together using caller-provided temporary vector scratch.

public void Blend<TPixelSrc>(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, ReadOnlySpan<TPixelSrc> source, ReadOnlySpan<float> amount, Span<Vector4> workingBuffer) where TPixelSrc : unmanaged, IPixel<TPixelSrc>

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source ReadOnlySpan<TPixelSrc>

the source span

amount ReadOnlySpan<float>

A span with values between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

workingBuffer Span<Vector4>

Reusable temporary vector scratch with capacity for at least 3 rows.

Type Parameters

TPixelSrc

the pixel format of the source span

Blend<TPixelSrc>(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<TPixelSrc>, float)

Blends 2 rows together

public void Blend<TPixelSrc>(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, ReadOnlySpan<TPixelSrc> source, float amount) where TPixelSrc : unmanaged, IPixel<TPixelSrc>

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source ReadOnlySpan<TPixelSrc>

the source span

amount float

A value between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

Type Parameters

TPixelSrc

the pixel format of the source span

Blend<TPixelSrc>(Configuration, Span<TPixel>, ReadOnlySpan<TPixel>, ReadOnlySpan<TPixelSrc>, float, Span<Vector4>)

Blends 2 rows together using caller-provided temporary vector scratch.

public void Blend<TPixelSrc>(Configuration configuration, Span<TPixel> destination, ReadOnlySpan<TPixel> background, ReadOnlySpan<TPixelSrc> source, float amount, Span<Vector4> workingBuffer) where TPixelSrc : unmanaged, IPixel<TPixelSrc>

Parameters

configuration Configuration

Configuration to use internally

destination Span<TPixel>

the destination span

background ReadOnlySpan<TPixel>

the background span

source ReadOnlySpan<TPixelSrc>

the source span

amount float

A value between 0 and 1 indicating the weight of the second source vector. At amount = 0, "background" is returned, at amount = 1, "source" is returned.

workingBuffer Span<Vector4>

Reusable temporary vector scratch with capacity for at least 3 rows.

Type Parameters

TPixelSrc

the pixel format of the source span