-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbag_surfacecorrections.h
88 lines (63 loc) · 2.75 KB
/
bag_surfacecorrections.h
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
84
85
86
87
#ifndef BAG_SURFACECORRECTIONS_H
#define BAG_SURFACECORRECTIONS_H
#include "bag_config.h"
#include "bag_deleteh5dataset.h"
#include "bag_fordec.h"
#include "bag_layer.h"
#include "bag_types.h"
#include <memory>
namespace BAG {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // std classes do not have DLL-interface when exporting
#endif
//! The interface for the surface corrections layer.
class BAG_API SurfaceCorrections final : public Layer
{
public:
SurfaceCorrections(Dataset& dataset,
SurfaceCorrectionsDescriptor& descriptor,
std::unique_ptr<::H5::DataSet, DeleteH5dataSet> pH5dataSet);
SurfaceCorrections(const SurfaceCorrections&) = delete;
SurfaceCorrections(SurfaceCorrections&&) = delete;
SurfaceCorrections& operator=(const SurfaceCorrections&) = delete;
SurfaceCorrections& operator=(SurfaceCorrections&&) = delete;
bool operator==(const SurfaceCorrections &rhs) const noexcept {
return m_pH5dataSet == rhs.m_pH5dataSet;
}
bool operator!=(const SurfaceCorrections &rhs) const noexcept {
return !(rhs == *this);
}
std::shared_ptr<SurfaceCorrectionsDescriptor> getDescriptor() & noexcept;
std::shared_ptr<const SurfaceCorrectionsDescriptor> getDescriptor() const & noexcept;
UInt8Array readCorrected(uint32_t rowStart, uint32_t columnStart,
uint32_t rowEnd, uint32_t columnEnd, uint8_t corrector,
const SimpleLayer& layer) const;
UInt8Array readCorrectedRow(uint32_t row, uint32_t columnStart,
uint32_t columnEnd, uint8_t corrector, const SimpleLayer& layer) const;
protected:
static std::shared_ptr<SurfaceCorrections> create(Dataset& dataset,
BAG_SURFACE_CORRECTION_TOPOGRAPHY type, uint8_t numCorrectors,
uint64_t chunkSize, int compressionLevel);
static std::shared_ptr<SurfaceCorrections> open(Dataset& dataset,
SurfaceCorrectionsDescriptor& descriptor);
private:
static std::unique_ptr<::H5::DataSet, DeleteH5dataSet>
createH5dataSet(const Dataset& dataset,
const SurfaceCorrectionsDescriptor& descriptor);
const ::H5::DataSet& getH5dataSet() const & noexcept;
UInt8Array readProxy(uint32_t rowStart,
uint32_t columnStart, uint32_t rowEnd, uint32_t columnEnd) const override;
void writeProxy(uint32_t rowStart, uint32_t columnStart,
uint32_t rowEnd, uint32_t columnEnd, const uint8_t* buffer) override;
void writeAttributesProxy() const override;
//! The HDF5 DataSet this class relates to.
std::unique_ptr<::H5::DataSet, DeleteH5dataSet> m_pH5dataSet;
friend Dataset;
friend SurfaceCorrectionsDescriptor;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace BAG
#endif // BAG_SURFACECORRECTIONS_H