Struct ErrorDither
An error diffusion dithering implementation.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing.Processors.Dithering
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct ErrorDither : IDither, IEquatable<ErrorDither>, IEquatable<IDither>
Constructors
| Edit this page View SourceErrorDither(in DenseMatrix<float>, int)
Initializes a new instance of the ErrorDither struct.
Declaration
public ErrorDither(in DenseMatrix<float> matrix, int offset)
Parameters
Type | Name | Description |
---|---|---|
DenseMatrix<float> | matrix | The diffusion matrix. |
int | offset | The starting offset within the matrix. |
Fields
| Edit this page View SourceAtkinson
Applies error diffusion based dithering using the Atkinson image dithering algorithm.
Declaration
public static readonly ErrorDither Atkinson
Field Value
Type | Description |
---|---|
ErrorDither |
Burkes
Applies error diffusion based dithering using the Burks image dithering algorithm.
Declaration
public static readonly ErrorDither Burkes
Field Value
Type | Description |
---|---|
ErrorDither |
FloydSteinberg
Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm.
Declaration
public static readonly ErrorDither FloydSteinberg
Field Value
Type | Description |
---|---|
ErrorDither |
JarvisJudiceNinke
Applies error diffusion based dithering using the Jarvis, Judice, Ninke image dithering algorithm.
Declaration
public static readonly ErrorDither JarvisJudiceNinke
Field Value
Type | Description |
---|---|
ErrorDither |
Sierra2
Applies error diffusion based dithering using the Sierra2 image dithering algorithm.
Declaration
public static readonly ErrorDither Sierra2
Field Value
Type | Description |
---|---|
ErrorDither |
Sierra3
Applies error diffusion based dithering using the Sierra3 image dithering algorithm.
Declaration
public static readonly ErrorDither Sierra3
Field Value
Type | Description |
---|---|
ErrorDither |
SierraLite
Applies error diffusion based dithering using the Sierra Lite image dithering algorithm.
Declaration
public static readonly ErrorDither SierraLite
Field Value
Type | Description |
---|---|
ErrorDither |
StevensonArce
Applies error diffusion based dithering using the Stevenson-Arce image dithering algorithm.
Declaration
public static readonly ErrorDither StevensonArce
Field Value
Type | Description |
---|---|
ErrorDither |
Stucki
Applies error diffusion based dithering using the Stucki image dithering algorithm.
Declaration
public static readonly ErrorDither Stucki
Field Value
Type | Description |
---|---|
ErrorDither |
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(ErrorDither)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(ErrorDither other)
Parameters
Type | Name | Description |
---|---|---|
ErrorDither | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
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(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 ==(ErrorDither, ErrorDither)
Compares the two ErrorDither instances to determine whether they are equal.
Declaration
public static bool operator ==(ErrorDither left, ErrorDither right)
Parameters
Type | Name | Description |
---|---|---|
ErrorDither | left | The first source instance. |
ErrorDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator ==(ErrorDither, IDither)
Compares the two ErrorDither instances to determine whether they are equal.
Declaration
public static bool operator ==(ErrorDither left, IDither right)
Parameters
Type | Name | Description |
---|---|---|
ErrorDither | left | The first source instance. |
IDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator ==(IDither, ErrorDither)
Compares the two ErrorDither instances to determine whether they are equal.
Declaration
public static bool operator ==(IDither left, ErrorDither right)
Parameters
Type | Name | Description |
---|---|---|
IDither | left | The first source instance. |
ErrorDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator !=(ErrorDither, ErrorDither)
Compares the two ErrorDither instances to determine whether they are unequal.
Declaration
public static bool operator !=(ErrorDither left, ErrorDither right)
Parameters
Type | Name | Description |
---|---|---|
ErrorDither | left | The first source instance. |
ErrorDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator !=(ErrorDither, IDither)
Compares the two ErrorDither instances to determine whether they are unequal.
Declaration
public static bool operator !=(ErrorDither left, IDither right)
Parameters
Type | Name | Description |
---|---|---|
ErrorDither | left | The first source instance. |
IDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |
operator !=(IDither, ErrorDither)
Compares the two ErrorDither instances to determine whether they are unequal.
Declaration
public static bool operator !=(IDither left, ErrorDither right)
Parameters
Type | Name | Description |
---|---|---|
IDither | left | The first source instance. |
ErrorDither | right | The second source instance. |
Returns
Type | Description |
---|---|
bool | The bool. |