Table of Contents

Struct OrderedDither

Namespace
SixLabors.ImageSharp.Processing.Processors.Dithering
Assembly
SixLabors.ImageSharp.dll

An ordered dithering matrix with equal sides of arbitrary length

public readonly struct OrderedDither : IDither, IEquatable<OrderedDither>, IEquatable<IDither>
Implements
Inherited Members

Constructors

OrderedDither(uint)

Initializes a new instance of the OrderedDither struct.

public OrderedDither(uint length)

Parameters

length uint

The length of the matrix sides

Fields

Bayer16x16

Applies order dithering using the 16x16 Bayer dithering matrix.

public static readonly OrderedDither Bayer16x16

Field Value

OrderedDither

Bayer2x2

Applies order dithering using the 2x2 Bayer dithering matrix.

public static readonly OrderedDither Bayer2x2

Field Value

OrderedDither

Bayer4x4

Applies order dithering using the 4x4 Bayer dithering matrix.

public static readonly OrderedDither Bayer4x4

Field Value

OrderedDither

Bayer8x8

Applies order dithering using the 8x8 Bayer dithering matrix.

public static readonly OrderedDither Bayer8x8

Field Value

OrderedDither

Ordered3x3

Applies order dithering using the 3x3 ordered dithering matrix.

public static readonly OrderedDither Ordered3x3

Field Value

OrderedDither

Methods

ApplyPaletteDither<TPaletteDitherImageProcessor, TPixel>(in TPaletteDitherImageProcessor, ImageFrame<TPixel>, Rectangle)

Transforms the image frame applying a dither matrix. This method should be treated as destructive, altering the input pixels.

public void ApplyPaletteDither<TPaletteDitherImageProcessor, TPixel>(in TPaletteDitherImageProcessor processor, ImageFrame<TPixel> source, Rectangle bounds) where TPaletteDitherImageProcessor : struct, IPaletteDitherImageProcessor<TPixel> where TPixel : unmanaged, IPixel<TPixel>

Parameters

processor TPaletteDitherImageProcessor

The palette dithering processor.

source ImageFrame<TPixel>

The source image.

bounds Rectangle

The region of interest bounds.

Type Parameters

TPaletteDitherImageProcessor

The type of palette dithering processor.

TPixel

The pixel format.

ApplyQuantizationDither<TFrameQuantizer, TPixel>(ref TFrameQuantizer, ImageFrame<TPixel>, IndexedImageFrame<TPixel>, Rectangle)

Transforms the quantized image frame applying a dither matrix. This method should be treated as destructive, altering the input pixels.

public void ApplyQuantizationDither<TFrameQuantizer, TPixel>(ref TFrameQuantizer quantizer, ImageFrame<TPixel> source, IndexedImageFrame<TPixel> destination, Rectangle bounds) where TFrameQuantizer : struct, IQuantizer<TPixel> where TPixel : unmanaged, IPixel<TPixel>

Parameters

quantizer TFrameQuantizer

The frame quantizer.

source ImageFrame<TPixel>

The source image.

destination IndexedImageFrame<TPixel>

The destination quantized frame.

bounds Rectangle

The region of interest bounds.

Type Parameters

TFrameQuantizer

The type of frame quantizer.

TPixel

The pixel format.

Equals(IDither?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(IDither? other)

Parameters

other IDither

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(OrderedDither)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(OrderedDither other)

Parameters

other OrderedDither

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(IDither, OrderedDither)

Compares the two OrderedDither instances to determine whether they are equal.

public static bool operator ==(IDither left, OrderedDither right)

Parameters

left IDither

The first source instance.

right OrderedDither

The second source instance.

Returns

bool

The bool.

operator ==(OrderedDither, IDither)

Compares the two OrderedDither instances to determine whether they are equal.

public static bool operator ==(OrderedDither left, IDither right)

Parameters

left OrderedDither

The first source instance.

right IDither

The second source instance.

Returns

bool

The bool.

operator ==(OrderedDither, OrderedDither)

Compares the two OrderedDither instances to determine whether they are equal.

public static bool operator ==(OrderedDither left, OrderedDither right)

Parameters

left OrderedDither

The first source instance.

right OrderedDither

The second source instance.

Returns

bool

The bool.

operator !=(IDither, OrderedDither)

Compares the two OrderedDither instances to determine whether they are unequal.

public static bool operator !=(IDither left, OrderedDither right)

Parameters

left IDither

The first source instance.

right OrderedDither

The second source instance.

Returns

bool

The bool.

operator !=(OrderedDither, IDither)

Compares the two OrderedDither instances to determine whether they are unequal.

public static bool operator !=(OrderedDither left, IDither right)

Parameters

left OrderedDither

The first source instance.

right IDither

The second source instance.

Returns

bool

The bool.

operator !=(OrderedDither, OrderedDither)

Compares the two OrderedDither instances to determine whether they are unequal.

public static bool operator !=(OrderedDither left, OrderedDither right)

Parameters

left OrderedDither

The first source instance.

right OrderedDither

The second source instance.

Returns

bool

The bool.