isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
LabelMap.h
1 #pragma once
2 
3 #include <cstddef> // size_t
4 #include <cstdint> // uint8_t
5 #include <vector> // std::vector
6 
7 namespace isce3::unwrap::icu
8 {
9 
10 // \brief Table of connected component label equivalences
11 //
12 // Maintains a list of all connected component labels along with a mapping
13 // to their minimum equivalent label.
14 class LabelMap
15 {
16 public:
17  // Constructor
18  LabelMap();
19  // Add new label to table and return the label.
20  uint8_t nextlabel();
21  // Get mapped label.
22  uint8_t getlabel(const uint8_t) const;
23  // Update a label mapping.
24  void setlabel(const uint8_t oldlabel, const uint8_t newlabel);
25  // Get number of labels.
26  size_t size() const;
27 
28 private:
29  // Table of label mappings.
30  std::vector<uint8_t> _labels;
31 };
32 
33 }
34 
35 // Get inline implementations.
36 #define ISCE_UNWRAP_ICU_LABELMAP_ICC
37 #include "LabelMap.icc"
38 #undef ISCE_UNWRAP_ICU_LABELMAP_ICC
Definition: LabelMap.h:14

Generated for ISCE3.0 by doxygen 1.8.5.