80 std::unique_ptr<std::vector<RGBXY>> m_pixels;
85 std::set<XY> m_edge_pixels {};
88 inline Node(int32_t
id, std::unique_ptr<std::vector<RGBXY>>& pixels)
90 , m_pixels(std::move(pixels)) {
95 std::array<int32_t, 4> bounding_box_xywh()
const;
96 std::array<int, 4> create_binary_image(std::vector<uint8_t>& binary)
const;
102 void clear_contour();
103 void compute_contour();
106 inline int32_t id()
const {
109 inline size_t area()
const {
110 return m_pixels->size();
112 inline const Node_set& edges()
const {
115 inline size_t num_edges()
const {
116 return m_edges.size();
118 inline const std::vector<RGBXY>& get_pixels()
const {
126 void add_pixels(
const std::vector<RGBXY>& new_pixels);
127 void add_edge_pixel(
const XY edge_pixel);
128 void clear_edge_pixels();
132 inline void add_edge(
const Node_ptr& node) {
133 m_edges.insert(node);
135 inline void remove_edge(
const Node_ptr& node) {
138 inline void remove_all_edges() {