MrSID Decode SDK for Raster Reference Manual  9.1.0.4045
Segment.h
Go to the documentation of this file.
1 /* //////////////////////////////////////////////////////////////////////////
2 // //
3 // This code is Copyright (c) 2010 LizardTech, Inc, 1008 Western Avenue, //
4 // Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
5 // prohibited. Access to and use of this code is permitted only under //
6 // license from LizardTech, Inc. Portions of the code are protected by //
7 // US and foreign patents and other filings. All Rights Reserved. //
8 // //
10 /* PUBLIC */
11 
12 #ifndef Segment_H
13 #define Segment_H
14 
15 // lt_lib_base
16 #include "lt_base.h"
17 
18 // lt_lib_mrsid_nitf
19 #include "nitf_types.h"
20 
21 
23 class LTIOStreamInf;
25 class NITFReaderManager;
26 
27 namespace Nitf {
28 class SecurityBlock;
29 class FieldReader;
30 class FileHeader;
31 class MetadataHelper;
32 class SecurityMetadata;
33 class TREData;
34 
35 
42 class Segment
43 {
44 public:
45  // not for public use
46  Segment(NITFReaderManager&, LTIOStreamInf&,
47  lt_int64 headerOffset, lt_int64 headerLength,
48  lt_int64 dataOffset, lt_int64 dataLength,
49  const char* code, int segmentNumber,
50  bool doUserSubheader, bool doExtendedSubheader);
51 
52  // not for public use
53  virtual ~Segment();
54 
62  virtual LT_STATUS initialize();
63 
64  int getSegmentNumber() const;
65  const char* getSegmentID();
66 
67  // not for public use
68  lt_int64 getHeaderOffset() const;
69 
70  // not for public use
71  lt_int64 getHeaderLength() const;
72 
73  // not for public use
74  lt_int64 getDataOffset() const;
75 
76  // not for public use
77  lt_int64 getDataLength() const;
78 
79  // not for public use
80  const SecurityBlock* getSecurityBlock() const;
81 
86 
87  // not for public use
89 
90  // not for public use
91  const char* getMetadataTagPrefix() const;
92 
96  int getNumTREs() const;
97 
106  const TREData* getTRE(int index) const;
107 
108 protected:
109  virtual LT_STATUS readHeader() = 0;
110  virtual LT_STATUS readData() = 0;
111 
113 
114  MetadataHelper* m_mdHelper;
115 
116  FieldReader* m_field;
117 
119  const lt_int64 m_headerOffset;
120  lt_int64 m_headerLength; // not const, because FileHeader length not known
121  const lt_int64 m_dataOffset;
122  const lt_int64 m_dataLength;
123 
124  NITFReaderManager& m_manager;
126 
128 
129  const int m_segmentNumber;
130  const char* m_segmentID;
131 
132 private:
133  void addTREChunk(const lt_uint8* bytes, int length);
134  void addTRE(const char* tag, const lt_uint8* bytes, int length);
135  TREData** m_treData;
136  int m_treCount;
137 
138  LT_STATUS readExtFields();
139  LT_STATUS processTREs();
140 
141  const char* m_code;
142 
143  const bool m_doUserSubheader;
144  const bool m_doExtendedSubheader;
145  lt_int64 m_offsetUD;
146  lt_int64 m_lenUD;
147  int m_overflowUD;
148  lt_int64 m_offsetX;
149  lt_int64 m_lenX;
150  int m_overflowX;
151 
152  char* m_tagPrefix;
153 
154  // nope
155  Segment(Segment&);
156  Segment& operator=(const Segment&);
157 };
158 
159 
160 }
162 
163 #endif // Segment_H
lt_int64 getDataOffset() const
LTIOStreamInf & m_stream
Definition: Segment.h:118
const lt_int64 m_headerOffset
Definition: Segment.h:119
virtual LT_STATUS readHeader()=0
This file contains a number of enums, typedefs, etc, that are used within the NITF support classes...
unsigned char lt_uint8
unsigned 8-bit integer
Definition: lt_types.h:46
SecurityBlock * m_securityBlock
Definition: Segment.h:127
base class for segment data in an NITF file
Definition: Segment.h:42
const char * m_segmentID
Definition: Segment.h:130
representation of a single TRE in a NITF file
Definition: TREData.h:33
lt_int64 getHeaderOffset() const
virtual LT_STATUS readData()=0
const char * getSegmentID()
virtual LT_STATUS addMetadata(LTIMetadataDatabase &) const
#define LT_BEGIN_LIZARDTECH_NAMESPACE
compiler does not support namespaces
Definition: lt_define.h:96
lt_int64 getDataLength() const
const lt_int64 m_dataOffset
Definition: Segment.h:121
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39
NITFReaderManager & m_manager
Definition: Segment.h:124
container for Security metadata
const TREData * getTRE(int index) const
TRE accessor.
lt_int64 getHeaderLength() const
Version m_version
Definition: Segment.h:125
virtual ~Segment()
lt_int64 m_headerLength
Definition: Segment.h:120
int getNumTREs() const
returns the number of TREs in this segment
#define LT_END_LIZARDTECH_NAMESPACE
compiler does not support namespaces
Definition: lt_define.h:97
Include file for all LizardTech sources.
const SecurityMetadata * getSecurityMetadata() const
returns the security information about the segment
Segment(NITFReaderManager &, LTIOStreamInf &, lt_int64 headerOffset, lt_int64 headerLength, lt_int64 dataOffset, lt_int64 dataLength, const char *code, int segmentNumber, bool doUserSubheader, bool doExtendedSubheader)
virtual LT_STATUS addMetadataLocal(LTIMetadataDatabase &) const =0
MetadataHelper * m_mdHelper
Definition: Segment.h:114
int getSegmentNumber() const
Version
version
Definition: nitf_types.h:35
container for security-related metadata
Definition: SecurityBlock.h:42
const int m_segmentNumber
Definition: Segment.h:129
Abstract definition of a stream.
virtual LT_STATUS initialize()
initializer
class for storing metadata associated with an image
const SecurityBlock * getSecurityBlock() const
const lt_int64 m_dataLength
Definition: Segment.h:122
FieldReader * m_field
Definition: Segment.h:116
const char * getMetadataTagPrefix() const

LizardTech