72 std::unique_ptr<std::vector<RGBXY>> m_pixels;
73 std::set<Node_ptr> m_edges {};
77 std::set<XY> m_edge_pixels {};
80 inline Node(int32_t
id, std::unique_ptr<std::vector<RGBXY>>& pixels)
82 , m_pixels(std::move(pixels)) {
87 std::array<int32_t, 4> bounding_box_xywh()
const;
88 std::array<int, 4> create_binary_image(std::vector<uint8_t>& binary)
const;
95 void compute_contour();
98 inline int32_t id()
const {
101 inline size_t area()
const {
102 return m_pixels->size();
104 inline const std::set<Node_ptr>& edges()
const {
107 inline size_t num_edges()
const {
108 return m_edges.size();
110 inline const std::vector<RGBXY>& get_pixels()
const {
118 void add_pixels(
const std::vector<RGBXY>& new_pixels);
119 void add_edge_pixel(
const XY edge_pixel);
120 void clear_edge_pixels();
124 inline void add_edge(
const Node_ptr& node) {
125 m_edges.insert(node);
127 inline void remove_edge(
const Node_ptr& node) {
130 inline void remove_all_edges() {