quadEM  7-0
Codec.h
Go to the documentation of this file.
1 #ifndef Codec_H
2 #define Codec_H
3 
4 static std::string codecName[] = {
5  "",
6  "jpeg",
7  "blosc",
8  "lz4",
9  "bslz4"
10 };
11 
12 typedef enum {
19 
20 typedef struct Codec_t {
22  int level;
23  int shuffle;
24  int compressor;
26  Codec_t() {
27  clear();
28  }
29 
30  void clear() {
31  name = codecName[NDCODEC_NONE];
32  level = -1;
33  shuffle = -1;
34  compressor = -1;
35  }
36 
37  bool empty() {
38  return this->name == codecName[NDCODEC_NONE];
39  }
40 
41  bool operator==(const Codec_t& other) {
42  if (name == other.name &&
43  level == other.level &&
44  shuffle == other.shuffle &&
45  compressor == other.compressor) {
46  return true;
47  } else {
48  return false;
49  }
50  }
51  bool operator!=(const Codec_t& other) {
52  return ! (*this == other);
53  }
54 } Codec_t;
55 
56 #endif //Codec_H
Definition: Codec.h:17
bool empty()
Definition: Codec.h:37
void clear()
Definition: Codec.h:30
Definition: Codec.h:20
NDCodecCompressor_t
Definition: Codec.h:12
struct Codec_t Codec_t
Codec_t()
Definition: Codec.h:26
int compressor
Compressor type.
Definition: Codec.h:24
Definition: Codec.h:16
int shuffle
Shuffle type.
Definition: Codec.h:23
bool operator==(const Codec_t &other)
Definition: Codec.h:41
int level
Compression level.
Definition: Codec.h:22
Definition: Codec.h:15
std::string name
Name of the codec used to compress the data.
Definition: Codec.h:21
Definition: NDFileHDF5Layout.h:44
bool operator!=(const Codec_t &other)
Definition: Codec.h:51
Definition: Codec.h:14
Definition: Codec.h:13