MrSID Decode SDK for Raster Reference Manual  9.5.5.5244
Segment.h
Go to the documentation of this file.
1 //
2 // This code is property of Celartem, Inc dba Extensis.
3 // Copyright (c) 1995-2023. All rights reserved.
4 // Use permitted only under license from Extensis.
5 //
6 /* PUBLIC */
7 
8 #ifndef Segment_H
9 #define Segment_H
10 
11 // lt_lib_base
12 #include "lt_base.h"
13 
14 // lt_lib_mrsid_nitf
15 #include "nitf_types.h"
16 
17 
18 LT_BEGIN_LIZARDTECH_NAMESPACE
19 class LTIOStreamInf;
21 class NITFReaderManager;
22 
23 namespace Nitf {
24 class SecurityBlock;
25 class FieldReader;
26 class FileHeader;
27 class MetadataHelper;
28 class SecurityMetadata;
29 class TREData;
30 
31 
38 class Segment
39 {
40 public:
41  // not for public use
43  lt_int64 headerOffset, lt_int64 headerLength,
44  lt_int64 dataOffset, lt_int64 dataLength,
45  const char* code, int segmentNumber,
46  bool doUserSubheader, bool doExtendedSubheader);
47 
48  // not for public use
49  virtual ~Segment();
50 
58  virtual LT_STATUS initialize();
59 
60  int getSegmentNumber() const;
61  const char* getSegmentID();
62 
63  // not for public use
65 
66  // not for public use
68 
69  // not for public use
71 
72  // not for public use
74 
75  // not for public use
77 
82 
83  // not for public use
85 
86  // not for public use
87  const char* getMetadataTagPrefix() const;
88 
92  int getNumTREs() const;
93 
102  const TREData* getTRE(int index) const;
103 
104 protected:
105  virtual LT_STATUS readHeader() = 0;
106  virtual LT_STATUS readData() = 0;
107 
109 
110  MetadataHelper* m_mdHelper;
111 
112  FieldReader* m_field;
113 
116  lt_int64 m_headerLength; // not const, because FileHeader length not known
119 
122 
124 
125  const int m_segmentNumber;
126  const char* m_segmentID;
127 
128 private:
129  void addTREChunk(const lt_uint8* bytes, int length);
130  void addTRE(const char* tag, const lt_uint8* bytes, int length);
131  TREData** m_treData;
132  int m_treCount;
133 
134  LT_STATUS readExtFields();
135  LT_STATUS processTREs();
136 
137  const char* m_code;
138 
139  const bool m_doUserSubheader;
140  const bool m_doExtendedSubheader;
141  lt_int64 m_offsetUD;
142  lt_int64 m_lenUD;
143  int m_overflowUD;
144  lt_int64 m_offsetX;
145  lt_int64 m_lenX;
146  int m_overflowX;
147 
148  char* m_tagPrefix;
149 
150  // nope
151  Segment(Segment&);
152  Segment& operator=(const Segment&);
153 };
154 
155 
156 }
157 LT_END_LIZARDTECH_NAMESPACE
158 
159 #endif // Segment_H
Include file for all LizardTech sources.
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:30
unsigned char lt_uint8
unsigned 8-bit integer
Definition: lt_types.h:36
long long int lt_int64
signed 64-bit integer
Definition: lt_types.h:57
This file contains a number of enums, typedefs, etc, that are used within the NITF support classes.
Version
version
Definition: nitf_types.h:32
Abstract definition of a stream.
class for storing metadata associated with an image
class for reading an NITF file
container for security-related metadata
Definition: SecurityBlock.h:39
container for Security metadata
base class for segment data in an NITF file
Definition: Segment.h:39
virtual LT_STATUS addMetadataLocal(LTIMetadataDatabase &) const =0
virtual ~Segment()
FieldReader * m_field
Definition: Segment.h:112
const char * m_segmentID
Definition: Segment.h:126
const lt_int64 m_dataLength
Definition: Segment.h:118
int getSegmentNumber() const
LTIOStreamInf & m_stream
Definition: Segment.h:114
virtual LT_STATUS readHeader()=0
int getNumTREs() const
returns the number of TREs in this segment
lt_int64 getDataOffset() const
SecurityBlock * m_securityBlock
Definition: Segment.h:123
Segment(NITFReaderManager &, LTIOStreamInf &, lt_int64 headerOffset, lt_int64 headerLength, lt_int64 dataOffset, lt_int64 dataLength, const char *code, int segmentNumber, bool doUserSubheader, bool doExtendedSubheader)
const SecurityBlock * getSecurityBlock() const
NITFReaderManager & m_manager
Definition: Segment.h:120
const TREData * getTRE(int index) const
TRE accessor.
lt_int64 m_headerLength
Definition: Segment.h:116
lt_int64 getDataLength() const
const lt_int64 m_headerOffset
Definition: Segment.h:115
virtual LT_STATUS addMetadata(LTIMetadataDatabase &) const
const char * getMetadataTagPrefix() const
const SecurityMetadata * getSecurityMetadata() const
returns the security information about the segment
lt_int64 getHeaderLength() const
lt_int64 getHeaderOffset() const
virtual LT_STATUS initialize()
initializer
MetadataHelper * m_mdHelper
Definition: Segment.h:110
virtual LT_STATUS readData()=0
const lt_int64 m_dataOffset
Definition: Segment.h:117
const char * getSegmentID()
Version m_version
Definition: Segment.h:121
const int m_segmentNumber
Definition: Segment.h:125
representation of a single TRE in a NITF file
Definition: TREData.h:30

Extensis