internal void AddColor(Color32* pixel, int level,OcTree tree)
{
//�������Ҷ�ˣ���ʾһ����ɫ����������
if (this.Leaf)
{
Increment(pixel);
tree.TracePrevious(this);
return;
}
int shift = 7 - level;
int index = ((pixel->Red & mask[level]) >> (shift - 2)) |
((pixel->Green & mask[level]) >> (shift - 1)) |
((pixel->Blue & mask[level]) >> (shift));
OcTreeNode child = Children[index];
if (child == null)
{
child = new OcTreeNode(ColorDepth, level+1, tree);
Children[index] = child;
}
child.AddColor(pixel, ++level,tree);
}