OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimEnviHeader.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: David Burken
6 //
7 // Description:
8 //
9 // Class for reading and writing an ENVI (The Environment for Visualizing
10 // Images) header file. This parses envi header and places in a keyword
11 // list.
12 //
13 //----------------------------------------------------------------------------
14 // $Id: ossimEnviHeader.h 22349 2013-08-01 21:38:29Z dburken $
15 
16 #ifndef ossimEnviHeader_HEADER
17 #define ossimEnviHeader_HEADER 1
18 
22 #include <ossim/base/ossimString.h>
24 #include <iosfwd>
25 
31 {
32 public:
35 
37  virtual ~ossimEnviHeader();
38 
39  virtual void reset();
40 
42  const ossimKeywordlist& getMap() const;
43 
45  ossimKeywordlist& getMap();
46 
54  bool getValue( const ossimString& key, ossimString& value ) const;
55 
62  bool findCaseInsensitive( const ossimString& key,
63  ossimString& value ) const;
64 
71  bool findSubStringCaseInsensitive( const ossimString& key,
72  ossimString& value) const;
73 
79  bool open(const ossimFilename& file);
80 
88  bool writeFile(const ossimFilename& file);
89 
97  std::ostream& print(std::ostream& out) const;
98 
101  const ossimEnviHeader& obj);
102 
106  ossimString getDescription() const;
107 
111  void setDescription(const ossimString& description);
112 
116  ossim_uint32 getSamples() const;
117 
123  void setSamples(ossim_uint32 samples);
124 
128  ossim_uint32 getLines() const;
129 
135  void setLines(ossim_uint32 lines);
136 
140  ossim_uint32 getBands() const;
141 
147  void setBands(ossim_uint32 bands);
148 
155  bool getDefaultBands( std::vector<ossim_uint32>& bands ) const;
156 
163  bool getRgbBandsFromWaveLength( std::vector<ossim_uint32>& bands ) const;
164 
168  ossim_uint32 getHeaderOffset() const;
169 
175  void setHeaderOffset(ossim_uint32 headerOffset);
176 
180  ossimString getFileType() const;
181 
187  void setFileType(const ossimString& fileType);
188 
192  ossim_uint32 getDataType() const;
193 
197  ossimScalarType getOssimScalarType() const;
198 
204  void setDataType(ossimScalarType scalar);
205 
209  ossimString getInterleaveType() const;
210 
214  ossimInterleaveType getOssimInterleaveType() const;
215 
221  void setInterleaveType(ossimInterleaveType interleave);
222 
226  ossimString getSensorType() const;
227 
233  void setSensorType(const ossimString& sensorType);
234 
244 
250  void setByteorder(ossimByteOrder byteOrder);
251 
255  ossim_int32 getXStart() const;
256 
262  void setXStart(ossim_int32 xstart);
263 
267  ossim_int32 getYStart() const;
268 
274  void setYStart(ossim_int32 ystart);
275 
279  ossimString getMapInfo() const;
280 
286  void setMapInfo(const ossimString& mapInfo);
287 
294  void setMapInfo(const ossimKeywordlist& kwl, const char* prefix=0);
295 
299  ossimString getWavelengthUnits() const;
300 
306  void setWavelengthUnits(const ossimString& wavelenghtUnits);
307 
311  void getBandNames(std::vector<ossimString>& bandNames) const;
312 
318  void setBandNames(const std::vector<ossimString>& bandNames);
319 
323  void getWavelengths(std::vector<ossimString>& wavelengths) const;
324 
330  void setWavelengths(const std::vector<ossimString>& wavelengths);
331 
378  bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
379 
384  static bool isEnviHeader( const ossimFilename& file );
385 
390  static bool isEnviHeader( std::istream& in );
391 
393  const ossimFilename& getFile() const;
394 
395 private:
396 
403  bool rangeCheckBands( const std::vector<ossim_uint32>& bands ) const;
404 
409  bool readStream(std::istream& in);
410 
411  ossimFilename m_file; // Name of header file.
413 };
414 #endif /* #ifndef ossimEnviHeader_HEADER */
415 
Represents serializable keyword/value map.
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
ossimKeywordlist m_keywords
ostream & operator<<(ostream &out, const ossimAxes &axes)
Definition: ossimAxes.h:88
ossimFilename m_file
unsigned int ossim_uint32
ossimByteOrder
ossimInterleaveType
ossimByteOrder getByteOrder(const H5::AbstractDs *dataset)
ossimScalarType
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
bool writeFile()
#define OSSIM_DLL
Class for reading and writing an ENVI (The Environment for Visualizing Images) header file...
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32
const char * getDescription()