OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpfImageDescriptionSubheader.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 // Description: This class extends the stl's string class.
10 //
11 //********************************************************************
12 // $Id: ossimRpfImageDescriptionSubheader.cpp 14241 2009-04-07 19:59:23Z dburken $
13 
14 #include <istream>
15 #include <ostream>
17 #include <ossim/base/ossimEndian.h>
19 
22 {
23  return data.print(out);
24 }
25 
27 {
28  clearFields();
29 }
30 
33 {
34  if(in)
35  {
36  theStartOffset = in.tellg();
37  in.read((char*)&theNumberOfSpectralGroups, 2);
38  in.read((char*)&theNumberOfSubframeTables, 2);
39  in.read((char*)&theNumberOfSpectralBandTables, 2);
40  in.read((char*)&theNumberOfSpectralBandLinesPerImageRow, 2);
41  in.read((char*)&theNumberOfSubframesHorizontal, 2);
42  in.read((char*)&theNumberOfSubframesVertical, 2);
43  in.read((char*)&theNumberOfOutputColumnsPerSubframe, 4);
44  in.read((char*)&theNumberOfOutputRowsPerSubframe, 4);
45  in.read((char*)&theSubframeMaskTableOffset, 4);
46  in.read((char*)&theTransparencyMaskTableOffset, 4);
47 
48  theEndOffset = in.tellg();
49  ossimEndian anEndian;
50 
51  if(anEndian.getSystemEndianType() != byteOrder)
52  {
63  }
64  }
65  else
66  {
68  }
69 
71 }
72 
74  std::ostream& out, const std::string& prefix) const
75 {
76  out << prefix << "NumberOfSpectralGroups: "
77  << theNumberOfSpectralGroups << "\n"
78  << prefix << "NumberOfSubframeTables: "
79  << theNumberOfSubframeTables << "\n"
80  << prefix << "NumberOfSpectralBandTables: "
82  << prefix << "NumberOfSpectralBandLinesPerImageRow: "
84  << prefix << "NumberOfSubframesHorizontal: "
86  << prefix << "NumberOfSubframesVertical: "
88  << prefix << "NumberOfOutputColumnsPerSubframe: "
90  << prefix << "NumberOfOutputRowsPerSubframe: "
92  << prefix << "SubframeMaskTableOffset: "
94  << prefix << "TransparencyMaskTableOffset: "
95  << theTransparencyMaskTableOffset << std::endl;
96  return out;
97 }
98 
100 {
101  theStartOffset = 0;
102  theEndOffset = 0;
103 
114 }
ossim_int32 ossimErrorCode
static const ossimErrorCode OSSIM_OK
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
static const ossimErrorCode OSSIM_ERROR
ossimByteOrder
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
std::ostream & operator<<(std::ostream &out, const ossimRpfImageDescriptionSubheader &data)
std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
print method that outputs a key/value type format adding prefix to keys.
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23