OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
src
support_data
ossimNitfSymbolHeaderV2_0.cpp
Go to the documentation of this file.
1
//*******************************************************************
2
// Copyright (C) 2000 ImageLinks Inc.
3
//
4
// License: See top level LICENSE.txt file.
5
//
6
// Author: Garrett Potts
7
//
8
// Description: Nitf support class
9
//
10
//********************************************************************
11
// $Id: ossimNitfSymbolHeaderV2_0.cpp 9094 2006-06-13 19:12:40Z dburken $
12
#include <
ossim/support_data/ossimNitfSymbolHeaderV2_0.h
>
13
#include <
ossim/base/ossimString.h
>
14
#include <
ossim/base/ossimDrect.h
>
15
#include <cstring>
// for memset
16
#include <istream>
17
18
RTTI_DEF1
(
ossimNitfSymbolHeaderV2_0
,
"ossimNitfSymbolHeaderV2_0"
,
ossimNitfSymbolHeader
)
19
20
ossimNitfSymbolHeaderV2_0
::
ossimNitfSymbolHeaderV2_0
()
21
{
22
clearFields();
23
}
24
25
void
ossimNitfSymbolHeaderV2_0::parseStream
(
std::istream
&in)
26
{
27
if
(in)
28
{
29
clearFields
();
30
31
in.read(
theFilePartType
, 2);
32
in.read(
theSymbolId
, 10);
33
in.read(
theSymbolName
, 20);
34
in.read(
theSymbolSecurityClass
, 1);
35
in.read(
theSymbolCodewords
, 40);
36
in.read(
theSymbolControlAndHandling
, 40);
37
in.read(
theSymbolReleasingInstructions
, 40);
38
in.read(
theSymbolClassificationAuthority
, 20);
39
in.read(
theSymbolSecurityControlNum
, 20);
40
in.read(
theSymbolSecurityDowngrade
, 6);
41
if
(
ossimString
(
theSymbolSecurityDowngrade
) ==
"999998"
)
42
{
43
in.read(
theSymbolDowngradingEvent
, 40);
44
}
45
in.read(
theSymbolEncryption
, 1);
46
in.read(
theSymbolType
, 1);
47
in.read(
theNumberLinesPerSymbol
, 4);
48
in.read(
theSymbolNumberPixelsPerLine
, 4);
49
in.read(
theSymbolLineWidth
, 4);
50
in.read(
theSymbolNumberBitsPerPixel
, 1);
51
in.read(
theSymbolDisplayLevel
, 3);
52
in.read(
theSymbolAttachmentLevel
, 3);
53
in.read(
theSymbolLocation
, 10);
54
in.read(
theSecondSymbolLocation
, 10);
55
in.read(
theSymbolColor
, 1);
56
in.read(
theSymbolNumber
, 6);
57
in.read(
theSymbolRotation
, 3);
58
in.read(
theSymbolNumberOfLutEntries
, 3);
59
60
// do lut here. we will temporarily ignore
61
in.ignore(
ossimString
(
theSymbolNumberOfLutEntries
).toLong());
62
63
in.read(
theSymbolExtendedSubheaderDataLength
, 5);
64
in.read(
theSymbolSubheaderOverflow
, 3);
65
66
}
67
}
68
69
std::ostream
&
ossimNitfSymbolHeaderV2_0::print
(
std::ostream
&out)
const
70
{
71
72
out <<
"theFilePartType: "
<<
theFilePartType
<< std::endl
73
<<
"theSymbolId: "
<<
theSymbolId
<< std::endl
74
<<
"theSymbolName: "
<<
theSymbolName
<< std::endl
75
<<
"theSymbolSecurityClass: "
<<
theSymbolSecurityClass
<< std::endl
76
<<
"theSymbolCodewords: "
<<
theSymbolCodewords
<< std::endl
77
<<
"theSymbolControlAndHandling: "
<<
theSymbolControlAndHandling
<< std::endl
78
<<
"theSymbolReleasingInstructions: "
<<
theSymbolReleasingInstructions
<< std::endl
79
<<
"theSymbolClassificationAuthority: "
<<
theSymbolClassificationAuthority
<< std::endl
80
<<
"theSymbolSecurityControlNum: "
<<
theSymbolSecurityControlNum
<< std::endl
81
<<
"theSymbolSecurityDowngrade: "
<<
theSymbolSecurityDowngrade
<< std::endl
82
<<
"theSymbolDowngradingEvent: "
<<
theSymbolDowngradingEvent
<< std::endl
83
<<
"theSymbolEncryption: "
<<
theSymbolEncryption
<< std::endl
84
<<
"theSymbolType: "
<<
theSymbolType
<< std::endl
85
<<
"theNumberLinesPerSymbol: "
<<
theNumberLinesPerSymbol
<< std::endl
86
<<
"theSymbolNumberPixelsPerLine: "
<<
theSymbolNumberPixelsPerLine
<< std::endl
87
<<
"theSymbolLineWidth: "
<<
theSymbolLineWidth
<< std::endl
88
<<
"theSymbolNumberBitsPerPixel: "
<<
theSymbolNumberBitsPerPixel
<< std::endl
89
<<
"theSymbolDisplayLevel: "
<<
theSymbolDisplayLevel
<< std::endl
90
<<
"theSymbolAttachmentLevel: "
<<
theSymbolAttachmentLevel
<< std::endl
91
<<
"theSymbolLocation: "
<<
theSymbolLocation
<< std::endl
92
<<
"theSecondSymbolLocation: "
<<
theSecondSymbolLocation
<< std::endl
93
<<
"theSymbolColor: "
<<
theSymbolColor
<< std::endl
94
<<
"theSymbolNumber: "
<<
theSymbolNumber
<< std::endl
95
<<
"theSymbolRotation: "
<<
theSymbolRotation
<< std::endl
96
<<
"theSymbolNumberOfLutEntries: "
<<
theSymbolNumberOfLutEntries
<< std::endl
97
<<
"theSymbolExtendedSubheaderDataLength: "
<<
theSymbolExtendedSubheaderDataLength
<< std::endl
98
<<
"theSymbolSubheaderOverflow: "
<<
theSymbolSubheaderOverflow
<< std::endl;
99
return
out;
100
}
101
102
ossim_int32
ossimNitfSymbolHeaderV2_0::getDisplayLevel
()
const
103
{
104
return
ossimString
(
theSymbolDisplayLevel
).
toInt32
();
105
}
106
107
ossimDrect
ossimNitfSymbolHeaderV2_0::getImageRect
()
const
108
{
109
// for now we will return an empty rect. This will be more
110
// complicated to compute a symbol bound. The origin depends
111
// on the symbol and is different for different symbols.
112
// We will implement this one last.
113
return
ossimDrect
(0,0,0,0);
114
}
115
116
117
void
ossimNitfSymbolHeaderV2_0::clearFields
()
118
{
119
memset(
theFilePartType
,
' '
, 2);
120
memset(
theSymbolId
,
' '
, 10);
121
memset(
theSymbolName
,
' '
, 20);
122
memset(
theSymbolSecurityClass
,
' '
, 1);
123
memset(
theSymbolCodewords
,
' '
, 40);
124
memset(
theSymbolControlAndHandling
,
' '
, 40);
125
memset(
theSymbolReleasingInstructions
,
' '
, 40);
126
memset(
theSymbolClassificationAuthority
,
' '
, 20);
127
memset(
theSymbolSecurityControlNum
,
' '
, 20);
128
memset(
theSymbolSecurityDowngrade
,
' '
, 6);
129
memset(
theSymbolDowngradingEvent
,
' '
, 40);
130
memset(
theSymbolEncryption
,
' '
, 1);
131
memset(
theSymbolType
,
' '
, 1);
132
memset(
theNumberLinesPerSymbol
,
' '
, 4);
133
memset(
theSymbolNumberPixelsPerLine
,
' '
, 4);
134
memset(
theSymbolLineWidth
,
' '
, 4);
135
memset(
theSymbolNumberBitsPerPixel
,
' '
, 1);
136
memset(
theSymbolDisplayLevel
,
' '
, 3);
137
memset(
theSymbolAttachmentLevel
,
' '
, 3);
138
memset(
theSymbolLocation
,
' '
, 10);
139
memset(
theSecondSymbolLocation
,
' '
, 10);
140
memset(
theSymbolColor
,
' '
, 1);
141
memset(
theSymbolNumber
,
' '
, 6);
142
memset(
theSymbolRotation
,
' '
, 3);
143
memset(
theSymbolNumberOfLutEntries
,
' '
, 3);
144
memset(
theSymbolExtendedSubheaderDataLength
,
' '
, 5);
145
memset(
theSymbolSubheaderOverflow
,
' '
, 3);
146
147
148
theFilePartType
[2] =
'\0'
;
149
theSymbolId
[10] =
'\0'
;
150
theSymbolName
[20] =
'\0'
;
151
theSymbolSecurityClass
[1] =
'\0'
;
152
theSymbolCodewords
[40] =
'\0'
;
153
theSymbolControlAndHandling
[40] =
'\0'
;
154
theSymbolReleasingInstructions
[40] =
'\0'
;
155
theSymbolClassificationAuthority
[20] =
'\0'
;
156
theSymbolSecurityControlNum
[20] =
'\0'
;
157
theSymbolSecurityDowngrade
[6] =
'\0'
;
158
theSymbolDowngradingEvent
[40] =
'\0'
;
159
theSymbolEncryption
[1] =
'\0'
;
160
theSymbolType
[1] =
'\0'
;
161
theNumberLinesPerSymbol
[4] =
'\0'
;
162
theSymbolNumberPixelsPerLine
[4] =
'\0'
;
163
theSymbolLineWidth
[4] =
'\0'
;
164
theSymbolNumberBitsPerPixel
[1] =
'\0'
;
165
theSymbolDisplayLevel
[3] =
'\0'
;
166
theSymbolAttachmentLevel
[3] =
'\0'
;
167
theSymbolLocation
[10] =
'\0'
;
168
theSecondSymbolLocation
[10] =
'\0'
;
169
theSymbolColor
[1] =
'\0'
;
170
theSymbolNumber
[6] =
'\0'
;
171
theSymbolRotation
[3] =
'\0'
;
172
theSymbolNumberOfLutEntries
[3] =
'\0'
;
173
theSymbolExtendedSubheaderDataLength
[5] =
'\0'
;
174
theSymbolSubheaderOverflow
[3] =
'\0'
;
175
}
ossimNitfSymbolHeaderV2_0::theSymbolNumberBitsPerPixel
char theSymbolNumberBitsPerPixel[2]
Definition:
ossimNitfSymbolHeaderV2_0.h:156
ossimNitfSymbolHeaderV2_0::theSymbolNumberPixelsPerLine
char theSymbolNumberPixelsPerLine[5]
Definition:
ossimNitfSymbolHeaderV2_0.h:140
ossimNitfSymbolHeaderV2_0::theFilePartType
char theFilePartType[3]
Definition:
ossimNitfSymbolHeaderV2_0.h:36
ossimNitfSymbolHeaderV2_0::theSymbolLocation
char theSymbolLocation[11]
Definition:
ossimNitfSymbolHeaderV2_0.h:174
ossimNitfSymbolHeaderV2_0::theSymbolSubheaderOverflow
char theSymbolSubheaderOverflow[4]
Definition:
ossimNitfSymbolHeaderV2_0.h:222
ossimNitfSymbolHeaderV2_0
Definition:
ossimNitfSymbolHeaderV2_0.h:17
ossimNitfSymbolHeaderV2_0::parseStream
virtual void parseStream(std::istream &in)
Definition:
ossimNitfSymbolHeaderV2_0.cpp:25
ossimNitfSymbolHeaderV2_0::theSymbolDisplayLevel
char theSymbolDisplayLevel[4]
Definition:
ossimNitfSymbolHeaderV2_0.h:161
ossimNitfSymbolHeaderV2_0::theSymbolControlAndHandling
char theSymbolControlAndHandling[41]
Definition:
ossimNitfSymbolHeaderV2_0.h:69
ossimNitfSymbolHeaderV2_0::theSymbolClassificationAuthority
char theSymbolClassificationAuthority[21]
Definition:
ossimNitfSymbolHeaderV2_0.h:79
ossimNitfSymbolHeaderV2_0::theSymbolSecurityDowngrade
char theSymbolSecurityDowngrade[7]
Definition:
ossimNitfSymbolHeaderV2_0.h:89
ossimString::toInt32
ossim_int32 toInt32() const
Definition:
ossimString.cpp:613
ossimNitfSymbolHeaderV2_0::theSymbolDowngradingEvent
char theSymbolDowngradingEvent[41]
Definition:
ossimNitfSymbolHeaderV2_0.h:97
ossimNitfSymbolHeaderV2_0::getImageRect
virtual ossimDrect getImageRect() const
Definition:
ossimNitfSymbolHeaderV2_0.cpp:107
ossimNitfSymbolHeaderV2_0::theSecondSymbolLocation
char theSecondSymbolLocation[11]
Definition:
ossimNitfSymbolHeaderV2_0.h:180
ossimNitfSymbolHeaderV2_0::theSymbolLineWidth
char theSymbolLineWidth[5]
Definition:
ossimNitfSymbolHeaderV2_0.h:151
ossimNitfSymbolHeaderV2_0::print
virtual std::ostream & print(std::ostream &out) const
Generic print method.
Definition:
ossimNitfSymbolHeaderV2_0.cpp:69
ossimNitfSymbolHeaderV2_0::theSymbolExtendedSubheaderDataLength
char theSymbolExtendedSubheaderDataLength[6]
Definition:
ossimNitfSymbolHeaderV2_0.h:215
ossimString.h
ossimNitfSymbolHeaderV2_0::theSymbolType
char theSymbolType[2]
Definition:
ossimNitfSymbolHeaderV2_0.h:122
ossimNitfSymbolHeaderV2_0.h
ossimDrect.h
ossimNitfSymbolHeaderV2_0::theSymbolRotation
char theSymbolRotation[4]
Definition:
ossimNitfSymbolHeaderV2_0.h:197
ossimDrect
Definition:
ossimDrect.h:53
ossimNitfSymbolHeaderV2_0::theSymbolId
char theSymbolId[11]
Definition:
ossimNitfSymbolHeaderV2_0.h:41
ossim::istream
std::basic_istream< char > istream
Base class for char input streams.
Definition:
ossimIosFwd.h:20
ossimNitfSymbolHeaderV2_0::theSymbolSecurityControlNum
char theSymbolSecurityControlNum[21]
Definition:
ossimNitfSymbolHeaderV2_0.h:84
ossimNitfSymbolHeaderV2_0::theSymbolColor
char theSymbolColor[2]
Definition:
ossimNitfSymbolHeaderV2_0.h:185
ossimNitfSymbolHeaderV2_0::theSymbolReleasingInstructions
char theSymbolReleasingInstructions[41]
Definition:
ossimNitfSymbolHeaderV2_0.h:74
ossimNitfSymbolHeaderV2_0::getDisplayLevel
virtual ossim_int32 getDisplayLevel() const
Definition:
ossimNitfSymbolHeaderV2_0.cpp:102
ossimNitfSymbolHeaderV2_0::theNumberLinesPerSymbol
char theNumberLinesPerSymbol[5]
Definition:
ossimNitfSymbolHeaderV2_0.h:131
ossimNitfSymbolHeaderV2_0::theSymbolNumber
char theSymbolNumber[7]
Definition:
ossimNitfSymbolHeaderV2_0.h:192
ossimNitfSymbolHeader
Definition:
ossimNitfSymbolHeader.h:20
RTTI_DEF1
#define RTTI_DEF1(cls, name, b1)
Definition:
ossimRtti.h:485
ossimNitfSymbolHeaderV2_0::theSymbolNumberOfLutEntries
char theSymbolNumberOfLutEntries[4]
Definition:
ossimNitfSymbolHeaderV2_0.h:202
ossimNitfSymbolHeaderV2_0::theSymbolCodewords
char theSymbolCodewords[41]
Definition:
ossimNitfSymbolHeaderV2_0.h:64
ossimNitfSymbolHeaderV2_0::theSymbolSecurityClass
char theSymbolSecurityClass[2]
Definition:
ossimNitfSymbolHeaderV2_0.h:59
ossimNitfSymbolHeaderV2_0::theSymbolAttachmentLevel
char theSymbolAttachmentLevel[4]
Definition:
ossimNitfSymbolHeaderV2_0.h:166
ossimNitfSymbolHeaderV2_0::theSymbolEncryption
char theSymbolEncryption[2]
Definition:
ossimNitfSymbolHeaderV2_0.h:107
ossimNitfSymbolHeaderV2_0::theSymbolName
char theSymbolName[21]
Definition:
ossimNitfSymbolHeaderV2_0.h:46
ossim::ostream
std::basic_ostream< char > ostream
Base class for char output streams.
Definition:
ossimIosFwd.h:23
ossimString
Definition:
ossimString.h:22
ossim_int32
int ossim_int32
Definition:
ossimConstants.h:234
ossimNitfSymbolHeaderV2_0::clearFields
void clearFields()
Definition:
ossimNitfSymbolHeaderV2_0.cpp:117
Generated on Fri Aug 3 2018 08:46:51 for OSSIM - Open Source Software Image Map by
1.8.14