protected virtual void Propage(int r,int g,int b) { var code = GetCode(r, g, b); if (IsLeaf) { SetSubCount(code, SubCount[code] + 1); return; } if (Roots[code] == null) { Roots[code] = new OctNode(this,code,Level + 1, Level == 6); } Roots[code].Add(r, g, b); return; }
internal OctNode(OctNode parent,int index,int nivel,bool leaf=false) { Parent = parent; Index = index; Level = nivel; MaxLevel = nivel; IsLeaf = leaf; Parent?.SetSubLeafCount(index, IsLeaf?1:0); BaseColor = Color32.BitMask(8 - nivel, Index) | (Parent?.BaseColor??Color.Black); }