supereight
reader_raw.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2014 University of Edinburgh, Imperial College London, University of Manchester
3  * SPDX-FileCopyrightText: 2016-2019 Emanuele Vespa
4  * SPDX-FileCopyrightText: 2020-2022 Smart Robotics Lab, Imperial College London, Technical University of Munich
5  * SPDX-FileCopyrightText: 2020-2022 Nils Funk
6  * SPDX-FileCopyrightText: 2020-2022 Sotiris Papatheodorou
7  * SPDX-License-Identifier: MIT
8  */
9 
10 #ifndef __READER_RAW_HPP
11 #define __READER_RAW_HPP
12 
13 #include <Eigen/Dense>
14 #include <cstdint>
15 #include <fstream>
16 #include <string>
17 
18 #include "reader_base.hpp"
19 #include "se/image/image.hpp"
20 
21 
22 
23 namespace se {
24 
28 class RAWReader : public Reader {
29  public:
34  RAWReader(const ReaderConfig& c);
35 
37  void restart();
38 
43  std::string name() const;
44 
45  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46 
47  private:
48  std::ifstream raw_fs_;
49  size_t depth_image_total_;
50  size_t rgba_image_total_;
51  size_t depth_data_size_;
52  size_t rgba_data_size_;
53  size_t depth_total_size_;
54  size_t rgba_total_size_;
56  static constexpr size_t depth_pixel_size_ = sizeof(uint16_t);
58  static constexpr size_t rgba_pixel_size_ = 3 * sizeof(uint8_t);
60  static constexpr size_t res_size_ = 2 * sizeof(uint32_t);
61 
62  bool readResolution(std::ifstream& fs, Eigen::Vector2i& res);
63 
64  ReaderStatus nextDepth(Image<float>& depth_image);
65 
66  ReaderStatus nextRGBA(Image<uint32_t>& rgba_image);
67 };
68 
69 } // namespace se
70 
71 #endif
Definition: reader_base.hpp:46
Base abstract class for dataset readers.
Definition: reader_base.hpp:139
ReaderStatus
The result of trying to read a depth/RGB image or a pose.
Definition: reader_base.hpp:105
Reader for SLAMBench 1.0 .raw files.
Definition: reader_raw.hpp:28
void restart()
Restart reading from the beginning.
std::string name() const
The name of the reader.
RAWReader(const ReaderConfig &c)
Construct a RAWReader from a ReaderConfig.
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17