OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimNitfFileHeaderV2_0.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 // Description: Nitf support class
10 //
11 //********************************************************************
12 // $Id$
13 
21 
22 #include <ossim/base/ossimDrect.h>
25 #include <ossim/base/ossimIrect.h>
26 #include <ossim/base/ossimNotify.h>
27 #include <ossim/base/ossimString.h>
28 #include <ossim/base/ossimTrace.h>
30 
31 #include <sstream>
32 #include <cstring> // for memset
33 #include <iostream>
34 #include <iomanip>
35 #include <stdexcept>
36 
37 
40 
41 static const ossimTrace traceDebug("ossimNitfFileHeaderV2_0:debug");
42 
44 
45 std::ostream& operator <<(std::ostream& out,
46  const ossimNitfImageInfoRecordV2_0 &data)
47 {
48  return out << "theImageSubheaderLength: "
49  << data.theImageSubheaderLength << std::endl
50  << "theImageLength: "
51  << data.theImageLength;
52 }
53 
55 {
57 }
58 
60 {
62 }
63 
65 {
66  return (getHeaderLength() + getImageLength());
67 }
68 
70 {
72 
73  out << std::setw(6)
74  << std::setfill('0')
75  << std::setiosflags(ios::right)
76  << length;
77 
78  memcpy(theImageSubheaderLength, out.str().c_str(), 6);
79  theImageSubheaderLength[6] = '\0';
80 }
81 
83 {
85 
86  out << std::setw(10)
87  << std::setfill('0')
88  << std::setiosflags(ios::right)
89  << length;
90 
91  memcpy(theImageLength, out.str().c_str(), 10);
92  theImageLength[10] = '\0';
93 }
94 
97 {
98  return out << "theSymbolSubheaderLength: "
99  << data.theSymbolSubheaderLength << std::endl
100  << "theSymbolLength: "
101  << data.theSymbolLength;
102 }
104 {
106 }
107 
109 {
111 }
112 
114 {
115  return (getHeaderLength() + getImageLength());
116 }
117 
119  const ossimNitfLabelInfoRecordV2_0 &data)
120 {
121  return out << "theLabelSubheaderLength: "
122  << data.theLabelSubheaderLength << std::endl
123  << "theLabelLength: "
124  << data.theLabelLength;
125 }
126 
128 {
130 }
131 
133 {
135 }
136 
138 {
139  return (getHeaderLength() + getImageLength());
140 }
141 
143  const ossimNitfTextInfoRecordV2_0 &data)
144 {
145  return out << "theTextSubheaderLength: "
146  << data.theTextSubheaderLength << std::endl
147  << "theTextLength: "
148  << data.theTextLength;
149 }
150 
152 {
154 }
155 
157 {
159 }
160 
162 {
163  return (getHeaderLength() + getImageLength());
164 }
165 
168 {
169  return out << "theDataExtSegSubheaderLength: "
170  << data.theDataExtSegSubheaderLength << std::endl
171  << "theDataExtSegLength: "
172  << data.theDataExtSegLength;
173 }
174 
176 {
178 }
179 
181 {
183 }
184 
186 {
187  return (getHeaderLength() + getImageLength());
188 }
189 
192 {
193  return out << "theResExtSegSubheaderLength: "
194  << data.theResExtSegSubheaderLength << std::endl
195  << "theResExtSegLength: "
196  << data.theResExtSegLength;
197 }
198 
201 {
202  clearFields();
203 }
204 
206 {
207 }
208 
210 {
211  bool result = ossimNitfFileHeaderV2_X::isValid();
212 
213  if(result)
214  {
215 
216  }
217 
218  return result;
219 }
220 
222 {
223  if(traceDebug())
224  {
226  << "ossimNitfFileHeaderV2_0::parseStream: entered ......."
227  << std::endl;
228  }
229 
230  clearFields();
231 
232  // identification and origination group
233  in.read(theFileTypeVersion, 9);
234  theHeaderSize+=9;
235  in.read(theComplexityLevel, 2);
236  theHeaderSize+=2;
237  in.read(theSystemType, 4);
238  theHeaderSize+=4;
239  in.read(theOriginatingStationId, 10);
240  theHeaderSize+=10;
241  in.read(theDateTime, 14);
242  theHeaderSize+=14;
243  in.read(theFileTitle, 80);
244  theHeaderSize+=80;
245 
246  // read security group
247  in.read(theSecurityClassification, 1);
248  theHeaderSize++;
249  in.read(theCodewords, 40);
250  theHeaderSize+=40;
251  in.read(theControlAndHandling, 40);
252  theHeaderSize+=40;
253  in.read(theReleasingInstructions, 40);
254  theHeaderSize+=40;
255  in.read(theClassificationAuthority, 20);
256  theHeaderSize+=20;
257  in.read(theSecurityControlNumber, 20);
258  theHeaderSize+=20;
259  in.read(theSecurityDowngrade, 6);
260  theHeaderSize+=6;
261  if(ossimString(theSecurityDowngrade) == "999998")
262  {
263  in.read(theDowngradingEvent, 40);
264  theHeaderSize+=40;
265  }
266  in.read(theCopyNumber, 5);
267  theHeaderSize+=5;
268  in.read(theNumberOfCopies, 5);
269  theHeaderSize+=5;
270  in.read(theEncryption, 1);
271  theHeaderSize++;
272  in.read(theOriginatorsName, 27);
273  theHeaderSize+=27;
274  in.read(theOriginatorsPhone, 18);
275  theHeaderSize+=18;
276 
277  in.read(theFileLength, 12);
278  theHeaderSize+=12;
279  in.read(theHeaderLength, 6);
280  theHeaderSize+=6;
281 
282  // image description group
283  in.read(theNumberOfImageInfoRecords, 3);
284  theHeaderSize+=3;
286 
287  // symbol description group
288  in.read(theNumberOfSymbolInfoRecords, 3);
289  theHeaderSize+=3;
291 
292  // label description group
293  in.read(theNumberOfLabelInfoRecords, 3);
294  theHeaderSize+=3;
296 
297  // text file information group
298  in.read(theNumberOfTextFileInfoRecords, 3);
299  theHeaderSize+=3;
301 
302  // Data extension group
304  theHeaderSize+=3;
306 
307  // Reserve Extension Segment group
309  theHeaderSize+=3;
311 
312  in.read(theUserDefinedHeaderDataLength, 5);
313  theHeaderSize+=5;
314 
315  theTagList.clear();
316  // only get the header overflow if there even exists
317  // user defined data.
318  ossim_int32 userDefinedHeaderLength = ossimString(theUserDefinedHeaderDataLength).toInt32();
319 
320  ossimNitfTagInformation headerTag;
321 
322  std::streampos start = in.tellg();
323  std::streampos current = in.tellg();
324 
325  theHeaderSize+=userDefinedHeaderLength;
326  if(userDefinedHeaderLength > 0)
327  {
328  in.read(theUserDefinedHeaderOverflow, 3);
329 
330  current = in.tellg();
331  while((current - start) < userDefinedHeaderLength)
332  {
333  headerTag.parseStream(in);
334  headerTag.setTagType("UDHD");
335  theTagList.push_back(headerTag);
336  // in.ignore(headerTag.getTagLength());
337  // headerTag.clearFields();
338 
339  //---
340  // We will check the stream here as there have been instances of
341  // rpf's with bad stream offsets.
342  //---
343  if (!in)
344  {
345  std::string e =
346  "ossimNitfFileHeaderV2_0::parseStream stream error!";
347  throw ossimException(e);
348  }
349 
350  current = in.tellg();
351  }
352  }
353  in.read(theExtendedHeaderDataLength, 5);
354  theHeaderSize+=5;
355  ossim_int32 extendedHeaderDataLength = ossimString(theExtendedHeaderDataLength).toInt32();
356  theHeaderSize+=extendedHeaderDataLength;
357 
358  start = in.tellg();
359  current = in.tellg();
360  // for now let's just ignore it
361  if(extendedHeaderDataLength > 0)
362  {
363  in.read(theExtendedHeaderOverflow, 3);
364  current = in.tellg();
365 
366  while((current - start) < extendedHeaderDataLength)
367  {
368  headerTag.parseStream(in);
369  headerTag.setTagType("XHD");
370  theTagList.push_back(headerTag);
371  in.ignore(headerTag.getTagLength());
372  headerTag.clearFields();
373  current = in.tellg();
374  }
375  }
376 
377  // this need to be re-thought
379  readOverflowTags(in);
380 
381  if(traceDebug())
382  {
384  }
385  if(traceDebug())
386  {
388  << "ossimNitfFileHeaderV2_0::parseStream: Leaving......."
389  << std::endl;
390  }
391 // initializeDisplayLevels(in);
392 
393 }
394 
396 {
398  if (overflow != 0)
399  {
401  if (des.valid())
402  {
403  const vector<ossimNitfTagInformation> &desTags = des->getTagList();
404  for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin();
405  iter != desTags.end();
406  ++iter)
407  {
408  iter->setTagType("UDHD");
409  theTagList.push_back(*iter);
410  }
411  des = 0;
412  }
413  }
414 
416  if (overflow != 0)
417  {
419  if (des.valid())
420  {
421  const vector<ossimNitfTagInformation> &desTags = des->getTagList();
422  for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
423  {
424  iter->setTagType("XHD");
425  theTagList.push_back(*iter);
426  }
427  des = 0;
428 
429  }
430  }
431 }
432 
434 {
435  // identification and origination group
436  out.write(theFileTypeVersion, 9);
437  out.write(theComplexityLevel, 2);
438  out.write(theSystemType, 4);
439  out.write(theOriginatingStationId, 10);
440  out.write(theDateTime, 14);
441  out.write(theFileTitle, 80);
442 
443  // read security group
444  out.write(theSecurityClassification, 1);
445  out.write(theCodewords, 40);
446  out.write(theControlAndHandling, 40);
447  out.write(theReleasingInstructions, 40);
448  out.write(theClassificationAuthority, 20);
449  out.write(theSecurityControlNumber, 20);
450  out.write(theSecurityDowngrade, 6);
451  if(ossimString(theSecurityDowngrade) == "999998")
452  {
453  out.write(theDowngradingEvent, 40);
454  }
455  out.write(theCopyNumber, 5);
456  out.write(theNumberOfCopies, 5);
457  out.write(theEncryption, 1);
458  out.write(theOriginatorsName, 27);
459  out.write(theOriginatorsPhone, 18);
460 
461  out.write(theFileLength, 12);
462  out.write(theHeaderLength, 6);
463  ossim_uint32 idx = 0;
464  {
465  std::ostringstream outString;
466 
467  outString << std::setw(3)
468  << std::setfill('0')
469  << std::setiosflags(ios::right)
470  << theNitfImageInfoRecords.size();
471 
472  out.write(outString.str().c_str(), 3);
473 
474  for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
475  {
476  out.write(theNitfImageInfoRecords[idx].theImageSubheaderLength, 6);
477  out.write(theNitfImageInfoRecords[idx].theImageLength, 10);
478  }
479  }
480  {
481  std::ostringstream outString;
482 
483  outString << std::setw(3)
484  << std::setfill('0')
485  << std::setiosflags(ios::right)
486  << theNitfSymbolInfoRecords.size();
487 
488  out.write(outString.str().c_str(), 3);
489 
490  for(idx = 0; idx < theNitfSymbolInfoRecords.size(); ++idx)
491  {
492  out.write(theNitfSymbolInfoRecords[idx].theSymbolSubheaderLength, 4);
493  out.write(theNitfSymbolInfoRecords[idx].theSymbolLength, 6);
494  }
495  }
496  {
497  std::ostringstream outString;
498 
499  outString << std::setw(3)
500  << std::setfill('0')
501  << std::setiosflags(ios::right)
502  << theNitfLabelInfoRecords.size();
503 
504  out.write(outString.str().c_str(), 3);
505 
506  for(idx = 0; idx < theNitfLabelInfoRecords.size(); ++idx)
507  {
508  out.write(theNitfLabelInfoRecords[idx].theLabelSubheaderLength, 4);
509  out.write(theNitfLabelInfoRecords[idx].theLabelLength, 3);
510  }
511  }
512  {
513  std::ostringstream outString;
514 
515  outString << std::setw(3)
516  << std::setfill('0')
517  << std::setiosflags(ios::right)
518  << theNitfTextInfoRecords.size();
519 
520  out.write(outString.str().c_str(), 3);
521 
522  for(idx = 0; idx < theNitfTextInfoRecords.size(); ++idx)
523  {
524  out.write(theNitfTextInfoRecords[idx].theTextSubheaderLength, 4);
525  out.write(theNitfTextInfoRecords[idx].theTextLength, 5);
526  }
527  }
528  {
529  std::ostringstream outString;
530 
531  outString << std::setw(3)
532  << std::setfill('0')
533  << std::setiosflags(ios::right)
535 
536  out.write(outString.str().c_str(), 3);
537 
538  for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
539  {
540  out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegSubheaderLength, 4);
541  out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegLength, 9);
542  }
543  }
544  {
545  std::ostringstream outString;
546 
547  outString << std::setw(3)
548  << std::setfill('0')
549  << std::setiosflags(ios::right)
550  << theNitfResExtSegInfoRecords.size();
551 
552  out.write(outString.str().c_str(), 3);
553 
554  for(idx = 0; idx < theNitfResExtSegInfoRecords.size(); ++idx)
555  {
556  out.write(theNitfResExtSegInfoRecords[idx].theResExtSegSubheaderLength, 4);
557  out.write(theNitfResExtSegInfoRecords[idx].theResExtSegLength, 7);
558  }
559  }
560  out.write(theUserDefinedHeaderDataLength, 5);
562  {
563  out.write(theUserDefinedHeaderOverflow, 3);
564  }
565  ossim_uint32 totalLength = getTotalTagLength();
566  if(totalLength <= 99999)
567  {
568  std::ostringstream tempOut;
569 
570  tempOut << std::setw(5)
571  << std::setfill('0')
572  << std::setiosflags(ios::right)
573  << totalLength;
574 
575  memcpy(theExtendedHeaderDataLength, tempOut.str().c_str(), 5);
576 
577  out.write(theExtendedHeaderDataLength, 5);
578 
579  // for now we hard code te 000 for we do not currently support writing to the DES if the total tag length is
580  // larger than supported
581  //
582  memset(theExtendedHeaderOverflow, '0', 3);
583  if(totalLength > 0)
584  {
585  ossim_uint32 i = 0;
586  out.write(theExtendedHeaderOverflow, 3);
587 
588  for(i = 0; i < theTagList.size(); ++i)
589  {
590  theTagList[i].writeStream(out);
591  }
592  }
593  }
594  else
595  {
596  ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_0::writeStream: Only support writing of total tag length < 99999" << std::endl;
597  }
598 }
599 
601  const std::string& prefix) const
602 {
603  out << setiosflags(std::ios::left)
604  << prefix << std::setw(24) << "FHDR:"
605  << theFileTypeVersion << "\n"
606  << prefix << std::setw(24) << "CLEVEL:"
607  << theComplexityLevel << "\n"
608  << prefix << std::setw(24) << "STYPE:"
609  << theSystemType << "\n"
610  << prefix << std::setw(24) << "OSTAID:"
611  << theOriginatingStationId << "\n"
612  << prefix << std::setw(24) << "FDT:"
613  << theDateTime << "\n"
614  << prefix << std::setw(24) << "FTITLE:"
615  << theFileTitle << "\n"
616  << prefix << std::setw(24) << "FSCLAS:"
617  << theSecurityClassification << "\n"
618  << prefix << std::setw(24) << "FSCODE:"
619  << theCodewords << "\n"
620  << prefix << std::setw(24) << "FSCTLH:"
621  << theControlAndHandling << "\n"
622  << prefix << std::setw(24) << "FSREL:"
623  << theReleasingInstructions << "\n"
624  << prefix << std::setw(24) << "FSCAUT:"
625  << theClassificationAuthority << "\n"
626  << prefix << std::setw(24) << "FSCTLN:"
627  << theSecurityControlNumber << "\n"
628  << prefix << std::setw(24) << "FSDWNG:"
629  << theSecurityDowngrade << "\n"
630  << prefix << std::setw(24) << "FSDEVT:"
631  << theDowngradingEvent << "\n"
632  << prefix << std::setw(24) << "FSCOP:"
633  << theCopyNumber << "\n"
634  << prefix << std::setw(24) << "FSCPYS:"
635  << theNumberOfCopies << "\n"
636  << prefix << std::setw(24) << "ENCRYP:"
637  << theEncryption << "\n"
638  << prefix << std::setw(24) << "ONAME:"
639  << theOriginatorsName << "\n"
640  << prefix << std::setw(24) << "OPHONE:"
641  << theOriginatorsPhone << "\n"
642  << prefix << std::setw(24) << "FL:"
643  << theFileLength << "\n"
644  << prefix << std::setw(24) << "HL:"
645  << theHeaderLength << "\n"
646  << prefix << std::setw(24) << "NUMI:"
647  << theNumberOfImageInfoRecords << "\n";
648 
649  ossim_uint32 index;
650 
651  for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
652  {
654  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
655 
656  ossimString tmpStr = "LISH";
657  tmpStr += os.str();
658 
659  out << prefix << std::setw(24) << tmpStr
660  << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
661  tmpStr = "LI";
662  tmpStr += os.str();
663 
664  out << prefix << std::setw(24) << tmpStr
665  << theNitfImageInfoRecords[index].theImageLength << "\n";
666  }
667 
668  out << prefix << std::setw(24) << "NUMS:" << theNumberOfSymbolInfoRecords
669  << "\n";
670 
671  for (index = 0; index < theNitfSymbolInfoRecords.size(); ++index)
672  {
674  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
675 
676  ossimString tmpStr = "LSSH";
677  tmpStr += os.str();
678 
679  out << tmpStr
680  << theNitfSymbolInfoRecords[index].theSymbolSubheaderLength << "\n";
681 
682  tmpStr = "LS";
683  tmpStr += os.str();
684 
685  out << tmpStr
686  << theNitfSymbolInfoRecords[index].theSymbolLength << "\n";
687  }
688 
689 
690  out << prefix << std::setw(24) << "NUML:" << theNumberOfLabelInfoRecords
691  << "\n";
692 
693  for (index = 0; index < theNitfLabelInfoRecords.size(); ++index)
694  {
696  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
697 
698  ossimString tmpStr = "LLSH";
699  tmpStr += os.str();
700 
701  out << tmpStr
702  << theNitfLabelInfoRecords[index].theLabelSubheaderLength << "\n";
703 
704  tmpStr = "LL";
705  tmpStr += os.str();
706 
707  out << tmpStr
708  << theNitfLabelInfoRecords[index].theLabelLength << "\n";
709  }
710 
711  out << prefix << std::setw(24) << "NUMT:" << theNumberOfTextFileInfoRecords
712  << "\n";
713 
714  for (index = 0; index < theNitfTextInfoRecords.size(); ++index)
715  {
717  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
718 
719  ossimString tmpStr = "LTSH";
720  tmpStr += os.str();
721 
722  out << prefix << std::setw(24) << tmpStr
723  << theNitfTextInfoRecords[index].theTextSubheaderLength << "\n";
724 
725  tmpStr = "LT";
726  tmpStr += os.str();
727 
728  out << prefix << std::setw(24) << tmpStr
729  << theNitfTextInfoRecords[index].theTextLength<< "\n";
730  }
731 
732  out << prefix << std::setw(24) << "NUMDES:"
734 
735  for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
736  {
738  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
739 
740  ossimString tmpStr = "LDSH";
741  tmpStr += os.str();
742 
743  out << prefix << std::setw(24) << tmpStr
744  << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
745  << "\n";
746 
747  tmpStr = "LD";
748  tmpStr += os.str();
749 
750  out << prefix << std::setw(24) << tmpStr
751  << theNitfDataExtSegInfoRecords[index].theDataExtSegLength << "\n";
752  }
753 
754  out << prefix << std::setw(24) << "NUMRES:"
756 
757  for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
758  {
760  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
761 
762  ossimString tmpStr = "LRSH";
763  tmpStr += os.str();
764 
765  out << tmpStr
766  << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
767  << "\n";
768 
769  tmpStr = "LR";
770  tmpStr += os.str();
771 
772  out << tmpStr
773  << theNitfResExtSegInfoRecords[index].theResExtSegLength
774  << "\n";
775  }
776 
777  out << prefix << std::setw(24) << "UDHDL:"
779  << prefix << std::setw(24) << "UDHOFL:"
781  << prefix << std::setw(24) << "XHDL:"
782  << theExtendedHeaderDataLength << "\n";
783 
784  return ossimNitfFileHeader::print(out, prefix);
785 }
786 
787 
789 {
790  bool result = ossimNitfFileHeaderV2_X::saveState(kwl, prefix);
791 
792  if(result)
793  {
794  kwl.add(prefix, "FSCODE",theCodewords);
795  kwl.add(prefix, "FSCTLH",theControlAndHandling);
796  kwl.add(prefix, "FSREL",theReleasingInstructions);
797  kwl.add(prefix, "FSCAUT",theClassificationAuthority);
798  kwl.add(prefix, "FSCTLN",theSecurityControlNumber);
799  kwl.add(prefix, "FSDWNG",theSecurityDowngrade);
800  kwl.add(prefix, "FSDEVT",theDowngradingEvent);
801  kwl.add(prefix, "ONAME",theOriginatorsName);
802  kwl.add(prefix, "OPHONE",theOriginatorsPhone);
803  kwl.add(prefix, "FL",theFileLength);
804  kwl.add(prefix, "HL",theHeaderLength);
805  kwl.add(prefix, "NUMI",theNumberOfImageInfoRecords);
806  kwl.add(prefix, "UDHDL",theUserDefinedHeaderDataLength);
807  kwl.add(prefix, "UDHOFL",theUserDefinedHeaderDataLength);
808  kwl.add(prefix, "XHDL",theExtendedHeaderDataLength);
809 
810  std::ostringstream out;
811  ossim_uint32 index;
812  for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
813  {
815  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
816 
817  ossimString tmpStr = "LISH";
818  tmpStr += os.str();
819 
820  out << tmpStr
821  << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
822  tmpStr = "LI";
823  tmpStr += os.str();
824 
825  out << tmpStr
826  << theNitfImageInfoRecords[index].theImageLength << "\n";
827  }
828 
829  out <<"NUMS:" << theNumberOfSymbolInfoRecords
830  << "\n";
831 
832  for (index = 0; index < theNitfSymbolInfoRecords.size(); ++index)
833  {
835  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
836 
837  ossimString tmpStr = "LSSH";
838  tmpStr += os.str();
839 
840  out << tmpStr
841  << theNitfSymbolInfoRecords[index].theSymbolSubheaderLength << "\n";
842 
843  tmpStr = "LS";
844  tmpStr += os.str();
845 
846  out << tmpStr
847  << theNitfSymbolInfoRecords[index].theSymbolLength << "\n";
848  }
849 
850 
851  out << "NUML:" << theNumberOfLabelInfoRecords
852  << "\n";
853 
854  for (index = 0; index < theNitfLabelInfoRecords.size(); ++index)
855  {
857  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
858 
859  ossimString tmpStr = "LLSH";
860  tmpStr += os.str();
861 
862  out << tmpStr
863  << theNitfLabelInfoRecords[index].theLabelSubheaderLength << "\n";
864 
865  tmpStr = "LL";
866  tmpStr += os.str();
867 
868  out << tmpStr
869  << theNitfLabelInfoRecords[index].theLabelLength << "\n";
870  }
871 
872  out << "NUMT:" << theNumberOfTextFileInfoRecords
873  << "\n";
874 
875  for (index = 0; index < theNitfTextInfoRecords.size(); ++index)
876  {
878  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
879 
880  ossimString tmpStr = "LTSH";
881  tmpStr += os.str();
882 
883  out << tmpStr
884  << theNitfTextInfoRecords[index].theTextSubheaderLength << "\n";
885 
886  tmpStr = "LT";
887  tmpStr += os.str();
888 
889  out << tmpStr
890  << theNitfTextInfoRecords[index].theTextLength<< "\n";
891  }
892 
893  out << "NUMDES:"
895 
896  for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
897  {
899  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
900 
901  ossimString tmpStr = "LDSH";
902  tmpStr += os.str();
903 
904  out << tmpStr
905  << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
906  << "\n";
907 
908  tmpStr = "LD";
909  tmpStr += os.str();
910 
911  out << tmpStr
912  << theNitfDataExtSegInfoRecords[index].theDataExtSegLength << "\n";
913  }
914 
915  out << "NUMRES:"
917 
918  for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
919  {
921  os << std::setw(3) << std::setfill('0') << (index+1) << ":";
922 
923  ossimString tmpStr = "LRSH";
924  tmpStr += os.str();
925 
926  out << tmpStr
927  << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
928  << "\n";
929 
930  tmpStr = "LR";
931  tmpStr += os.str();
932 
933  out << tmpStr
934  << theNitfResExtSegInfoRecords[index].theResExtSegLength
935  << "\n";
936  }
937 
938  {
939  std::istringstream in(out.str());
940  ossimKeywordlist tempKwl;
941  if(tempKwl.parseStream(in))
942  {
943  result = true;
944  kwl.add(prefix, tempKwl);
945  }
946  }
947  }
948 
949  return result;
950 }
951 
953 {
954  return theImageRect;
955 }
956 
958 {
959  theNitfImageInfoRecords.push_back(recordInfo);
960 
962 }
963 
965 {
966  theNitfImageInfoRecords[i]=recordInfo;
967 }
968 
971  ossim::istream& in)const
972 {
973  ossimNitfImageHeader *result = 0;
974 
975  if( (getNumberOfImages() > 0) && (imageNumber < theImageOffsetList.size()) )
976  {
977  result = allocateImageHeader();
978  in.seekg(theImageOffsetList[imageNumber].theImageHeaderOffset, std::ios::beg);
979  result->parseStream(in);
980  }
981  else
982  {
983 #if 0
984  ossimNotify(ossimNotifyLevel_FATAL) << "ossimNitfFileHeaderV2_0::getNewImageHeader ERROR:"
985  << "\nNo images in file or image number (" << imageNumber
986  << ") is out of range!\n";
987 #endif
988  }
989 
990  return result;
991 }
992 
994  ossim_uint32 symbolNumber, ossim::istream& in)const
995 {
996  ossimNitfSymbolHeader *result = 0;
997 
998  if( (getNumberOfSymbols() > 0) &&
999  (symbolNumber < theSymbolOffsetList.size()) )
1000  {
1001  result = allocateSymbolHeader();
1002  in.seekg(theSymbolOffsetList[symbolNumber].theSymbolHeaderOffset, std::ios::beg);
1003  result->parseStream(in);
1004  }
1005 
1006  return result;
1007 }
1008 
1010  ossim_uint32 labelNumber, ossim::istream& in)const
1011 {
1012  ossimNitfLabelHeader *result = 0;
1013 
1014  if( (getNumberOfLabels() > 0) &&
1015  (labelNumber < theLabelOffsetList.size()) )
1016  {
1017  result = allocateLabelHeader();
1018  in.seekg(theLabelOffsetList[labelNumber].theLabelHeaderOffset, std::ios::beg);
1019  result->parseStream(in);
1020  }
1021 
1022  return result;
1023 }
1024 
1026  ossim_uint32 textNumber, ossim::istream& in)const
1027 {
1028  ossimNitfTextHeader *result = 0;
1029 
1030  if( (getNumberOfTextSegments() > 0) &&
1031  (textNumber < theTextOffsetList.size()) )
1032  {
1033  result = allocateTextHeader();
1034  in.seekg(theTextOffsetList[textNumber].theTextHeaderOffset, std::ios::beg);
1035  result->parseStream(in);
1036  }
1037 
1038  return result;
1039 }
1040 
1042  ossim::istream& in)const
1043 {
1044  ossimNitfDataExtensionSegment *result = 0;
1045 
1046  if((getNumberOfDataExtSegments() > 0) &&
1047  (dataExtNumber < (ossim_int32)theNitfDataExtSegInfoRecords.size()) &&
1048  (dataExtNumber >= 0))
1049  {
1050  result = allocateDataExtSegment();
1051  in.seekg(theDataExtSegOffsetList[dataExtNumber].theDataExtSegHeaderOffset, std::ios::beg);
1052  result->parseStream(in, theNitfDataExtSegInfoRecords[dataExtNumber].getImageLength());
1053  }
1054 
1055  return result;
1056 }
1057 
1059 {
1060  // we will need to temporarily save the get pointer since
1061  // initializeDisplayLevels changes it.
1062  std::streampos saveTheGetPointer = in.tellg();
1063 
1064  std::vector<ossimNitfImageOffsetInformation>::iterator imageOffsetList = theImageOffsetList.begin();
1065 
1066  // allocate temporary space to store image headers
1067  ossimNitfImageHeader* imageHeader = allocateImageHeader();
1068 
1069  // clear the list
1070  theDisplayInformationList.clear();
1071 
1072  theImageRect = ossimDrect(0,0,0,0);
1073  if(!imageHeader)
1074  {
1075  return;
1076  }
1077 
1078  ossim_uint32 idx = 0;
1079  while(imageOffsetList != theImageOffsetList.end())
1080  {
1081  // position the get pointer in the input
1082  // stream to the start of the image header
1083  in.seekg((*imageOffsetList).theImageHeaderOffset, std::ios::beg);
1084  // get the data
1085  imageHeader->parseStream(in);
1086  // create a union of rects. The result should be the image rect.
1087  ossimDrect tempRect = imageHeader->getImageRect();
1088  if((tempRect.width() > 1) &&
1089  (tempRect.height() > 1))
1090  {
1091  theImageRect = theImageRect.combine(tempRect);
1092  }
1093 
1095  imageHeader->getDisplayLevel(),
1096  idx));
1097 
1098  ++imageOffsetList;
1099  ++idx;
1100  }
1101  delete imageHeader;
1102  imageHeader = 0;
1103 
1104 
1105 
1106  // finally we reset the saved get state back
1107  // to its original position
1108  in.seekg(saveTheGetPointer, std::ios::beg);
1109 }
1110 
1112 {
1113  std::vector<ossimNitfDisplayInfo>::iterator displayList = theDisplayInformationList.begin();
1114 
1115  while(displayList != theDisplayInformationList.end())
1116  {
1117  if(displayInformation.theDisplayLevel < (*displayList).theDisplayLevel)
1118  {
1119  theDisplayInformationList.insert(displayList, displayInformation);
1120  return;
1121  }
1122  ++displayList;
1123  }
1124 
1125  // If we get here it means it's larger than all others
1126  // and we push onto the end
1127  theDisplayInformationList.push_back(displayInformation);
1128 }
1129 
1131 {
1132  // this will be a running tally
1133  ossim_uint64 tally = theHeaderSize;
1134  ossim_uint32 idx = 0;
1135 
1136  // clear out all offset inforamtion and begin populating them
1137  theImageOffsetList.clear();
1138  theSymbolOffsetList.clear();
1139  theLabelOffsetList.clear();
1140  theLabelOffsetList.clear();
1141 
1142 
1143  for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
1144  {
1146  tally + theNitfImageInfoRecords[idx].getHeaderLength()));
1147  tally += theNitfImageInfoRecords[idx].getTotalLength();
1148  }
1149  for(idx = 0; idx < theNitfSymbolInfoRecords.size(); ++idx)
1150  {
1152  tally + theNitfSymbolInfoRecords[idx].getHeaderLength()));
1153  tally += theNitfSymbolInfoRecords[idx].getTotalLength();
1154  }
1155 
1156  for(idx = 0; idx < theNitfLabelInfoRecords.size(); ++idx)
1157  {
1159  tally + theNitfLabelInfoRecords[idx].getHeaderLength()));
1160  tally += theNitfLabelInfoRecords[idx].getTotalLength();
1161  }
1162 
1163  for(idx = 0; idx < theNitfTextInfoRecords.size(); ++idx)
1164  {
1166  tally + theNitfTextInfoRecords[idx].getHeaderLength()));
1167  tally += theNitfTextInfoRecords[idx].getTotalLength();
1168  }
1169 
1170  for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
1171  {
1173  tally + theNitfDataExtSegInfoRecords[idx].getHeaderLength()));
1174  tally += theNitfDataExtSegInfoRecords[idx].getTotalLength();
1175  }
1176 }
1177 
1179 {
1180  return new ossimNitfImageHeaderV2_0;
1181 }
1182 
1184 {
1185  return new ossimNitfSymbolHeaderV2_0;
1186 }
1187 
1189 {
1190  return new ossimNitfLabelHeaderV2_0;
1191 }
1192 
1194 {
1195  return new ossimNitfTextHeaderV2_0;
1196 }
1197 
1199 {
1200  return new ossimNitfDataExtensionSegmentV2_0();
1201 }
1202 
1204 {
1205  return (theEncryption[0] == '1');
1206 }
1207 
1209 {
1210  return (ossim_int32)theNitfImageInfoRecords.size();
1211 }
1212 
1214 {
1215  return ((ossim_int32)theNitfLabelInfoRecords.size());
1216 }
1217 
1219 {
1220  return ((ossim_int32)theNitfSymbolInfoRecords.size());
1221 }
1222 
1224 {
1225  return 0;
1226 }
1227 
1229 {
1230  return (ossim_int32)theNitfTextInfoRecords.size();
1231 }
1232 
1234 {
1236 }
1237 
1239 {
1240  return theHeaderSize;
1241 }
1242 
1244 {
1245  return theNitfResExtSegInfoRecords.size();
1246 }
1247 
1249 {
1250  ossimString temp = theFileLength;
1251  if(temp == "999999999999")
1252  {
1253  return -1;
1254  }
1255  else
1256  {
1257  return temp.toInt64();
1258  }
1259 }
1260 
1262 {
1263  return &theFileTypeVersion[4];
1264 }
1265 
1267 {
1268  return theDateTime;
1269 }
1270 
1272 {
1274 }
1275 
1277 {
1278  theDisplayInformationList.clear();
1279  theImageOffsetList.clear();
1280  theSymbolOffsetList.clear();
1281  theLabelOffsetList.clear();
1282  theTextOffsetList.clear();
1283  theDataExtSegOffsetList.clear();
1284  theNitfSymbolInfoRecords.clear();
1285  theNitfLabelInfoRecords.clear();
1286  theNitfTextInfoRecords.clear();
1289 
1290  theFilename = "";
1291  memcpy(theFileTypeVersion, "NITF02.00", 9);
1292  memset(theComplexityLevel, ' ', 2);
1293  memset(theSystemType, ' ', 4);
1294  memset(theOriginatingStationId, ' ', 10);
1295  memset(theDateTime, ' ', 14);
1296  memset(theFileTitle, ' ', 80);
1297  memset(theSecurityClassification, ' ', 1);
1298  memset(theCodewords, ' ', 40);
1299  memset(theControlAndHandling, ' ', 40);
1300  memset(theReleasingInstructions, ' ', 40);
1301  memset(theClassificationAuthority, ' ', 20);
1302  memset(theSecurityControlNumber, ' ', 20);
1303  memset(theSecurityDowngrade, ' ', 6);
1304  memset(theDowngradingEvent, ' ', 40);
1305  memset(theCopyNumber, ' ', 5);
1306  memset(theNumberOfCopies, ' ', 5);
1307  memset(theEncryption, ' ', 1);
1308  memset(theOriginatorsName, ' ', 27);
1309  memset(theOriginatorsPhone, ' ', 18);
1310  memset(theFileLength, ' ', 12);
1311  memset(theHeaderLength, ' ', 6);
1312  memset(theNumberOfImageInfoRecords, ' ', 3);
1313  memset(theNumberOfSymbolInfoRecords, ' ', 3);
1314  memset(theNumberOfLabelInfoRecords, ' ', 3);
1315  memset(theNumberOfTextFileInfoRecords, ' ', 3);
1316  memset(theNumberOfDataExtSegInfoRecords, ' ', 3);
1317  memset(theNumberOfResExtSegInfoRecords, ' ', 3);
1318  memset(theUserDefinedHeaderDataLength, '0', 5);
1319  memset(theUserDefinedHeaderOverflow, ' ', 3);
1320  memset(theExtendedHeaderDataLength, '0', 5);
1321  memset(theExtendedHeaderOverflow, ' ', 3);
1322 
1323  theFileTypeVersion[9] = '\0';
1324  theComplexityLevel[2] = '\0';
1325  theSystemType[4] = '\0';
1326  theOriginatingStationId[10] = '\0';
1327  theDateTime[14] = '\0';
1328  theFileTitle[80] = '\0';
1329  theSecurityClassification[1] = '\0';
1330  theCodewords[40] = '\0';
1331  theControlAndHandling[40] = '\0';
1332  theReleasingInstructions[40] = '\0';
1333  theClassificationAuthority[20] = '\0';
1334  theSecurityControlNumber[20] = '\0';
1335  theSecurityDowngrade[6] = '\0';
1336  theDowngradingEvent[40] = '\0';
1337  theCopyNumber[5] = '\0';
1338  theNumberOfCopies[5] = '\0';
1339  theEncryption[1] = '\0';
1340  theOriginatorsName[27] = '\0';
1341  theOriginatorsPhone[18] = '\0';
1342  theFileLength[12] = '\0';
1343  theHeaderLength[6] = '\0';
1344  theNumberOfImageInfoRecords[3] = '\0';
1345  theNumberOfSymbolInfoRecords[3] = '\0';
1346  theNumberOfLabelInfoRecords[3] = '\0';
1351  theUserDefinedHeaderOverflow[3] = '\0';
1352  theExtendedHeaderDataLength[5] = '\0';
1353  theExtendedHeaderOverflow[3] = '\0';
1354  theHeaderSize = 0;
1355 }
1356 
1358 {
1359  if (num < 1000)
1360  {
1361  std::ostringstream out;
1362 
1363  out << std::setw(3)
1364  << std::setfill('0')
1365  << std::setiosflags(ios::right)
1366  << num;
1367 
1368  memcpy(theNumberOfImageInfoRecords, out.str().c_str(), 3);
1369  }
1370  else
1371  {
1372  std::string s = "ossimNitfFileHeaderV2_0::setNumberOfImageInfoRecords:";
1373  s += " ERROR\nExceeded max image info number of 999!";
1374  if (traceDebug())
1375  {
1376  ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
1377  }
1378  throw std::out_of_range(s);
1379  }
1380 }
1381 
1383 {
1385  ossim_int32 index;
1386 
1387  theNitfImageInfoRecords.clear();
1388  for(index=0; index < numberOfImages; index++)
1389  {
1391 
1392  in.read(temp.theImageSubheaderLength, 6);
1393  in.read(temp.theImageLength, 10);
1394  theHeaderSize+=16;
1395  temp.theImageSubheaderLength[6] = '\0';
1396  temp.theImageLength[10] = '\0';
1397 
1398  theNitfImageInfoRecords.push_back(temp);
1399  }
1400 }
1401 
1403 {
1405  ossim_int32 index;
1406 
1407  theNitfSymbolInfoRecords.clear();
1408 
1409  for(index=0; index < numberOfSymbols; index++)
1410  {
1412 
1413 
1414  in.read(temp.theSymbolSubheaderLength, 4);
1415  in.read(temp.theSymbolLength, 6);
1416  theHeaderSize+=10;
1417 
1418  temp.theSymbolSubheaderLength[4] = '\0';
1419  temp.theSymbolLength[6] = '\0';
1420 
1421  theNitfSymbolInfoRecords.push_back(temp);
1422  }
1423 }
1424 
1426 {
1428  ossim_int32 index;
1429 
1430  theNitfLabelInfoRecords.clear();
1431 
1432  for(index=0; index < numberOfLabels; index++)
1433  {
1435 
1436  in.read(temp.theLabelSubheaderLength, 4);
1437  in.read(temp.theLabelLength, 3);
1438  theHeaderSize+=7;
1439  temp.theLabelSubheaderLength[4] = '\0';
1440  temp.theLabelLength[3] = '\0';
1441 
1442  theNitfLabelInfoRecords.push_back(temp);
1443  }
1444 }
1445 
1447 {
1449  ossim_int32 index;
1450 
1451  theNitfTextInfoRecords.clear();
1452  for(index=0; index < numberOfTextFiles; index++)
1453  {
1455 
1456  in.read(temp.theTextSubheaderLength, 4);
1457  in.read(temp.theTextLength, 5);
1458  theHeaderSize+=9;
1459 
1460  temp.theTextSubheaderLength[4] = '\0';
1461  temp.theTextLength[5] = '\0';
1462 
1463  theNitfTextInfoRecords.push_back(temp);
1464  }
1465 }
1466 
1468 {
1470  ossim_int32 index;
1471 
1473  for(index=0; index < numberOfDataExtSegs; index++)
1474  {
1476 
1477  in.read(temp.theDataExtSegSubheaderLength, 4);
1478  in.read(temp.theDataExtSegLength, 9);
1479  theHeaderSize+=13;
1480 
1481  temp.theDataExtSegSubheaderLength[4] = '\0';
1482  temp.theDataExtSegLength[9] = '\0';
1483 
1484  theNitfDataExtSegInfoRecords.push_back(temp);
1485  }
1486 }
1487 
1489 {
1491  ossim_int32 index;
1492 
1494  for(index=0; index < numberOfResExtSegs; index++)
1495  {
1497 
1498  in.read(temp.theResExtSegSubheaderLength, 4);
1499  in.read(temp.theResExtSegLength, 7);
1500  theHeaderSize+=11;
1501 
1502  temp.theResExtSegSubheaderLength[4] = '\0';
1503  temp.theResExtSegLength[7] = '\0';
1504 
1505  theNitfResExtSegInfoRecords.push_back(temp);
1506  }
1507 }
1508 
1510 {
1511  ossimNitfCommon::setField(theComplexityLevel, complianceLevel, 2);
1512 }
1513 
1515 {
1516  ossimNitfCommon::setField(theCodewords, codeWords, 40);
1517 }
1518 
1520 {
1521  ossimNitfCommon::setField(theControlAndHandling, controlAndHandling, 40);
1522 }
1523 
1525 {
1526  ossimNitfCommon::setField(theReleasingInstructions, releasingInstructions, 40);
1527 }
1528 
1530 {
1532 }
1533 
1535 {
1537 }
1538 
1540 {
1541  ossimNitfCommon::setField(theOriginatorsName, originatorName, 27);
1542 }
1543 
1545 {
1546  ossimNitfCommon::setField(theOriginatorsPhone, originatorPhone, 18);
1547 }
1548 
1550 {
1551  ossimNitfCommon::setField(theSecurityDowngrade, securityDowngrade, 6);
1552 }
1553 
1555 {
1556  ossimNitfCommon::setField(theDowngradingEvent, downgradeEvent, 40);
1557 }
1558 
1560 {
1561  std::ostringstream out;
1562 
1563  out << std::setw(12)
1564  << std::setfill('0')
1565  << std::setiosflags(ios::right)
1566  << fileLength;
1567 
1568  memcpy(theFileLength, out.str().c_str(), 12);
1569 }
1570 
1572 {
1573  std::ostringstream out;
1574 
1575  out << std::setw(6)
1576  << std::setfill('0')
1577  << std::setiosflags(ios::right)
1578  << headerLength;
1579 
1580  memcpy(theHeaderLength, out.str().c_str(), 6);
1581 }
1582 
1584 {
1585  return theComplexityLevel;
1586 }
1587 
1589 {
1590  return theSecurityDowngrade;
1591 }
1592 
1594 {
1595  return theDowngradingEvent;
1596 }
1597 
1599 {
1600  return theCodewords;
1601 }
1602 
1604 {
1605  return theControlAndHandling;
1606 }
1607 
1609 {
1610  return theReleasingInstructions;
1611 }
1612 
1614 {
1616 }
1617 
1619 {
1620  return theSecurityControlNumber;
1621 }
1622 
1624 {
1625  return theOriginatorsName;
1626 }
1627 
1629 {
1630  return theOriginatorsPhone;
1631 }
1632 
1634 {
1635  const ossimString& name = property->getName();
1636  if(name == CLEVEL_KW)
1637  {
1638  setComplianceLevel(property->valueToString());
1639  }
1640  else if(name == FSDWNG_KW)
1641  {
1642  setSecurityDowngrade(property->valueToString());
1643  }
1644  else if(name == FSDEVT_KW)
1645  {
1646  setDowngradingEvent(property->valueToString());
1647  }
1648  else if(name == ONAME_KW)
1649  {
1650  setOriginatorsName(property->valueToString());
1651  }
1652  else if(name == OPHONE_KW)
1653  {
1654  setOriginatorsPhone(property->valueToString());
1655  }
1656  else
1657  {
1659  }
1660 }
1661 
1663 {
1664  ossimProperty* property = 0;
1665 
1666 
1667  if(name == CLEVEL_KW)
1668  {
1669  property = new ossimStringProperty(name, ossimString(theComplexityLevel).trim());
1670  }
1671  else if(name == FSDWNG_KW)
1672  {
1673  property = new ossimStringProperty(name, ossimString(theSecurityDowngrade).trim());
1674  }
1675  else if(name == FSDEVT_KW)
1676  {
1677  property = new ossimStringProperty(name, ossimString(theDowngradingEvent).trim());
1678  }
1679  else if(name == ONAME_KW)
1680  {
1681  property = new ossimStringProperty(name, ossimString(theOriginatorsName).trim());
1682  }
1683  else if(name == OPHONE_KW)
1684  {
1685  property = new ossimStringProperty(name, ossimString(theOriginatorsPhone).trim());
1686  }
1687  else
1688  {
1690  }
1691  return property;
1692 }
1693 
1694 void ossimNitfFileHeaderV2_0::getPropertyNames(std::vector<ossimString>& propertyNames)const
1695 {
1697 
1698  propertyNames.push_back(CLEVEL_KW);
1699  propertyNames.push_back(STYPE_KW);
1700  propertyNames.push_back(OSTAID_KW);
1701  propertyNames.push_back(FDT_KW);
1702  propertyNames.push_back(FTITLE_KW);
1703  propertyNames.push_back(FSCLAS_KW);
1704  propertyNames.push_back(FSCODE_KW);
1705  propertyNames.push_back(FSCTLH_KW);
1706  propertyNames.push_back(FSREL_KW);
1707  propertyNames.push_back(FSCAUT_KW);
1708  propertyNames.push_back(FSCTLN_KW);
1709  propertyNames.push_back(FSCOP_KW);
1710  propertyNames.push_back(FSCPYS_KW);
1711  propertyNames.push_back(ENCRYP_KW);
1712  propertyNames.push_back(ONAME_KW);
1713  propertyNames.push_back(OPHONE_KW);
1714 }
1715 
virtual void valueToString(ossimString &valueResult) const =0
virtual void setReleasingInstructions(const ossimString &releasingInstructions)
char theComplexityLevel[3]
Field: CLEVEL.
virtual ossimNitfTextHeader * allocateTextHeader() const
static const ossimString FSCOP_KW
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
Print method that outputs a key/value type format adding prefix to keys.
char theOriginatingStationId[11]
Field: OSTAID.
ossimString getSecurityDowngrade() const
void insertIntoDisplayInfoList(const ossimNitfDisplayInfo &displayInformation)
std::vector< ossimNitfSymbolOffsetInformation > theSymbolOffsetList
virtual bool saveState(ossimKeywordlist &kwl, const ossimString &prefix="") const
ossimString getComplianceLevel() const
virtual ossimNitfImageHeader * getNewImageHeader(ossim_uint32 imageNumber, ossim::istream &in) const
virtual void setCodeWords(const ossimString &codeWords)
virtual ossimString getClassificationAuthority() const
virtual ossim_int32 getNumberOfGraphics() const
virtual ossimString getOriginatorsPhone() const
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
std::vector< ossimNitfResExtSegInfoRecordV2_0 > theNitfResExtSegInfoRecords
std::vector< ossimNitfDisplayInfo > theDisplayInformationList
ossim_float64 width() const
Definition: ossimDrect.h:522
virtual ossimNitfSymbolHeader * getNewSymbolHeader(ossim_uint32 symbolNumber, ossim::istream &in) const
char theFileTypeVersion[10]
Field: FHDR Required field for NITF and is a 9 byte value.
static const ossimString FSREL_KW
Represents serializable keyword/value map.
static const ossimString STYPE_KW
virtual std::ostream & print(std::ostream &out, const std::string &prefix=std::string()) const
print method that outputs a key/value type format adding prefix to keys.
char theNumberOfResExtSegInfoRecords[4]
NUMRES:
bool valid() const
Definition: ossimRefPtr.h:75
virtual void replaceImageInfoRecord(ossim_uint32 i, const ossimNitfImageInfoRecordV2_0 &recordInfo)
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void parseStream(ossim::istream &in)
virtual ossimNitfSymbolHeader * allocateSymbolHeader() const
virtual void parseStream(ossim::istream &in)=0
virtual bool isValid() const
isValid will test if the fields are valid and will return true or false.
static const ossimString FSCPYS_KW
virtual ossimString getSecurityClassification() const
static const ossimString FTITLE_KW
void setTagType(const ossimString &tagType) const
void setSubheaderLength(ossim_uint32 length)
virtual ossimNitfLabelHeader * getNewLabelHeader(ossim_uint32 labelNumber, ossim::istream &in) const
std::vector< ossimNitfSymbolInfoRecordV2_0 > theNitfSymbolInfoRecords
std::vector< ossimNitfTextInfoRecordV2_0 > theNitfTextInfoRecords
std::vector< ossimNitfLabelOffsetInformation > theLabelOffsetList
char theSystemType[5]
Field: STYPE.
void setComplianceLevel(const ossimString &complianceLevel)
ossimDrect combine(const ossimDrect &rect) const
Definition: ossimDrect.h:826
static const ossimString FSCLAS_KW
virtual ossim_uint32 getDisplayLevel() const =0
virtual const char * getDateTime() const
virtual ossimString getOriginatorsName() const
virtual ossimString getControlAndHandling() const
virtual ossimNitfDataExtensionSegment * getNewDataExtensionSegment(ossim_int32 dataExtNumber, ossim::istream &in) const
void readImageInfoRecords(ossim::istream &in)
virtual void setClassificationAuthority(const ossimString &classAuth)
virtual ossimNitfLabelHeader * allocateLabelHeader() const
virtual ossim_int32 getNumberOfTextSegments() const
void readTextFileInfoRecords(ossim::istream &in)
std::vector< ossimNitfTagInformation > theTagList
static const ossimString OSTAID_KW
virtual void setHeaderLength(ossim_uint64 headerLength)
Sets header length (HL) field.
virtual ossim_int32 getNumberOfReservedExtSegments() const
virtual ossimString getSecurityControlNumber() const
virtual ossimNitfImageHeader * allocateImageHeader() const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_0 &recordInfo)
ossim_int32 toInt32() const
char theNumberOfDataExtSegInfoRecords[4]
NUMDES:
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimDrect getImageRect() const
virtual ossimNitfTextHeader * getNewTextHeader(ossim_uint32 textNumber, ossim::istream &in) const
virtual void parseStream(std::istream &in)=0
virtual ossimNitfDataExtensionSegment * allocateDataExtSegment() const
virtual ossim_uint32 getTotalTagLength() const
static const ossimString ONAME_KW
static const ossimString FSCODE_KW
std::vector< ossimNitfDataExtSegInfoRecordV2_0 > theNitfDataExtSegInfoRecords
virtual void setSecurityControlNumber(const ossimString &controlNo)
std::vector< ossimNitfLabelInfoRecordV2_0 > theNitfLabelInfoRecords
virtual ossimIrect getImageRect() const =0
char theEncryption[2]
Field: ENCRYP.
virtual ossim_int32 getNumberOfDataExtSegments() const
static const ossimString FSCAUT_KW
virtual ossim_int64 getFileSize() const
std::vector< ossimNitfDataExtSegOffsetInformation > theDataExtSegOffsetList
unsigned long long ossim_uint64
virtual void setProperty(ossimRefPtr< ossimProperty > property)
unsigned int ossim_uint32
virtual ossim_int32 getNumberOfLabels() const
void setNumberOfImageInfoRecords(ossim_uint64 num)
Sets the number of image records in the NITF 2.0 File Header.
char theDateTime[15]
Field: FDT.
virtual void parseStream(std::istream &in, ossim_uint64 dataLength)=0
virtual void setFileLength(ossim_uint64 fileLength)
Sets file length (FL) field.
virtual ossim_int32 getNumberOfSymbols() const
static const ossimString ENCRYP_KW
static const ossimString FSDWNG_KW
Properties of a NITF 2.0 Header file.
virtual ossimString getReleasingInstructions() const
char theDowngradingEvent[41]
FSDEVT: This is a conditional field and is a 40 byte Alphanumeric field.
void readOverflowTags(ossim::istream &in)
void readDataExtSegInfoRecords(ossim::istream &in)
ossim_float64 height() const
Definition: ossimDrect.h:517
virtual void writeStream(ossim::ostream &out)
virtual void parseStream(std::istream &in)=0
virtual void setOriginatorsPhone(const ossimString &origniatorPhone)
virtual ossimString getCodeWords() const
virtual void setOriginatorsName(const ossimString &originatorName)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
virtual ossim_int32 getHeaderSize() const
void readSymbolInfoRecords(ossim::istream &in)
void setDowngradingEvent(const ossimString &downgradeEvent)
char theNumberOfTextFileInfoRecords[4]
NUMT:
static const ossimString CLEVEL_KW
void setImageLength(ossim_uint64 length)
virtual void parseStream(ossim::istream &in)
parse method.
static const ossimString OPHONE_KW
static const ossimString FSCTLH_KW
static const ossimString FSCTLN_KW
ossimString getDowngradingEvent() const
void setSecurityDowngrade(const ossimString &securityDowngrade)
std::ostream & operator<<(std::ostream &out, const ossimNitfImageInfoRecordV2_0 &data)
static void setField(void *fieldDestination, const ossimString &src, std::streamsize width, std::ios_base::fmtflags ioflags=std::ios::left, char fill=' ')
Sets a field with a given string, width, and IOS flags.
char theCopyNumber[6]
Field: FSCOP.
long long ossim_int64
static const ossimString FSDEVT_KW
static const ossimString FDT_KW
std::vector< ossimNitfImageInfoRecordV2_0 > theNitfImageInfoRecords
char theFileTitle[81]
Field: FTITLE.
void readResExtSegInfoRecords(ossim::istream &in)
ossim_int64 toInt64() const
virtual const std::vector< ossimNitfTagInformation > & getTagList() const =0
virtual void parseStream(std::istream &in)=0
char theSecurityClassification[2]
Field: FSCLAS.
#define RTTI_DEF1(cls, name, b1)
Definition: ossimRtti.h:485
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32
char theNumberOfCopies[6]
Field: FSCOPYS.
ossim_uint32 getTagLength() const
Should return the value of theTagLength which is the length of the data in bytes. ...
std::vector< ossimNitfTextOffsetInformation > theTextOffsetList
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
void readLabelInfoRecords(ossim::istream &in)
bool saveState(ossimKeywordlist &kwl, const ossimString &prefix="") const
virtual const char * getVersion() const
void initializeDisplayLevels(ossim::istream &in)
virtual bool isValid() const
isValid will test if the fields are valid and will return true or false.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
int ossim_int32
virtual void setControlAndHandling(const ossimString &controlAndHandling)
char theUserDefinedHeaderDataLength[6]
UDHDL:
virtual ossim_int32 getNumberOfImages() const
std::vector< ossimNitfImageOffsetInformation > theImageOffsetList
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const