C# 클래스 AForge.Imaging.ColorReduction.ErrorDiffusionColorDithering

Base class for error diffusion color dithering.

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

Color dithering with error diffusion is based on the idea that each pixel from the specified source image is substituted with a best matching color (or better say with color's index) from the specified color table. However, the error (difference between color value in the source image and the best matching color) is diffused to neighbor pixels of the source image, which affects the way those pixels are substituted by colors from the specified table.

The image processing routine accepts 24/32 bpp color images for processing. As a result this routine produces 4 bpp or 8 bpp indexed image, which depends on size of the specified color table - 4 bpp result for color tables with 16 colors or less; 8 bpp result for larger color tables.

파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET

보호된 프로퍼티들

프로퍼티 타입 설명
height int
pixelSize int
stride int
width int
x int
y int

공개 메소드들

메소드 설명
Apply ( Bitmap sourceImage ) : Bitmap

Perform color dithering for the specified image.

Apply ( UnmanagedImage sourceImage ) : Bitmap

Perform color dithering for the specified image.

보호된 메소드들

메소드 설명
Diffuse ( int rError, int gError, int bError, byte ptr ) : void

Do error diffusion.

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

ErrorDiffusionColorDithering ( ) : System

Initializes a new instance of the ErrorDiffusionColorDithering class.

비공개 메소드들

메소드 설명
GetClosestColor ( int red, int green, int blue, byte &colorIndex ) : Color

메소드 상세

Apply() 공개 메소드

Perform color dithering for the specified image.
Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
public Apply ( Bitmap sourceImage ) : Bitmap
sourceImage System.Drawing.Bitmap Source image to do color dithering for.
리턴 System.Drawing.Bitmap

Apply() 공개 메소드

Perform color dithering for the specified image.
Unsupported pixel format of the source image. It must 24 or 32 bpp color image.
public Apply ( UnmanagedImage sourceImage ) : Bitmap
sourceImage AForge.Imaging.UnmanagedImage Source image to do color dithering for.
리턴 System.Drawing.Bitmap

Diffuse() 보호된 추상적인 메소드

Do error diffusion.
All parameters of the image and current processing pixel's coordinates are initialized in protected members.
protected abstract Diffuse ( int rError, int gError, int bError, byte ptr ) : void
rError int Error value of red component.
gError int Error value of green component.
bError int Error value of blue component.
ptr byte Pointer to current processing pixel.
리턴 void

ErrorDiffusionColorDithering() 보호된 메소드

Initializes a new instance of the ErrorDiffusionColorDithering class.
protected ErrorDiffusionColorDithering ( ) : System
리턴 System

프로퍼티 상세

height 보호되어 있는 프로퍼티

Processing image's height.
protected int height
리턴 int

pixelSize 보호되어 있는 프로퍼티

Processing image's pixel size in bytes.
protected int pixelSize
리턴 int

stride 보호되어 있는 프로퍼티

Processing image's stride (line size).
protected int stride
리턴 int

width 보호되어 있는 프로퍼티

Processing image's width.
protected int width
리턴 int

x 보호되어 있는 프로퍼티

Current processing X coordinate.
protected int x
리턴 int

y 보호되어 있는 프로퍼티

Current processing Y coordinate.
protected int y
리턴 int