runMACS
 All Data Structures Files Functions Variables Enumerations Enumerator Macros
Envi.h
Go to the documentation of this file.
1 #ifndef __ENVI_H
2 #define __ENVI_H
3 
4 #include <string>
5 #include <cstdint>
6 
7 
8 class EnviFile {
9  public:
10  enum class Interleave {
11  BSQ,
12  BIL,
13  BIP
14  };
15  EnviFile();
16  EnviFile(const std::string & _filename);
17  ~EnviFile();
18 
19  void openFile(const std::string & _filename);
20  void closeFile();
21 
22  uint16_t *getAvg();
23  // Getter methods
24  unsigned long long getWidth() const;
25  unsigned long long getHeight() const;
26  unsigned long long getNumFrames() const;
27  unsigned int getBytesPerPixel() const;
28  double getTint() const;
29  double getFps() const;
30  void *getDataByFrame(unsigned int frame) const;
31 
32  private:
33  std::string filename;
34  void *data;
35  int fd;
36  Interleave interleave;
37  unsigned long long width, height, numFrames;
38 
39  unsigned int bytesPerPixel;
40  double tint;
41  double fps;
42 
43  void parseHeader();
44  void loadImage();
45 };
46 
47 #endif // __ENVI_H
double getTint() const
Definition: Envi.cpp:34
unsigned long long getNumFrames() const
Definition: Envi.cpp:32
void * getDataByFrame(unsigned int frame) const
Definition: Envi.cpp:37
uint16_t * getAvg()
Definition: Envi.cpp:60
EnviFile()
Definition: Envi.cpp:22
void openFile(const std::string &_filename)
Definition: Envi.cpp:43
~EnviFile()
Definition: Envi.cpp:26
unsigned long long getHeight() const
Definition: Envi.cpp:31
unsigned long long getWidth() const
Definition: Envi.cpp:30
Interleave
Definition: Envi.h:10
Definition: Envi.h:8
unsigned int getBytesPerPixel() const
Definition: Envi.cpp:33
double getFps() const
Definition: Envi.cpp:35
void closeFile()
Definition: Envi.cpp:49