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); }
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()); }