C# 클래스 AForge.Imaging.Filters.ErrorDiffusionToAdjacentNeighbors

Base class for error diffusion dithering, where error is diffused to adjacent neighbor pixels.

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 );
상속: ErrorDiffusionDithering
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET

공개 메소드들

메소드 설명
ErrorDiffusionToAdjacentNeighbors ( int coefficients ) : System

Initializes a new instance of the ErrorDiffusionToAdjacentNeighbors class.

보호된 메소드들

메소드 설명
Diffuse ( int error, byte ptr ) : void

Do error diffusion.

All parameters of the image and current processing pixel's coordinates are initialized by base class.

비공개 메소드들

메소드 설명
CalculateCoefficientsSum ( ) : void

메소드 상세

Diffuse() 보호된 메소드

Do error diffusion.
All parameters of the image and current processing pixel's coordinates are initialized by base class.
protected Diffuse ( int error, byte ptr ) : void
error int Current error value.
ptr byte Pointer to current processing pixel.
리턴 void

ErrorDiffusionToAdjacentNeighbors() 공개 메소드

Initializes a new instance of the ErrorDiffusionToAdjacentNeighbors class.
public ErrorDiffusionToAdjacentNeighbors ( int coefficients ) : System
coefficients int Diffusion coefficients.
리턴 System