bool pixelIsAssignedToNode(unsigned int x, unsigned int y, const NodeType& node) { auto pixelNodeId = nodeIdImage.getPixelValue(x, y); auto pixelNodeLevel = internalImage.getPixelValue(x, y); return pixelNodeId == node.getId() && pixelNodeLevel == node.getLevel(); }
void removeRootNode(const NodeType& node) { minMaxTree.removeNode(node.getLevel(), node.getId()); auto newColor = minMaxTree.getFirstLevel(); auto newId = 0u; updatePixelsIfOnCollapsedLevel(newColor, newId); updatePixelsIfAssignedToNode(node, newColor, newId); }
void removeNormalNode(const NodeType& node) { auto& parent = node.getParent(); auto newColor = parent.getLevel(); auto newId = parent.getId(); updatePixelsIfAssignedToNode(node, newColor, newId); minMaxTree.removeNode(node.getLevel(), node.getId()); }
void assignPixelToNode(unsigned int x, unsigned int y, const NodeType& node) { nodeIdImage.setPixel(x, y, node.getId()); }