OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimCcfHead.h
Go to the documentation of this file.
1 //---
2 //
3 // License: MIT
4 //
5 // Author: David Burken
6 //
7 // Description:
8 //
9 // Contains class declaration for CcfHead.
10 //
11 // Notes:
12 // - This is not a full blown CCF header class as it only captures the
13 // data needed for loading.
14 // - Currently only version 6 is supported.
15 //
16 //---
17 // $Id$
18 #ifndef ossimCcfHead_HEADER
19 #define ossimCcfHead_HEADER 1
20 
23 #include <ossim/base/ossimString.h>
24 #include <ossim/base/ossimIpt.h>
25 #include <ossim/base/ossimIosFwd.h>
26 #include <memory>
27 #include <vector>
28 
29 class ossimIrect;
30 
31 //***************************************************************************
32 // CLASS: ossimCcfHead
33 //***************************************************************************
35 {
36 public:
37 
38  ossimCcfHead();
39 
40  ossimCcfHead(const char* ccf_file);
41  ossimCcfHead(std::shared_ptr<ossim::istream>& str,
42  const std::string& connectionString);
43 
44  ~ossimCcfHead ();
45 
50  bool parseCcfHeader(const char* ccf_file);
51  bool parseCcfHeader(std::shared_ptr<ossim::istream>& str, const std::string& connectionString);
52 
53  virtual std::ostream& print(std::ostream& out) const;
54 
55  ossim_uint32 numberOfReducedResSets() const { return theNumberOfRLevels; }
56 
57  ossim_uint32 numberOfLines(ossim_uint32 reduced_res_level) const;
58 
59  ossim_uint32 numberOfSamples(ossim_uint32 reduced_res_level) const;
60 
61  ossim_uint32 chunksInLineDir(ossim_uint32 reduced_res_level) const;
62 
63  ossim_uint32 chunksInSampleDir(ossim_uint32 reduced_res_level) const;
64 
65  std::streampos startOfData(ossim_uint32 reduced_res_level) const;
66 
72  { return !theNumberOfRLevels ? 0 : (theNumberOfRLevels - 1); }
73 
79  ossimIrect imageRect(ossim_uint32 reduced_res_level) const;
80 
84  ossimString imageFile() const { return m_connectionString; }
85 
89  ossimString radiometry() const { return theRadiometryString; }
90 
94  ossim_uint32 numberOfBands() const { return theNumberOfBands; }
95 
99  ossimScalarType pixelType() const { return thePixelType; }
100 
104  ossim_uint32 bytesPerChunk() const { return theBytesPerChunk; }
105 
109  ossim_uint32 bytesPerChip() const { return theBytesPerChip; }
110 
114  ossim_uint32 sampleChipsPerChunk() const { return theSampleChipsPerChunk; }
115 
119  ossim_uint32 lineChipsPerChunk() const { return theLineChipsPerChunk; }
120 
124  ossim_uint32 samplesPerChip() const { return theSamplesPerChip; }
125 
129  ossim_uint32 linesPerChip() const { return theLinesPerChip; }
130 
136  { return theLinesPerChip * theSamplesPerChip; }
137 
138  const std::vector<ossimIpt>& getValidImageVertices()const
139  {
140  return theValidImageVertices;
141  }
142 private:
143 
147  bool parseV5CcfHeader(std::istream& is);
148 
152  bool parseV6CcfHeader(std::istream& is);
153 
158  void parseRadString();
159 
160  std::shared_ptr<ossim::istream> m_ccfStr;
161  std::string m_connectionString;
175  std::vector<ossimIpt> theValidImageVertices;
183  std::vector<bool> theOccupiedFlag;
184  std::vector<std::streampos> theStartOfData;
185  std::vector<ossim_uint32> theNumberOfLines;
186  std::vector<ossim_uint32> theNumberOfSamples;
187  std::vector<ossim_uint32> theChunksInLineDir;
188  std::vector<ossim_uint32> theChunksInSampleDir;
189 };
190 
191 
192 #endif // #ifndef CcfHead_HEADER
ossim_uint32 samplesPerChip() const
Definition: ossimCcfHead.h:124
const std::vector< ossimIpt > & getValidImageVertices() const
Definition: ossimCcfHead.h:138
ossim_uint32 theNumberOfBands
Definition: ossimCcfHead.h:162
ossimScalarType thePixelType
Definition: ossimCcfHead.h:163
ossim_uint32 theLinesPerChip
Definition: ossimCcfHead.h:166
ossim_uint32 theRectInFullImageStopLine
Definition: ossimCcfHead.h:172
ossim_uint32 theNumberOfRLevels
Definition: ossimCcfHead.h:182
ossim_uint32 theRectInFullImageStartLine
Definition: ossimCcfHead.h:170
ossim_uint32 theBytesPerPixel
Definition: ossimCcfHead.h:178
ossimScalarType pixelType() const
Definition: ossimCcfHead.h:99
ossim_uint32 numberOfReducedResSets() const
Definition: ossimCcfHead.h:55
std::vector< ossim_uint32 > theNumberOfSamples
Definition: ossimCcfHead.h:186
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
std::vector< ossim_uint32 > theNumberOfLines
Definition: ossimCcfHead.h:185
ossim_uint32 bytesPerChunk() const
Definition: ossimCcfHead.h:104
ossimString imageFile() const
Definition: ossimCcfHead.h:84
ossim_uint32 theLineChipsPerChunk
Definition: ossimCcfHead.h:168
std::vector< ossim_uint32 > theChunksInSampleDir
Definition: ossimCcfHead.h:188
ossimString theRadiometryString
Definition: ossimCcfHead.h:177
ossimString theCompressionType
Definition: ossimCcfHead.h:181
std::vector< ossimIpt > theValidImageVertices
Definition: ossimCcfHead.h:175
unsigned int ossim_uint32
ossim_uint32 theRectInFuleImageStartSample
Definition: ossimCcfHead.h:171
std::string m_connectionString
Definition: ossimCcfHead.h:161
std::vector< std::streampos > theStartOfData
Definition: ossimCcfHead.h:184
ossim_uint32 chipSizePerBand() const
Definition: ossimCcfHead.h:135
std::vector< ossim_uint32 > theChunksInLineDir
Definition: ossimCcfHead.h:187
ossimScalarType
ossimString theFileType
Definition: ossimCcfHead.h:164
ossim_uint32 theFirstBandHeaderPointer
Definition: ossimCcfHead.h:176
ossim_uint32 theNumberOfValidImageVertices
Definition: ossimCcfHead.h:174
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
ossim_uint32 bytesPerChip() const
Definition: ossimCcfHead.h:109
std::shared_ptr< ossim::istream > m_ccfStr
Definition: ossimCcfHead.h:160
ossim_uint32 linesPerChip() const
Definition: ossimCcfHead.h:129
#define OSSIM_DLL
ossim_uint32 lineChipsPerChunk() const
Definition: ossimCcfHead.h:119
ossim_uint32 theRectInFuleImageStopSample
Definition: ossimCcfHead.h:173
ossim_uint32 numberOfBands() const
Definition: ossimCcfHead.h:94
ossim_uint32 theSamplesPerChip
Definition: ossimCcfHead.h:167
ossim_uint32 theSampleChipsPerChunk
Definition: ossimCcfHead.h:169
ossim_uint32 theBytesPerChunk
Definition: ossimCcfHead.h:180
ossim_uint32 highestReducedResSet() const
Definition: ossimCcfHead.h:71
ossim_uint32 theBytesPerChip
Definition: ossimCcfHead.h:179
ossim_uint32 sampleChipsPerChunk() const
Definition: ossimCcfHead.h:114
ossimString radiometry() const
Definition: ossimCcfHead.h:89
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
std::vector< bool > theOccupiedFlag
Definition: ossimCcfHead.h:183
ossim_uint32 theVersionNumber
Definition: ossimCcfHead.h:165