C# Class PurplePen.OctreeQuantizer.Octree.OctreeNode

Class which encapsulates each node in the tree
Show file Open project: petergolde/PurplePen

Public Methods

Method Description
AddColor ( Color32 pixel, int colorBits, int level, Octree octree ) : void

Add a color into the tree

ConstructPalette ( ArrayList palette, int &paletteIndex ) : void

Traverse the tree, building up the color palette

GetPaletteIndex ( Color32 pixel, int level ) : int

Return the palette index for the passed color

Increment ( Color32 pixel ) : void

Increment the pixel count and add to the color information

OctreeNode ( int level, int colorBits, Octree octree ) : System

Construct the node

Reduce ( ) : int

Reduce this node by removing all of its children

Method Details

AddColor() public method

Add a color into the tree
public AddColor ( Color32 pixel, int colorBits, int level, Octree octree ) : void
pixel Color32 The color
colorBits int The number of significant color bits
level int The level in the tree
octree Octree The tree to which this node belongs
return void

ConstructPalette() public method

Traverse the tree, building up the color palette
public ConstructPalette ( ArrayList palette, int &paletteIndex ) : void
palette System.Collections.ArrayList The palette
paletteIndex int The current palette index
return void

GetPaletteIndex() public method

Return the palette index for the passed color
public GetPaletteIndex ( Color32 pixel, int level ) : int
pixel Color32
level int
return int

Increment() public method

Increment the pixel count and add to the color information
public Increment ( Color32 pixel ) : void
pixel Color32
return void

OctreeNode() public method

Construct the node
public OctreeNode ( int level, int colorBits, Octree octree ) : System
level int The level in the tree = 0 - 7
colorBits int The number of significant color bits in the image
octree Octree The tree to which this node belongs
return System

Reduce() public method

Reduce this node by removing all of its children
public Reduce ( ) : int
return int