PICCANTE  0.4
The hottest HDR imaging library!
io.hpp
Go to the documentation of this file.
1 /*
2 
3 PICCANTE
4 The hottest HDR imaging library!
5 http://vcg.isti.cnr.it/piccante
6 
7 Copyright (C) 2014
8 Visual Computing Laboratory - ISTI CNR
9 http://vcg.isti.cnr.it
10 First author: Francesco Banterle
11 
12 This Source Code Form is subject to the terms of the Mozilla Public
13 License, v. 2.0. If a copy of the MPL was not distributed with this
14 file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 
16 */
17 
18 #ifndef PIC_UTIL_IO_HPP
19 #define PIC_UTIL_IO_HPP
20 
21 #include <string>
22 
23 #include "../base.hpp"
24 
25 namespace pic {
26 
28 
35 {
36  size_t posTMP = nameFile.find(".tmp");
37 
38  if(posTMP != std::string::npos) {
39  return IO_TMP;
40  }
41 
42  size_t posPFM = nameFile.find(".pfm");
43 
44  if(posPFM != std::string::npos) {
45  return IO_PFM;
46  }
47 
48  size_t posHDR = nameFile.find(".hdr");
49 
50  if(posHDR != std::string::npos) {
51  return IO_HDR;
52  }
53 
54  size_t posPIC = nameFile.find(".pic");
55 
56  if(posPIC != std::string::npos) {
57  return IO_HDR;
58  }
59 
60  size_t posEXR = nameFile.find(".exr");
61 
62  if(posEXR != std::string::npos) {
63  return IO_EXR;
64  }
65 
66  size_t posVOL = nameFile.find(".vol");
67 
68  if(posVOL != std::string::npos) {
69  return IO_VOL;
70  }
71 
72  return IO_NULL;
73 }
74 
81 {
82  size_t posBMP = nameFile.find(".bmp");
83 
84  if(posBMP != std::string::npos) {
85  return IO_BMP;
86  }
87 
88  size_t posPPM = nameFile.find(".ppm");
89 
90  if(posPPM != std::string::npos) {
91  return IO_PPM;
92  }
93 
94  size_t posPGM = nameFile.find(".pgm");
95 
96  if(posPGM != std::string::npos) {
97  return IO_PGM;
98  }
99 
100  size_t posTGA = nameFile.find(".tga");
101 
102  if(posTGA != std::string::npos) {
103  return IO_TGA;
104  }
105 
106  size_t posJPG = nameFile.find(".jpg");
107 
108  if(posJPG != std::string::npos) {
109  return IO_JPG;
110  }
111 
112  posJPG = nameFile.find(".JPG");
113 
114  if(posJPG != std::string::npos) {
115  return IO_JPG;
116  }
117 
118  posJPG = nameFile.find(".jpeg");
119 
120  if(posJPG != std::string::npos) {
121  return IO_JPG;
122  }
123 
124  size_t posPNG = nameFile.find(".png");
125 
126  if(posPNG != std::string::npos) {
127  return IO_PNG;
128  }
129 
130  return IO_NULL;
131 }
132 
133 } // end namespace pic
134 
135 #endif /* PIC_UTIL_IO_HPP */
136 
Definition: io.hpp:27
Definition: io.hpp:27
Definition: io.hpp:27
Definition: io.hpp:27
Definition: io.hpp:27
Definition: io.hpp:27
Definition: io.hpp:27
Definition: io.hpp:27
Definition: io.hpp:27
#define PIC_INLINE
Definition: base.hpp:33
Definition: io.hpp:27
PIC_INLINE LABEL_IO_EXTENSION getLabelHDRExtension(std::string nameFile)
getLabelHDRExtension returns the file label given its file name (for HDR images). ...
Definition: io.hpp:34
Definition: io.hpp:27
Definition: bilateral_separation.hpp:25
LABEL_IO_EXTENSION
Definition: io.hpp:27
PIC_INLINE LABEL_IO_EXTENSION getLabelLDRExtension(std::string nameFile)
getLabelHDRExtension returns the file label given its file name (for LDR images). ...
Definition: io.hpp:80
Definition: io.hpp:27