C# 클래스 SimplePaletteQuantizer.Quantizers.MedianCut.MedianCutQuantizer

The premise behind median cut algorithms is to have every entry in the color map represent the same number of pixels in the original image. In contrast to uniform sub-division, these algorithms divide the color space based on the distribution of the original colors. The process is as follows[2]: 1. Find the smallest box which contains all the colors in the image. 2. Sort the enclosed colors along the longest axis of the box. 3. Split the box into 2 regions at median of the sorted list. 4. Repeat the above process until the original color space has been divided into 256 regions. 5. The algorithm then divides the color space in a manner depicted below. 6. The representative colors are found by averaging the colors in each box, and the appropriate color map index assigned to each color in that box. Because these algorithms use image information in dividing the color space this class of algorithms consistently produce good results while having memory and time complexity no worse than popularity algorithms[1].
상속: BaseColorCacheQuantizer
파일 보기 프로젝트 열기: RHY3756547/FreeSO 1 사용 예제들

공개 메소드들

메소드 설명
GetPaletteIndex ( Color color, Int32 &paletteIndex ) : void

See IColorQuantizer.GetPaletteIndex for more details.

보호된 메소드들

메소드 설명
OnCreateDefaultCache ( ) : IColorCache

See BaseColorCacheQuantizer.OnCreateDefaultCache for more details.

OnFinish ( ) : void

See BaseColorQuantizer.OnFinish for more details.

OnGetPaletteToCache ( Int32 colorCount ) : List

See BaseColorCacheQuantizer.OnGetPaletteToCache for more details.

OnPrepare ( ImageBuffer image ) : void

See IColorQuantizer.Prepare for more details.

비공개 메소드들

메소드 설명
SplitCubes ( Int32 colorCount ) : void

Splits all the cubes on the list.

메소드 상세

GetPaletteIndex() 공개 메소드

See IColorQuantizer.GetPaletteIndex for more details.
public GetPaletteIndex ( Color color, Int32 &paletteIndex ) : void
color Color
paletteIndex System.Int32
리턴 void

OnCreateDefaultCache() 보호된 메소드

See BaseColorCacheQuantizer.OnCreateDefaultCache for more details.
protected OnCreateDefaultCache ( ) : IColorCache
리턴 IColorCache

OnFinish() 보호된 메소드

See BaseColorQuantizer.OnFinish for more details.
protected OnFinish ( ) : void
리턴 void

OnGetPaletteToCache() 보호된 메소드

See BaseColorCacheQuantizer.OnGetPaletteToCache for more details.
protected OnGetPaletteToCache ( Int32 colorCount ) : List
colorCount System.Int32
리턴 List

OnPrepare() 보호된 메소드

See IColorQuantizer.Prepare for more details.
protected OnPrepare ( ImageBuffer image ) : void
image SimplePaletteQuantizer.Helpers.ImageBuffer
리턴 void