C# Класс AForge.Imaging.Filters.ErrorDiffusionDithering

Base class for error diffusion dithering.

The class is the base class for binarization algorithms based on error diffusion.

Binarization with error diffusion in its idea is similar to binarization based on thresholding of pixels' cumulative value (see ThresholdWithCarry). Each pixel is binarized based not only on its own value, but on values of some surrounding pixels. During pixel's binarization, its binarization error is distributed (diffused) to some neighbor pixels with some coefficients. This error diffusion updates neighbor pixels changing their values, what affects their upcoming binarization. Error diffuses only on unprocessed yet neighbor pixels, which are right and bottom pixels usually (in the case if image processing is done from upper left corner to bottom right corner). Binarization error equals to processing pixel value, if it is below threshold value, or pixel value minus 255 otherwise.

The filter accepts 8 bpp grayscale images for processing.

Наследование: BaseInPlacePartialFilter
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
startX int
startY int
stopX int
stopY int
stride int
x int
y int

Защищенные методы

Метод Описание
Diffuse ( int error, byte ptr ) : void

Do error diffusion.

All parameters of the image and current processing pixel's coordinates are initialized in protected members.

ErrorDiffusionDithering ( ) : System

Initializes a new instance of the ErrorDiffusionDithering class.

ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

Описание методов

Diffuse() защищенный абстрактный Метод

Do error diffusion.
All parameters of the image and current processing pixel's coordinates are initialized in protected members.
protected abstract Diffuse ( int error, byte ptr ) : void
error int Current error value.
ptr byte Pointer to current processing pixel.
Результат void

ErrorDiffusionDithering() защищенный Метод

Initializes a new instance of the ErrorDiffusionDithering class.
protected ErrorDiffusionDithering ( ) : System
Результат System

ProcessFilter() защищенный Метод

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
Результат void

Описание свойств

startX защищенное свойство

Processing X start position.
protected int startX
Результат int

startY защищенное свойство

Processing Y start position.
protected int startY
Результат int

stopX защищенное свойство

Processing X stop position.
protected int stopX
Результат int

stopY защищенное свойство

Processing Y stop position.
protected int stopY
Результат int

stride защищенное свойство

Processing image's stride (line size).
protected int stride
Результат int

x защищенное свойство

Current processing X coordinate.
protected int x
Результат int

y защищенное свойство

Current processing Y coordinate.
protected int y
Результат int