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

Median cut color quantization algorithm.

The class implements median cut color quantization algorithm.

See also ColorImageQuantizer class, which may simplify processing of images.

Sample usage:

// create the color quantization algorithm IColorQuantizer quantizer = new MedianCutQuantizer( ); // process colors (taken from image for example) for ( int i = 0; i < pixelsToProcess; i++ ) { quantizer.AddColor( /* pixel coloer */ ); } // get palette reduced to 16 colors Color[] palette = quantizer.GetPalette( 16 );
상속: IColorQuantizer
파일 보기 프로젝트 열기: noxryan/Claro-Shader 1 사용 예제들

공개 메소드들

메소드 설명
AddColor ( Color color ) : void

Add color to the list of processed colors.

The method adds the specified color into internal list of processed colors. The list is used later by GetPalette method to build reduced color table of the specified size.

Clear ( ) : void

Clear internal state of the color quantization algorithm by clearing the list of colors so far processed.

GetPalette ( int colorCount ) : Color[]

Get paletter of the specified size.

The method must be called after continuously calling AddColor method and returns reduced color palette for colors accumulated/processed so far.

비공개 메소드들

메소드 설명
SplitCubes ( List cubes, int count ) : void

메소드 상세

AddColor() 공개 메소드

Add color to the list of processed colors.

The method adds the specified color into internal list of processed colors. The list is used later by GetPalette method to build reduced color table of the specified size.

public AddColor ( Color color ) : void
color Color Color to add to the internal list.
리턴 void

Clear() 공개 메소드

Clear internal state of the color quantization algorithm by clearing the list of colors so far processed.
public Clear ( ) : void
리턴 void

GetPalette() 공개 메소드

Get paletter of the specified size.

The method must be called after continuously calling AddColor method and returns reduced color palette for colors accumulated/processed so far.

public GetPalette ( int colorCount ) : Color[]
colorCount int Palette size to get.
리턴 Color[]