-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbag_vrmetadatadescriptor.h
More file actions
84 lines (66 loc) · 3.08 KB
/
bag_vrmetadatadescriptor.h
File metadata and controls
84 lines (66 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef BAG_VRMETADATADESCRIPTOR_H
#define BAG_VRMETADATADESCRIPTOR_H
#include "bag_config.h"
#include "bag_fordec.h"
#include "bag_layerdescriptor.h"
namespace BAG {
//! Describe the variable resolution metadata.
class BAG_API VRMetadataDescriptor final : public LayerDescriptor
{
public:
VRMetadataDescriptor(const VRMetadataDescriptor&) = delete;
VRMetadataDescriptor(VRMetadataDescriptor&&) = delete;
VRMetadataDescriptor& operator=(const VRMetadataDescriptor&) = delete;
VRMetadataDescriptor& operator=(VRMetadataDescriptor&&) = delete;
bool operator==(const VRMetadataDescriptor &rhs) const noexcept {
return m_minDimX == rhs.m_minDimX &&
m_minDimY == rhs.m_minDimY &&
m_maxDimX == rhs.m_maxDimX &&
m_maxDimY == rhs.m_maxDimY &&
m_minResX == rhs.m_minResX &&
m_minResY == rhs.m_minResY &&
m_maxResX == rhs.m_maxResX &&
m_maxResY == rhs.m_maxResY;
}
bool operator!=(const VRMetadataDescriptor &rhs) const noexcept {
return !(rhs == *this);
}
std::tuple<uint32_t, uint32_t> getMaxDimensions() const noexcept;
std::tuple<float, float> getMaxResolution() const noexcept;
std::tuple<uint32_t, uint32_t> getMinDimensions() const noexcept;
std::tuple<float, float> getMinResolution() const noexcept;
VRMetadataDescriptor& setMaxDimensions(uint32_t maxDimX, uint32_t maxDimY) & noexcept;
VRMetadataDescriptor& setMaxResolution(float maxResX, float maxResY) & noexcept;
VRMetadataDescriptor& setMinDimensions(uint32_t minDimX, uint32_t minDimY) & noexcept;
VRMetadataDescriptor& setMinResolution(float minResX, float minResY) & noexcept;
protected:
VRMetadataDescriptor(uint32_t id, uint32_t rows, uint32_t cols, uint64_t chunkSize,
int compressionLevel);
explicit VRMetadataDescriptor(const Dataset& dataset, uint32_t rows, uint32_t cols);
static std::shared_ptr<VRMetadataDescriptor> create(const Dataset& dataset,
uint64_t chunkSize, int compressionLevel);
static std::shared_ptr<VRMetadataDescriptor> open(const Dataset& dataset);
private:
DataType getDataTypeProxy() const noexcept override;
uint8_t getElementSizeProxy() const noexcept override;
//! The minimum X dimension.
uint32_t m_minDimX = std::numeric_limits<uint32_t>::max();
//! The minimum Y dimension.
uint32_t m_minDimY = std::numeric_limits<uint32_t>::max();
//! The maximum X dimension.
uint32_t m_maxDimX = std::numeric_limits<uint32_t>::lowest();
//! The maximum Y dimension.
uint32_t m_maxDimY = std::numeric_limits<uint32_t>::lowest();
//! The minimum X resolution.
float m_minResX = std::numeric_limits<float>::max();
//! The minimum Y resolution.
float m_minResY = std::numeric_limits<float>::max();
//! The maximum X resolution.
float m_maxResX = std::numeric_limits<float>::lowest();
//! The maximum Y resolution.
float m_maxResY = std::numeric_limits<float>::lowest();;
friend Dataset;
friend VRMetadata;
};
} // namespace BAG
#endif // BAG_VRMETADATADESCRIPTOR_H