Struct OrderedDither
An ordered dithering matrix with equal sides of arbitrary length
Inherited Members
Namespace: SixLabors.ImageSharp.Processing.Processors.Dithering
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct OrderedDither : IDither, IEquatable<OrderedDither>, IEquatable<IDither>
Constructors
| Edit this page View SourceOrderedDither(uint)
Initializes a new instance of the OrderedDither struct.
Declaration
public OrderedDither(uint length)
Parameters
Type | Name | Description |
---|---|---|
uint | length | The length of the matrix sides |
Fields
| Edit this page View SourceBayer16x16
Applies order dithering using the 16x16 Bayer dithering matrix.
Declaration
public static readonly OrderedDither Bayer16x16
Field Value
Type | Description |
---|---|
OrderedDither |
Bayer2x2
Applies order dithering using the 2x2 Bayer dithering matrix.
Declaration
public static readonly OrderedDither Bayer2x2
Field Value
Type | Description |
---|---|
OrderedDither |
Bayer4x4
Applies order dithering using the 4x4 Bayer dithering matrix.
Declaration
public static readonly OrderedDither Bayer4x4
Field Value
Type | Description |
---|---|
OrderedDither |
Bayer8x8
Applies order dithering using the 8x8 Bayer dithering matrix.
Declaration
public static readonly OrderedDither Bayer8x8
Field Value
Type | Description |
---|---|
OrderedDither |
Ordered3x3
Applies order dithering using the 3x3 ordered dithering matrix.
Declaration
public static readonly OrderedDither Ordered3x3
Field Value
Type | Description |
---|---|
OrderedDither |
Methods
| Edit this page View SourceApplyPaletteDither<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.
Declaration
public void ApplyPaletteDither<TPaletteDitherImageProcessor, TPixel>(in TPaletteDitherImageProcessor processor, ImageFrame<TPixel> source, Rectangle bounds) where TPaletteDitherImageProcessor : struct, IPaletteDitherImageProcessor<TPixel> where TPixel : unmanaged, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
TPaletteDitherImageProcessor | processor | The palette dithering processor. |
ImageFrame<TPixel> | source | The source image. |
Rectangle | bounds | The region of interest bounds. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
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
Type | Name | Description |
---|---|---|
TFrameQuantizer | quantizer | The frame quantizer. |
ImageFrame<TPixel> | source | The source image. |
IndexedImageFrame<TPixel> | destination | The destination quantized frame. |
Rectangle | bounds | The region of interest bounds. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public bool Equals(IDither? other)
Parameters
Type | Name | Description |
---|---|---|
IDither | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(OrderedDither)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(OrderedDither other)
Parameters
Type | Name | Description |
---|---|---|
OrderedDither | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
Operators
| Edit this page View Sourceoperator ==(IDither, OrderedDither)
Compares the two OrderedDither instances to determine whether they are equal.
Declaration
public static bool operator ==(IDither left, OrderedDither right)
Parameters
Type | Name | Description |
---|---|---|
IDither | left | The first source instance. |
OrderedDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator ==(OrderedDither, IDither)
Compares the two OrderedDither instances to determine whether they are equal.
Declaration
public static bool operator ==(OrderedDither left, IDither right)
Parameters
Type | Name | Description |
---|---|---|
OrderedDither | left | The first source instance. |
IDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator ==(OrderedDither, OrderedDither)
Compares the two OrderedDither instances to determine whether they are equal.
Declaration
public static bool operator ==(OrderedDither left, OrderedDither right)
Parameters
Type | Name | Description |
---|---|---|
OrderedDither | left | The first source instance. |
OrderedDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator !=(IDither, OrderedDither)
Compares the two OrderedDither instances to determine whether they are unequal.
Declaration
public static bool operator !=(IDither left, OrderedDither right)
Parameters
Type | Name | Description |
---|---|---|
IDither | left | The first source instance. |
OrderedDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator !=(OrderedDither, IDither)
Compares the two OrderedDither instances to determine whether they are unequal.
Declaration
public static bool operator !=(OrderedDither left, IDither right)
Parameters
Type | Name | Description |
---|---|---|
OrderedDither | left | The first source instance. |
IDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator !=(OrderedDither, OrderedDither)
Compares the two OrderedDither instances to determine whether they are unequal.
Declaration
public static bool operator !=(OrderedDither left, OrderedDither right)
Parameters
Type | Name | Description |
---|---|---|
OrderedDither | left | The first source instance. |
OrderedDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |