Lines Matching refs:pool
17 #include "pool.h"
141 - pool allocation is used to allocate nodes (increased performance on large
165 inline Ocnode *ocnodeNew(pool<Ocnode> *pool)
167 Ocnode *node = pool->draw();
176 inline void ocnodeFree(pool<Ocnode> *pool, Ocnode *node) {
177 pool->drop(node);
184 static void octreeDelete(pool<Ocnode> *pool, Ocnode *node)
188 octreeDelete(pool, node->child[i]);
189 ocnodeFree(pool, node);
227 static void ocnodeLeaf(pool<Ocnode> *pool, Ocnode **ref, RGB rgb)
230 Ocnode *node = ocnodeNew(pool);
244 static int octreeMerge(pool<Ocnode> *pool, Ocnode *parent, Ocnode **ref, Ocnode *node1, Ocnode *node2)
271 octreeMerge(pool, node1, &node1->child[i], node1->child[i], node2);
284 octreeMerge(pool, node2, &node2->child[i], node2->child[i], node1);
291 newnode = ocnodeNew(pool);
310 octreeMerge(pool, newnode, &newnode->child[i],
312 ocnodeFree(pool, node1); ocnodeFree(pool, node2);
356 static void ocnodeStrip(pool<Ocnode> *pool, Ocnode **ref, int *count, unsigned long lvl)
365 ocnodeFree(pool, node);
379 ocnodeStrip(pool, &node->child[i], count, lvl);
404 ocnodeFree(pool, *lonelychild);
412 ocnodeFree(pool, node);
422 static void octreePrune(pool<Ocnode> *pool, Ocnode **ref, int ncolor)
434 ocnodeStrip(pool, ref, &n, (*ref)->mi);
442 static void octreeBuildArea(pool<Ocnode> *pool, RgbMap *rgbmap, Ocnode **ref,
450 ocnodeLeaf(pool, ref, rgbmap->getPixel(rgbmap, x1, y1));
453 octreeBuildArea(pool, rgbmap, &ref1, x1, y1, xm, y2, ncolor);
454 octreeBuildArea(pool, rgbmap, &ref2, xm, y1, x2, y2, ncolor);
455 octreeMerge(pool, NULL, ref, ref1, ref2);
459 octreeBuildArea(pool, rgbmap, &ref1, x1, y1, x2, ym, ncolor);
460 octreeBuildArea(pool, rgbmap, &ref2, x1, ym, x2, y2, ncolor);
461 octreeMerge(pool, NULL, ref, ref1, ref2);
472 static Ocnode *octreeBuild(pool<Ocnode> *pool, RgbMap *rgbmap, int ncolor)
476 octreeBuildArea(pool,
482 octreePrune(pool, &node, ncolor);
554 pool<Ocnode> pool;
558 tree = octreeBuild(&pool, rgbmap, ncolor);
569 octreeDelete(&pool, tree);