ErrorDiffusionToAdjacentNeighbors Class |
Namespace: Accord.Imaging.Filters
The ErrorDiffusionToAdjacentNeighbors type exposes the following members.
Name | Description | |
---|---|---|
ErrorDiffusionToAdjacentNeighbors |
Initializes a new instance of the ErrorDiffusionToAdjacentNeighbors class.
|
Name | Description | |
---|---|---|
Coefficients |
Diffusion coefficients.
| |
FormatTranslations |
Format translations dictionary.
(Inherited from ErrorDiffusionDithering.) | |
ThresholdValue |
Threshold value.
(Inherited from ErrorDiffusionDithering.) |
Name | Description | |
---|---|---|
Apply(Bitmap) |
Apply filter to an image.
(Inherited from BaseInPlacePartialFilter.) | |
Apply(BitmapData) |
Apply filter to an image.
(Inherited from BaseInPlacePartialFilter.) | |
Apply(UnmanagedImage) |
Apply filter to an image in unmanaged memory.
(Inherited from BaseInPlacePartialFilter.) | |
Apply(UnmanagedImage, UnmanagedImage) |
Apply filter to an image in unmanaged memory.
(Inherited from BaseInPlacePartialFilter.) | |
ApplyInPlace(Bitmap) |
Apply filter to an image.
(Inherited from BaseInPlacePartialFilter.) | |
ApplyInPlace(BitmapData) |
Apply filter to an image.
(Inherited from BaseInPlacePartialFilter.) | |
ApplyInPlace(UnmanagedImage) |
Apply filter to an unmanaged image.
(Inherited from BaseInPlacePartialFilter.) | |
ApplyInPlace(Bitmap, Rectangle) |
Apply filter to an image or its part.
(Inherited from BaseInPlacePartialFilter.) | |
ApplyInPlace(BitmapData, Rectangle) |
Apply filter to an image or its part.
(Inherited from BaseInPlacePartialFilter.) | |
ApplyInPlace(UnmanagedImage, Rectangle) |
Apply filter to an unmanaged image or its part.
(Inherited from BaseInPlacePartialFilter.) | |
Diffuse |
Do error diffusion.
(Overrides ErrorDiffusionDitheringDiffuse(Int32, Byte*).) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ProcessFilter |
Process the filter on the specified image.
(Inherited from ErrorDiffusionDithering.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
startX |
Processing X start position.
(Inherited from ErrorDiffusionDithering.) | |
startY |
Processing Y start position.
(Inherited from ErrorDiffusionDithering.) | |
stopX |
Processing X stop position.
(Inherited from ErrorDiffusionDithering.) | |
stopY |
Processing Y stop position.
(Inherited from ErrorDiffusionDithering.) | |
stride |
Processing image's stride (line size).
(Inherited from ErrorDiffusionDithering.) | |
x |
Current processing X coordinate.
(Inherited from ErrorDiffusionDithering.) | |
y |
Current processing Y coordinate.
(Inherited from ErrorDiffusionDithering.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
The class does error diffusion to adjacent neighbor pixels using specified set of coefficients. These coefficients are represented by 2 dimensional jugged array, where first array of coefficients is for right-standing pixels, but the rest of arrays are for bottom-standing pixels. All arrays except the first one should have odd number of coefficients.
Suppose that error diffusion coefficients are represented by the next jugged array:
int[][] coefficients = new int[2][] { new int[1] { 7 }, new int[3] { 3, 5, 1 } };
The above coefficients are used to diffuse error over the next neighbor pixels (* marks current pixel, coefficients are placed to corresponding neighbor pixels):
| * | 7 | | 3 | 5 | 1 | / 16
The filter accepts 8 bpp grayscale images for processing.
Sample usage:
// create filter ErrorDiffusionToAdjacentNeighbors filter = new ErrorDiffusionToAdjacentNeighbors( new int[3][] { new int[2] { 5, 3 }, new int[5] { 2, 4, 5, 4, 2 }, new int[3] { 2, 3, 2 } } ); // apply the filter filter.ApplyInPlace( image );