OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfJ2klraTag.h
Go to the documentation of this file.
1 //----------------------------------------------------------------------------
2 //
3 // File: ossimNitfJ2klraTag.h
4 //
5 // License: MIT
6 //
7 // See LICENSE.txt file in the top level directory for more details.
8 //
9 // Author: David Burken
10 //
11 // Description: NITF J2KLRA tag.
12 //
13 // See: ISO/IEC BIIF Profile BPJ2K01.00 Table 9-3.
14 //
15 //----------------------------------------------------------------------------
16 // $Id$
17 #ifndef ossimNitfJ2klraTag_HEADER
18 #define ossimNitfJ2klraTag_HEADER 1
19 
22 
23 #include <iosfwd>
24 #include <vector>
25 
27 {
28 public:
29  enum
30  {
31  ORIG_SIZE = 1,
32  NLEVELS_O_SIZE = 2,
33  NBANDS_O_SIZE = 5,
34  NLAYERS_O_SIZE = 3,
35 
36  LAYER_ID_SIZE = 3, // repeating
37  BITRATE_SIZE = 9, // repeating
38 
39  NLEVELS_I_SIZE = 2, // conditional
40  NBANDS_I_SIZE = 5, // conditional
41  NLAYERS_I_SIZE = 3 // conditional
42  };
43 
46 
52  virtual void parseStream(std::istream& in);
53 
59  virtual void writeStream(std::ostream& out);
60 
62  virtual ossim_uint32 getSizeInBytes()const;
63 
67  virtual void clearFields();
68 
75  virtual std::ostream& print(std::ostream& out, const std::string& prefix) const;
76 
78  ossim_uint32 getOriginNumber() const;
79 
81  ossim_uint32 getNumberOfLayersOriginal() const;
82 
102  bool setOrigin( ossim_uint32 origin );
103 
112  bool setLevelsO( ossim_uint32 levels );
113 
122  bool setBandsO( ossim_uint32 bands );
123 
132  bool setLayersO( ossim_uint32 layers );
133 
142  bool setLevelsI( ossim_uint32 levels );
143 
152  bool setBandsI( ossim_uint32 bands );
153 
162  bool setLayersI( ossim_uint32 layers );
163 
164 
177  bool setLayerId( ossim_uint32 index, ossim_uint32 id );
178 
191  bool setLayerBitRate( ossim_uint32 index, ossim_float64 bitRate );
192 
193 
194 protected:
195 
199  bool isParsed() const;
200 
201  // Container for repeating fields.
203  {
204  public:
211  char m_layer_id[LAYER_ID_SIZE+1];
212 
219  char m_bitrate[BITRATE_SIZE+1];
220  };
221 
240  char m_orig[ORIG_SIZE+1];
241 
248  char m_levels_o[NLEVELS_O_SIZE+1];
249 
256  char m_bands_o[NBANDS_O_SIZE+1];
257 
264  char m_layers_o[NLAYERS_O_SIZE+1];
265 
267  std::vector<ossimJ2klraLayer> m_layer;
268 
275  char m_nlevels_i[NLEVELS_I_SIZE+1];
276 
283  char m_nbands_i[NBANDS_I_SIZE+1];
284 
291  char m_nlayers_i[NLAYERS_I_SIZE+1];
292 
293 TYPE_DATA
294 };
295 
296 #endif /* End of "#ifndef ossimNitfJ2klraTag_HEADER_HEADER" */
virtual void writeStream(ossim::ostream &out)=0
virtual void parseStream(ossim::istream &in)=0
This will allow the user defined data to parse the stream.
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
Pure virtual print method that outputs a key/value type format adding prefix to keys.
std::vector< ossimJ2klraLayer > m_layer
repeating fields
double ossim_float64
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
#define OSSIM_DLL
virtual ossim_uint32 getSizeInBytes() const
Returns the length in bytes of the tag from the CEL or REL field.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23