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
| Improve this Doc View SourceErrorDither(in DenseMatrix<Single>, Int32)
Initializes a new instance of the ErrorDither struct.
Declaration
public ErrorDither(in DenseMatrix<float> matrix, int offset)Parameters
| Type | Name | Description | 
|---|---|---|
| DenseMatrix<Single> | matrix | The diffusion matrix. | 
| Int32 | offset | The starting offset within the matrix. | 
Fields
| Improve this Doc View SourceAtkinson
Applies error diffusion based dithering using the Atkinson image dithering algorithm.
Declaration
public static ErrorDither AtkinsonField Value
| Type | Description | 
|---|---|
| ErrorDither | 
Burkes
Applies error diffusion based dithering using the Burks image dithering algorithm.
Declaration
public static ErrorDither BurkesField Value
| Type | Description | 
|---|---|
| ErrorDither | 
FloydSteinberg
Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm.
Declaration
public static ErrorDither FloydSteinbergField Value
| Type | Description | 
|---|---|
| ErrorDither | 
JarvisJudiceNinke
Applies error diffusion based dithering using the Jarvis, Judice, Ninke image dithering algorithm.
Declaration
public static ErrorDither JarvisJudiceNinkeField Value
| Type | Description | 
|---|---|
| ErrorDither | 
Sierra2
Applies error diffusion based dithering using the Sierra2 image dithering algorithm.
Declaration
public static ErrorDither Sierra2Field Value
| Type | Description | 
|---|---|
| ErrorDither | 
Sierra3
Applies error diffusion based dithering using the Sierra3 image dithering algorithm.
Declaration
public static ErrorDither Sierra3Field Value
| Type | Description | 
|---|---|
| ErrorDither | 
SierraLite
Applies error diffusion based dithering using the Sierra Lite image dithering algorithm.
Declaration
public static ErrorDither SierraLiteField Value
| Type | Description | 
|---|---|
| ErrorDither | 
StevensonArce
Applies error diffusion based dithering using the Stevenson-Arce image dithering algorithm.
Declaration
public static ErrorDither StevensonArceField Value
| Type | Description | 
|---|---|
| ErrorDither | 
Stucki
Applies error diffusion based dithering using the Stucki image dithering algorithm.
Declaration
public static ErrorDither StuckiField Value
| Type | Description | 
|---|---|
| ErrorDither | 
Methods
| Improve this Doc 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 readonly void ApplyPaletteDither<TPaletteDitherImageProcessor, TPixel>(in TPaletteDitherImageProcessor processor, ImageFrame<TPixel> source, Rectangle bounds)
    where TPaletteDitherImageProcessor : struct, IPaletteDitherImageProcessor<TPixel> where TPixel : struct, 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 readonly void ApplyQuantizationDither<TFrameQuantizer, TPixel>(ref TFrameQuantizer quantizer, ImageFrame<TPixel> source, IndexedImageFrame<TPixel> destination, Rectangle bounds)
    where TFrameQuantizer : struct, IQuantizer<TPixel> where TPixel : struct, 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)
Declaration
public readonly bool Equals(ErrorDither other)Parameters
| Type | Name | Description | 
|---|---|---|
| ErrorDither | other | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
Equals(IDither)
Declaration
public readonly bool Equals(IDither other)Parameters
| Type | Name | Description | 
|---|---|---|
| IDither | other | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
Equals(Object)
Declaration
public override readonly bool Equals(object obj)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override readonly int GetHashCode()Returns
| Type | Description | 
|---|---|
| Int32 | 
Overrides
Operators
| Improve this Doc View SourceEquality(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 | 
|---|---|
| Boolean | The Boolean. | 
Equality(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 | 
|---|---|
| Boolean | The Boolean. | 
Equality(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 | 
|---|---|
| Boolean | The Boolean. | 
Inequality(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 | 
|---|---|
| Boolean | The Boolean. | 
Inequality(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 | 
|---|---|
| Boolean | The Boolean. | 
Inequality(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 | 
|---|---|
| Boolean | The Boolean. |