コード例 #1
0
    void connectPixelsMaybeReplacingParent(const NodeType& firstNode,
            const NodeType& secondNode) {
        auto& isBefore = levelOrderComparator;
        auto firstNodeParentLevel = firstNode.getParent().getLevel();
        auto secondNodeLevel = secondNode.getLevel();

        if (isBefore(firstNodeParentLevel, secondNodeLevel))
            minMaxTree.setNodeParent(firstNode, secondNode);
    }
コード例 #2
0
    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());
    }