block_utils.cpp
Go to the documentation of this file.
1 // MODIS
2 #include "block_utils.h"
3 
4 // TerraLib
6 
7 // STL
8 #include <cstring>
9 
10 // Boost
11 #include <boost/cstdint.hpp>
12 
14 {
15  switch(data_type)
16  {
18  throw std::runtime_error("Invalid data type!");
19 
21  throw std::runtime_error("Invalid data type!");
22 
23  case te::dt::R1BIT_TYPE:
24  throw std::runtime_error("Invalid data type!");
25 
26  case te::dt::UCHAR_TYPE:
27  *f = extract_pixel_data<unsigned char>;
28  break;
29 
30  case te::dt::CHAR_TYPE:
31  *f = extract_pixel_data<char>;
32  break;
33 
35  *f = extract_pixel_data<boost::uint16_t>;
36  break;
37 
38  case te::dt::INT16_TYPE:
39  *f = extract_pixel_data<boost::int16_t>;
40  break;
41 
43  *f = extract_pixel_data<boost::uint32_t>;
44  break;
45 
46  case te::dt::INT32_TYPE:
47  *f = extract_pixel_data<boost::int32_t>;
48  break;
49 
50  case te::dt::FLOAT_TYPE:
51  *f = extract_pixel_data<float>;
52  break;
53 
55  *f = extract_pixel_data<double>;
56  break;
57 
59  throw std::runtime_error("Invalid data type!");
60 
62  throw std::runtime_error("Invalid data type!");
63 
65  throw std::runtime_error("Invalid data type!");
66 
68  throw std::runtime_error("Invalid data type!");
69 
70  default:
71  throw std::runtime_error("Invalid data type!");
72  }
73 }
74 
General enumerations for the data type module.
void(* extract_pixel_data_fnct_t)(const std::vector< unsigned char * > &, unsigned int, unsigned char *)
Definition: block_utils.h:7
void set_extract_pixel_data_strategy(extract_pixel_data_fnct_t *f, int data_type)
Definition: block_utils.cpp:13