C# 클래스 SimplePaletteQuantizer.Quantizers.Octree.OctreeQuantizer

The idea here is to build a tree structure containing always a maximum of K different colors. If a further color is to be added to the tree structure, its color value has to be merged with the most likely one that is already in the tree. The both values are substituted by their mean. The most important data structure are the nodes of the octree. Each inner node of the octree contain a maximum of eight successors, the leave nodes keep information for the color value (colorvalue), the color index (colorindex), and a counter (colorcount) for the pixel that are already mapped to a particular leave. Because each of the red, green and blue value is between 0 and 255 the maximum depth of the tree is eight. In level i Bit i of RGB is used as selector for the successors. The octree is constructed during reading the image that is to be quantized. Only that parts of the octree are created that are really needed. Initially the first K values are represented exactly (in level eight). When the number of leaves nodes (currentK) exceeds K, the tree has to reduced. That would mean that leaves at the largest depth are substituted by their predecessor.
상속: BaseColorQuantizer
파일 보기 프로젝트 열기: RHY3756547/FreeSO 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AddLevelNode void

보호된 메소드들

메소드 설명
OnAddColor ( Color color, Int32 key, Int32 x, Int32 y ) : void

See BaseColorQuantizer.OnAddColor for more details.

OnFinish ( ) : void

See BaseColorQuantizer.OnFinish for more details.

OnGetColorCount ( ) : Int32

See BaseColorQuantizer.OnGetColorCount for more details.

OnGetPalette ( Int32 colorCount ) : List

See BaseColorQuantizer.OnGetPalette for more details.

OnGetPaletteIndex ( Color color, Int32 key, Int32 x, Int32 y, Int32 &paletteIndex ) : void

See BaseColorQuantizer.OnGetPaletteIndex for more details.

OnPrepare ( ImageBuffer image ) : void

See BaseColorQuantizer.OnPrepare for more details.

비공개 메소드들

메소드 설명
AddLevelNode ( Int32 level, OctreeNode octreeNode ) : void

Adds the node to a level node list.

메소드 상세

OnAddColor() 보호된 메소드

See BaseColorQuantizer.OnAddColor for more details.
protected OnAddColor ( Color color, Int32 key, Int32 x, Int32 y ) : void
color Color
key System.Int32
x System.Int32
y System.Int32
리턴 void

OnFinish() 보호된 메소드

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

OnGetColorCount() 보호된 메소드

See BaseColorQuantizer.OnGetColorCount for more details.
protected OnGetColorCount ( ) : Int32
리턴 System.Int32

OnGetPalette() 보호된 메소드

See BaseColorQuantizer.OnGetPalette for more details.
protected OnGetPalette ( Int32 colorCount ) : List
colorCount System.Int32
리턴 List

OnGetPaletteIndex() 보호된 메소드

See BaseColorQuantizer.OnGetPaletteIndex for more details.
protected OnGetPaletteIndex ( Color color, Int32 key, Int32 x, Int32 y, Int32 &paletteIndex ) : void
color Color
key System.Int32
x System.Int32
y System.Int32
paletteIndex System.Int32
리턴 void

OnPrepare() 보호된 메소드

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