/src/bag/api/bag_vrrefinementsdescriptor.h
Line | Count | Source |
1 | | #ifndef BAG_VRREFINEMENTSDESCRIPTOR_H |
2 | | #define BAG_VRREFINEMENTSDESCRIPTOR_H |
3 | | |
4 | | #include "bag_config.h" |
5 | | #include "bag_fordec.h" |
6 | | #include "bag_layerdescriptor.h" |
7 | | |
8 | | |
9 | | namespace BAG { |
10 | | |
11 | | //! Describe the variable resolution refinements layer. |
12 | | class BAG_API VRRefinementsDescriptor final : public LayerDescriptor |
13 | | { |
14 | | public: |
15 | | VRRefinementsDescriptor(const VRRefinementsDescriptor&) = delete; |
16 | | VRRefinementsDescriptor(VRRefinementsDescriptor&&) = delete; |
17 | | |
18 | | VRRefinementsDescriptor& operator=(const VRRefinementsDescriptor&) = delete; |
19 | | VRRefinementsDescriptor& operator=(VRRefinementsDescriptor&&) = delete; |
20 | | |
21 | 0 | bool operator==(const VRRefinementsDescriptor &rhs) const noexcept { |
22 | 0 | return m_minDepth == rhs.m_minDepth && |
23 | 0 | m_maxDepth == rhs.m_maxDepth && |
24 | 0 | m_minUncertainty == rhs.m_minUncertainty && |
25 | 0 | m_maxUncertainty == rhs.m_maxUncertainty; |
26 | 0 | } |
27 | | |
28 | 0 | bool operator!=(const VRRefinementsDescriptor &rhs) const noexcept { |
29 | 0 | return !(rhs == *this); |
30 | 0 | } |
31 | | |
32 | | std::tuple<float, float> getMinMaxDepth() const noexcept; |
33 | | std::tuple<float, float> getMinMaxUncertainty() const noexcept; |
34 | | |
35 | | VRRefinementsDescriptor& setMinMaxDepth(float minDepth, |
36 | | float maxDepth) & noexcept; |
37 | | VRRefinementsDescriptor& setMinMaxUncertainty(float minUncertainty, |
38 | | float maxUncertainty) & noexcept; |
39 | | |
40 | | protected: |
41 | | VRRefinementsDescriptor(uint32_t id, uint32_t rows, uint32_t cols, |
42 | | uint64_t chunkSize, int compressionLevel); |
43 | | explicit VRRefinementsDescriptor(const Dataset& dataset, uint32_t rows, uint32_t cols); |
44 | | |
45 | | static std::shared_ptr<VRRefinementsDescriptor> create(const Dataset& dataset, |
46 | | uint64_t chunkSize, int compressionLevel); |
47 | | |
48 | | static std::shared_ptr<VRRefinementsDescriptor> open(const Dataset& dataset, |
49 | | uint32_t rows, uint32_t cols); |
50 | | |
51 | | private: |
52 | | DataType getDataTypeProxy() const noexcept override; |
53 | | uint8_t getElementSizeProxy() const noexcept override; |
54 | | |
55 | | //! The minimum depth. |
56 | | float m_minDepth = std::numeric_limits<float>::max(); |
57 | | //! The maximum depth. |
58 | | float m_maxDepth = std::numeric_limits<float>::lowest(); |
59 | | //! The minimum uncertainty. |
60 | | float m_minUncertainty = std::numeric_limits<float>::max(); |
61 | | //! The maximum uncertainty. |
62 | | float m_maxUncertainty = std::numeric_limits<float>::lowest(); |
63 | | |
64 | | friend Dataset; |
65 | | friend VRRefinements; |
66 | | }; |
67 | | |
68 | | } // namespace BAG |
69 | | |
70 | | #endif // BAG_VRREFINEMENTSDESCRIPTOR_H |
71 | | |