OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimRpfFrame.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: LGPL
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 // Description: This class give the capability to access tiles from an
10 // rpf file.
11 //
12 //********************************************************************
13 // $Id: ossimRpfFrame.cpp 23345 2015-05-29 13:05:51Z dburken $
14 
38 #include <ossim/base/ossimEndian.h>
40 #include <ossim/base/ossimTrace.h>
41 #include <istream>
42 #include <ostream>
43 
44 static const ossimTrace traceDebug("ossimRpfFrame:debug");
45 
47 {
48  data.print(out);
49 
50  return out;
51 }
52 
54  :theHeader(0),
55  theFilename(""),
56  theCoverage(0),
57  theAttributes(0),
58  theImageDescriptionSubheader(0),
59  theMaskSubheader(0),
60  theImageDisplayParameterSubheader(0),
61  theCompressionSection(0),
62  theColorGrayscaleSubheader(0),
63  theColorConverterSubsection(0),
64  theNitfFile(0),
65  theSubframeMaskTable(0),
66  theSubframeTransparencyMaskTable(0),
67  theReplaceUpdateTable(0)
68 {
69 }
70 
72 {
73  deleteAll();
74 }
75 
76 std::ostream& ossimRpfFrame::print(std::ostream& out, const std::string& prefix) const
77 {
78  if (traceDebug())
79  {
80  out << "begin_rpf_frame_print:\n";
81  }
82 
83  if(theHeader)
84  {
85  theHeader->print(out, prefix);
86  }
87 
88  out << prefix << "filename: " << theFilename << "\n";
89 
91  {
92  theReplaceUpdateTable->print(out, prefix);
93  }
94 
95  if (traceDebug())
96  {
97  if(theCoverage)
98  {
99  theCoverage->print(out, prefix);
100  }
101  }
102 
103  //---
104  // Derived series code from first two characters of file extension.
105  // Note ChartSeriesCode from RPF Frame attributes may or may not be
106  // present.
107  //---
108  if ( theFilename.size() )
109  {
110  ossimString ext = theFilename.ext();
111  if ( ext.size() > 1 )
112  {
113  ext.upcase();
114  out << prefix << "SeriesCode: " << ext.string().substr(0, 2) << "\n";
115  }
116  }
117 
118  if(theAttributes)
119  {
120  theAttributes->print(out, prefix);
121  }
122 
123  if (traceDebug())
124  {
126  {
127  theImageDescriptionSubheader->print(out, prefix);
128  }
129 
130  if(theMaskSubheader)
131  {
132  out << *theMaskSubheader << endl;
133  }
135  {
136  out << *theImageDisplayParameterSubheader << endl;
137  }
139  {
140  out << *theCompressionSection << endl;
141  }
143  {
144  out << *theColorGrayscaleSubheader << endl;
145  }
147  {
148  out << *theColorConverterSubsection << endl;
149  }
150 
151  copy(theColorGrayscaleTable.begin(),
153  ostream_iterator<ossimRpfColorGrayscaleTable>(out, "\n"));
154 
157  {
158  out << "Subframe Mask Table:" << endl;
159  unsigned long spectralIndex;
160  unsigned long rowIndex;
161  unsigned long colIndex;
162  // first loop through the Mask table and allocate while we do it
163  for(spectralIndex = 0;
165  ++spectralIndex)
166  {
167  for(rowIndex = 0;
169  ++rowIndex)
170  {
171  for(colIndex = 0;
173  ++colIndex)
174  {
175  if( theSubframeMaskTable[spectralIndex][rowIndex][colIndex] == OSSIM_RPF_ULONG_NULL)
176  {
177  out << "NULL ";
178  }
179  else
180  {
181  out << theSubframeMaskTable[spectralIndex][rowIndex][colIndex] << " ";
182  }
183  }
184  out << endl;
185  }
186  }
187  }
188 
189 
192  {
193  out << "Transparency Mask Table:" << endl;
194  unsigned long spectralIndex;
195  unsigned long rowIndex;
196  unsigned long colIndex;
197  // first loop through the Mask table and allocate while we do it
198  for(spectralIndex = 0;
200  ++spectralIndex)
201  {
202  for(rowIndex = 0;
204  ++rowIndex)
205  {
206  for(colIndex = 0;
208  ++colIndex)
209  {
210  if( theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] == OSSIM_RPF_ULONG_NULL)
211  {
212  out << "NULL ";
213  }
214  else
215  {
216  out << theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] << " ";
217  }
218  }
219  }
220  }
221  }
222 
223 
224 
225  out << "end_rpf_frame_print:\n";
226 
227  } // matches: if (traceDebug())
228 
229  out << std::endl;
230 
231  return out;
232 }
233 
235  bool minimalParse)
236 {
237  if(traceDebug())
238  {
239  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfFrame::parseFile: entered......" << std::endl;
240  }
242 
243  //Make sure any fileds have beend cleared
244  clearFields();
245 
246  // Make sure all data is deleted. The initialize call the
247  // populate methods. These methods will re-allocate the information
248  deleteAll();
249 
250 
252  theNitfFile->parseFile(filename);
253 
254  const ossimRefPtr<ossimNitfFileHeader> nitfFileHeader =
256 
257  if(!nitfFileHeader)
258  {
259  theNitfFile = 0;
260 
262  }
264  nitfFileHeader->getTag(info, "RPFHDR");
265 
266  theFilename = filename;
267  if(info.getTagName() == "RPFHDR")
268  {
269  ifstream in(filename.c_str(), ios::in|ios::binary);
270  // set the get pointer for the stream to the start
271  // of the Rpf header data
272  in.seekg(info.getTagDataOffset(), ios::beg);
273 
274  if(theHeader) delete theHeader;
276 
277  // if(theHeader->parseStream(in) != ossimErrorCodes::OSSIM_OK)
278  theHeader->parseStream(in);
279 
280  if ( in.fail() )
281  {
282  deleteAll();
283 
285  }
286  else
287  // if(!in.fail()&&theHeader)
288  {
289  result = populateAttributeSection(in);
290 
291  // This is needed for ossim-rpf --list-frames so NOT put in full parse section.
292  if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
293  {
294  result = populateReplaceUpdateTable(in);
295  }
296 
297  if ( minimalParse == false )
298  {
299  if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
300  {
302  }
303  if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
304  {
305  result = populateCoverageSection(in);
306  }
307  if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
308  {
309  result = populateImageSection(in);
310  }
311  if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
312  {
313  result = populateColorGrayscaleSection(in);
314  }
315  if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
316  {
317  result = populateMasks(in);
318  }
319  }
320  }
321  }
322  else
323  {
325  }
326 
328 }
329 
331 {
333  {
335  }
336 
337  return false;
338 
339 }
340 
342  ossim_uint32 /* spectralGroup */,
343  ossim_uint32 row,
344  ossim_uint32 col)const
345 {
348  theHeader&&
349  (col < theImageDescriptionSubheader->getNumberOfSubframesHorizontal()) &&
350  (row < theImageDescriptionSubheader->getNumberOfSubframesVertical()))
351  {
353 
355  {
356  return false;
357  }
358 
359  ossim_uint32 offset = info.m_componentLocation;
360  ossim_uint32 bytesPerSubframe = 0;
361 
362  // note that the code length is bit encoded so we must devide by 8
363  // in order to get the byte offset instead of the bit offset. We
364  // then add that to the start of the spatial data section which is
365  // the current value of offset.
369 
370 
372  {
373  // check to see if the offset is NULL. If it is
374  // then just return false to let the caller know that the
375  // buffer did not exist.
376  if(theSubframeMaskTable[0][row][col] != OSSIM_RPF_ULONG_NULL)
377  {
378  offset += theSubframeMaskTable[0][row][col];
379  }
380  else
381  {
382  return false;
383  }
384  }
385  else
386  {
388  col);
389  offset += bytes;
390  }
391 
392  // now since we have the adjustment and we got to this point then
393  // we can read in the data into the destination buffer.
394  ifstream in(theFilename.c_str(), ios::in|ios::binary);
395  if(!in.fail())
396  {
397  in.seekg(offset, ios::beg);
398  in.read((char*)buffer, bytesPerSubframe);
399  if(in.fail())
400  {
401  return false;
402  }
403  }
404  else
405  {
406  return false;
407  }
408  }
409  else
410  {
411  // this is if it was not within the rows and cols of
412  // the subframe or if the image description header didn't exist
413  return false;
414  }
415 
416  return true;
417 }
418 
420 {
421  theFilename = "";
422 }
423 
425 {
426  if(theHeader)
427  {
428  delete theHeader;
429  theHeader = 0;
430  }
431  if(theAttributes)
432  {
433  delete theAttributes;
434  theAttributes = 0;
435  }
436  if(theCoverage)
437  {
438  delete theCoverage;
439  theCoverage = 0;
440  }
442  {
445  }
446  if(theMaskSubheader)
447  {
448  delete theMaskSubheader;
449  theMaskSubheader = 0;
450  }
452  {
455  }
457  {
458  delete theCompressionSection;
460  }
462  {
465  }
467  {
470  }
471  if (theNitfFile.valid())
472  {
473  theNitfFile = 0;
474  }
475 }
476 
478 {
479  if(theCoverage) delete theCoverage;
480  theCoverage = 0;
481  if(theHeader)
482  {
484  }
486 }
487 
489 {
492  if(theHeader)
493  {
495  }
497 }
498 
500 {
504  if(theHeader)
505  {
507 
509  {
511  if(location)
512  {
514 
516  component))
517  {
518  in.seekg(component.m_componentLocation,ios::beg);
524  }
525  if(location->getComponent(OSSIM_RPF_COLORMAP_SUBSECTION, component))
526  {
527  in.seekg(component.m_componentLocation, ios::beg);
528 
529  theColorGrayscaleTable.clear();
531 
532  // we will ignore the offset table offset which is a 4 byte value
533  // and ignore the offset record length which is a 2 byte value.
534  // This is suppose to put us at the beginning of the
535  // [color/grayscale offset record]. The total number of
536  // these offset records is found in the [color/grayscale section
537  // subheader.
538  in.ignore(6);
539  for(ossim_uint32 index = 0;
541  ++index)
542  {
543 
544  ossimRpfColorGrayscaleOffsetRecord grayscaleOffsetRecord;
545 
546  if(grayscaleOffsetRecord.parseStream(in, theHeader->getByteOrder()) == ossimErrorCodes::OSSIM_OK)
547  {
548  ossim_uint32 rememberLocation = in.tellg();
549  in.seekg(grayscaleOffsetRecord.getColorGrayscaleTableOffset()+component.m_componentLocation, ios::beg);
550  theColorGrayscaleTable[index].setTableData(grayscaleOffsetRecord.getColorGrayscaleTableId(),
551  grayscaleOffsetRecord.getNumberOfColorGrayscaleRecords());
552  theColorGrayscaleTable[index].parseStream(in, theHeader->getByteOrder());
553  in.seekg(rememberLocation, ios::beg);
554  }
555  else
556  {
558  }
559  }
560  }
561  }
562  }
563  }
564 
565  return resultError;
566 }
567 
569 {
573  if(theHeader&&in)
574  {
575  // get the subheader information.
577 
578 
579  // need to do something with the table before going to the display.
581  {
583  // need to get the mask subheader
585 
586  // seek to the start of the subheader
589 
590  // get the information
592  }
593 
595  // Get the display parameter header
597  }
598  return result;
599 }
600 
602 {
603  if(traceDebug())
604  {
606  << "ossimRpfFrame::populateAttributeSection: entered ..." << std::endl;
607  }
609 
611  if(location)
612  {
614 
616  component))
617  {
619  in.seekg(component.m_componentLocation, std::ios::beg);
621  {
622  delete temp;
623  temp =0;
624  if(traceDebug())
625  {
627  << "ossimRpfFrame::populateAttributeSection: leaving 1 ..." << std::endl;
628  }
630  }
631  }
632  }
633  if(!in.fail()&&temp)
634  {
635  if(traceDebug())
636  {
637  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: Has attribute section" << std::endl;
638  }
639  if(theAttributes) delete theAttributes;
642  ossim_uint64 locationAttributeSubsection = in.tellg();
643  ossim_uint64 absoluteAddresToTable = locationAttributeSubsection + temp->getAttributeOffsetTableOffset();
644  ossimEndian anEndian;
645 
646 
647  if(traceDebug())
648  {
650  << "DEBUG: Number of attributes = "
652  << std::endl;
653  }
654  in.seekg(absoluteAddresToTable, ios::beg);
655  for(ossim_uint32 index = 0;
656  index < temp->getNumberOfAttributeOffsetRecords();
657  index++)
658  {
659  if((!in.fail())&&
660  record.parseStream(in, theHeader->getByteOrder()) ==
662  {
663  // make sure we save the current position. The attribute
664  // parser in the switch/case will change the location and
665  // we must come back to the start of the next record.
666  ossim_uint64 currentLocation = in.tellg();
667 
668  // go to the location of the start of the attribute.
669  in.seekg(locationAttributeSubsection + record.getAttributeRecordOffset(), ios::beg);
670 
671  if(traceDebug())
672  {
674  << "DEBUG: Parsing attribute number " << index
675  << " with id = " << record.getAttributeId()
676  << std::endl;
677  }
678  // allocate some temporary space for the string type
679  // attributes.
680  char tempString[50];
682  {
684  switch(record.getAttributeId())
685  {
686  case 1:
687  {
688  in.read((char*)tempString, 8);
689  tempString[8] = '\0';
690  theAttributes->theCurrencyDate = tempString;
691  break;
692  }
693  case 2:
694  {
695  in.read((char*)tempString, 8);
696  tempString[8] = '\0';
697  theAttributes->theProductionDate = tempString;
698  break;
699  }
700  case 3:
701  {
702  in.read((char*)tempString, 8);
703  tempString[8] = '\0';
704  theAttributes->theSignificantDate = tempString;
705  break;
706  }
707  case 4:
708  {
709  in.read((char*)tempString, 10);
711  &tempString[10]);
712  in.read((char*)tempString, 8);
714  &tempString[8]);
715  in.read((char*)tempString, 4);
717  &tempString[4]);
718  in.read((char*)tempString, 7);
719  theAttributes->theEdition = ossimString(tempString,
720  &tempString[7]);
721  break;
722  }
723  case 5:
724  {
725  in.read((char*)tempString, 2);
727  &tempString[2]);
729  if((theAttributes->theProjectionCode == "AC") ||
730  (theAttributes->theProjectionCode == "LE") ||
731  (theAttributes->theProjectionCode == "PG"))
732  {
733  in.read((char*)&(theAttributes->theProjectionA), 4);
734  in.read((char*)&(theAttributes->theProjectionB), 4);
735  in.read((char*)&(theAttributes->theProjectionC), 4);
736  in.read((char*)&(theAttributes->theProjectionD), 4);
737  }
738  else if((theAttributes->theProjectionCode == "RB") ||
739  (theAttributes->theProjectionCode == "OC") ||
740  (theAttributes->theProjectionCode == "TC"))
741  {
742  in.read((char*)&(theAttributes->theProjectionA), 4);
743  in.read((char*)&(theAttributes->theProjectionB), 4);
744  in.read((char*)&(theAttributes->theProjectionC), 4);
745  }
746  else if((theAttributes->theProjectionCode == "AL") ||
747  (theAttributes->theProjectionCode == "MC") ||
748  (theAttributes->theProjectionCode == "OD") ||
749  (theAttributes->theProjectionCode == "PH"))
750  {
751  in.read((char*)&(theAttributes->theProjectionA), 4);
752  in.read((char*)&(theAttributes->theProjectionB), 4);
753  }
754  else if((theAttributes->theProjectionCode == "UT"))
755  {
756  in.read((char*)&(theAttributes->theProjectionA), 4);
757  }
758  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
759  {
760  anEndian.swap(theAttributes->theProjectionA);
761  anEndian.swap(theAttributes->theProjectionB);
762  anEndian.swap(theAttributes->theProjectionC);
763  anEndian.swap(theAttributes->theProjectionD);
764  }
765  break;
766  }
767  case 6:
768  {
769  in.read((char*)tempString, 4);
771  &tempString[4]);
772  break;
773  }
774  case 7:
775  {
776  in.read((char*)tempString, 4);
778  &tempString[4]);
779  break;
780  }
781  case 8:
782  {
783  in.read((char*)&(theAttributes->theVertAbsAccuracy), 4);
784  in.read((char*)&(theAttributes->theVertAbsUnits), 2);
785  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
786  {
789  }
790  break;
791  }
792  case 9:
793  {
794  in.read((char*)&(theAttributes->theHorAbsAccuracy), 4);
795  in.read((char*)&(theAttributes->theHorAbsUnits), 2);
796  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
797  {
799  anEndian.swap(theAttributes->theHorAbsUnits);
800  }
801  break;
802  }
803  case 10:
804  {
805  in.read((char*)&(theAttributes->theVertRelAccuracy), 4);
806  in.read((char*)&(theAttributes->theVertRelUnits), 2);
807  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
808  {
811  }
812  break;
813  }
814  case 11:
815  {
816  in.read((char*)&(theAttributes->theHorRelAccuracy), 4);
817  in.read((char*)&(theAttributes->theHorRelUnits), 2);
818  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
819  {
821  anEndian.swap(theAttributes->theHorRelUnits);
822  }
823  break;
824  }
825  case 12:
826  {
827  in.read((char*)tempString, 3);
829  &tempString[3]);
830  break;
831  }
832  case 13:
833  {
834  in.read((char*)tempString, 4);
836  &tempString[4]);
837  break;
838  }
839  case 14:
840  {
841  in.read((char*)&(theAttributes->theNavSystemCode), 2);
842 
843  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
844  {
846  }
847  break;
848  }
849  case 15:
850  {
851  in.read((char*)tempString, 2);
852  theAttributes->theGridCode = ossimString(tempString,
853  &tempString[2]);
854  break;
855  }
856  case 16:
857  {
858  in.read((char*)&(theAttributes->theEeasterlyMagChange), 4);
859  in.read((char*)&(theAttributes->theEasterlyMagChangeUnits), 2);
860  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
861  {
864  }
865  break;
866  }
867  case 17:
868  {
869  in.read((char*)&(theAttributes->theWesterlyMagChange), 4);
870  in.read((char*)&(theAttributes->theWesterlyMagChangeUnits), 2);
871  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
872  {
875  }
876  break;
877  }
878  case 18:
879  {
880  in.read((char*)&(theAttributes->theMagAngle), 4);
881  in.read((char*)&(theAttributes->theMagAngleUnits), 2);
882  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
883  {
884  anEndian.swap(theAttributes->theMagAngle);
886  }
887  break;
888  }
889  case 19:
890  {
891  in.read((char*)&(theAttributes->theGridConver), 4);
892  in.read((char*)&(theAttributes->theGridConverUnits), 2);
893  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
894  {
895  anEndian.swap(theAttributes->theGridConver);
897  }
898  break;
899  }
900  case 20:
901  {
902  in.read((char*)&(theAttributes->theHighElevation), 8);
903  in.read((char*)&(theAttributes->theHighElevationUnits), 2);
904  in.read((char*)&(theAttributes->theHighLat), 8);
905  in.read((char*)&(theAttributes->theHighLon), 8);
906  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
907  {
910  anEndian.swap(theAttributes->theHighLat);
911  anEndian.swap(theAttributes->theHighLon);
912  }
913  break;
914  }
915  case 21:
916  {
917  in.read((char*)tempString, 12);
919  &tempString[12]);
920  break;
921  }
922  case 22:
923  {
924  in.read((char*)tempString, 12);
925  tempString[12] = '\0';
926  theAttributes->theDataSource = tempString;
927  in.read((char*)&(theAttributes->theGsd), 4);
928  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
929  {
930  anEndian.swap(theAttributes->theGsd);
931  }
932  break;
933  }
934  case 23:
935  {
936  in.read((char*)&(theAttributes->theDataLevel), 2);
937  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
938  {
939  anEndian.swap(theAttributes->theDataLevel);
940  }
941  break;
942  }
943  }
944  }
945  in.seekg(currentLocation, ios::beg);
946  }
947  else
948  {
949  delete temp;
950  temp = 0;
951  if(traceDebug())
952  {
954  << "ossimRpfFrame::populateAttributeSection: leaving 2 ..." << std::endl;
955  }
957  }
958  }
959  }
960  if(temp) delete temp;
961  temp = 0;
962 
963  if(traceDebug())
964  {
966  << "ossimRpfFrame::populateAttributeSection: leaving OK ..." << std::endl;
967  }
969 }
970 
972 {
973  theSubframeMaskTable.clear();
975 
976  if(!in)
977  {
979  }
980 
982  {
984  if(location)
985  {
987 
989  component))
990  {
991 
992  // now allocate the space we need and then reader the table in
993 
996 
997  ossim_uint32 spectralIndex;
998  ossim_uint32 rowIndex;
999  ossim_uint32 colIndex;
1000 
1002  {
1003  // move get to the first byte of the Mask table. This is the offset from the
1004  // start of the maskSubsection.
1005  in.seekg(component.m_componentLocation +
1007  // first loop through the Mask table and allocate while we do it
1008  for(spectralIndex = 0;
1010  ++spectralIndex)
1011  {
1012  // reserve space for the number of rows
1014  for(rowIndex = 0;
1016  ++rowIndex)
1017  {
1018  // allocate the columns
1020  for(colIndex = 0;
1022  ++colIndex)
1023  {
1024  ossim_uint32 value;
1025 
1026  in.read((char*)&value, 4);
1027  ossimEndian anEndian;
1028 
1029  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
1030  {
1031  anEndian.swap(value);
1032  }
1033  theSubframeMaskTable[spectralIndex][rowIndex][colIndex] = value;
1034  }
1035  }
1036  }
1037  }
1039  {
1040  // move get to the first byte of the Mask table. This is the offset from the
1041  // start of the maskSubsection.
1042  in.seekg(component.m_componentLocation +
1044  for(spectralIndex = 0;
1046  ++spectralIndex)
1047  {
1048  // reserve space for the number of rows
1050  for(rowIndex = 0;
1052  ++rowIndex)
1053  {
1054  // allocate the columns
1056  for(colIndex = 0;
1058  ++colIndex)
1059  {
1060  ossim_uint32 value;
1061 
1062  in.read((char*)&value, 4);
1063  ossimEndian anEndian;
1064 
1065  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
1066  {
1067  anEndian.swap(value);
1068  }
1069  theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] = value;
1070  }
1071  }
1072  }
1073  }
1074  }
1075  }
1076  }
1077 
1079 }
1080 
1082 {
1084 
1086 
1087  if( location )
1088  {
1090  {
1092  if( location->getComponent(OSSIM_RPF_REPLACE_UPDATE_SECTION_SUBHEADER, component) )
1093  {
1096 
1097  in.seekg(component.m_componentLocation, ios::beg);
1098 
1100  {
1101  ossim_uint16 count = hdr->getNumberOfRecords();
1102  if ( count )
1103  {
1104  if ( theReplaceUpdateTable.valid() )
1105  {
1107  }
1108  else
1109  {
1111  }
1113  for ( ossim_uint16 i = 0; i < count; ++i )
1114  {
1115  if ( record.parseStream(in) == ossimErrorCodes::OSSIM_OK )
1116  {
1117  theReplaceUpdateTable->addRecord( record );
1118  }
1119  else
1120  {
1121  break;
1122  }
1123  }
1124  }
1125 
1126  }
1127  }
1128  }
1129  }
1130 
1131  if ( in.fail() )
1132  {
1135  }
1136 
1137  return result;
1138 
1139 } // End: ossimRpfFrame::populateReplaceUpdateTable(std::istream& in)
1140 
1142 {
1143  return theReplaceUpdateTable;
1144 }
ossimRpfColorGrayscaleSubheader * theColorGrayscaleSubheader
ossim_uint16 theHorRelUnits
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
ossim_int32 ossimErrorCode
bool hasSubframeMaskTable() const
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
ossimErrorCode populateColorGrayscaleSection(std::istream &in)
void addRecord(const ossimRpfReplaceUpdateRecord &record)
Method to add a record.
ossimString theSignificantDate
ossimErrorCode populateReplaceUpdateTable(std::istream &in)
ossim_uint16 theVertAbsUnits
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
ossimRefPtr< ossimRpfReplaceUpdateTable > theReplaceUpdateTable
Holds table of "replace / update" records if present.
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
unsigned long getNumberOfColorGreyscaleOffsetRecords() const
vector< ossimRpfColorGrayscaleTable > theColorGrayscaleTable
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.
Holds a table of RPF replace/update section subheader records.
ossimString theCurrencyDate
static const ossimErrorCode OSSIM_OK
ossimRpfImageDescriptionSubheader * getNewImageDescriptionSubheader(std::istream &in) const
ossimErrorCode populateAttributeSection(std::istream &in)
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint64 getTagDataOffset() const
ossimString theVertDatumCode
ossimErrorCode populateCompressionSection(std::istream &in)
ossim_uint32 theVertAbsAccuracy
ossimRpfImageDisplayParameterSubheader * getNewImageDisplayParameterSubheader(std::istream &in) const
ossimRpfColorConverterSubsection * theColorConverterSubsection
ossimRpfCoverageSection * theCoverage
static const ossimErrorCode OSSIM_ERROR
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.
ossimString theMapDesignationCode
unsigned short ossim_uint16
bool getComponent(ossimRpfComponentId componentId, ossimRpfComponentLocationRecord &result) const
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
const ossimRpfLocationSection * getLocationSection() const
ossimRefPtr< ossimNitfFile > theNitfFile
ossimRpfHeader * theHeader
ossimString theChartSeriesCode
ossimString theSoundingDatumCode
virtual bool getTag(ossimNitfTagInformation &tagInfo, const ossimString &tagName) const
ossim_uint32 theHorRelAccuracy
bool fillSubFrameBuffer(ossim_uint8 *buffer, ossim_uint32 spectralGroup, ossim_uint32 row, ossim_uint32 col) const
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.
std::string::size_type size() const
Definition: ossimString.h:405
vector< vector< vector< ossim_uint32 > > > theSubframeMaskTable
unsigned long long ossim_uint64
const ossimNitfFileHeader * getHeader() const
unsigned int ossim_uint32
bool getAttributeFlag(ossim_uint32 id) const
bool hasComponent(ossimRpfComponentId componentId) const
ossimRpfImageDisplayParameterSubheader * theImageDisplayParameterSubheader
ossim_uint32 theHorAbsAccuracy
ossim_uint16 theHorAbsUnits
unsigned long getNumberOfColorConverterOffsetRecords() const
std::ostream & operator<<(std::ostream &out, const ossimRpfFrame &data)
ossimErrorCode populateImageSection(std::istream &in)
ossim_uint16 theGridConverUnits
vector< vector< vector< ossim_uint32 > > > theSubframeTransparencyMaskTable
ossim_uint32 theVertRelAccuracy
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
ossimRpfCompressionSection * theCompressionSection
ossimErrorCode populateMasks(std::istream &in)
virtual void parseStream(std::istream &in)
Parse method.
ossimFilename theFilename
ossimErrorCode parseFile(const ossimFilename &filename, bool minimalParse=false)
ossim_uint16 theMagAngleUnits
void setAttributeFlag(ossim_uint32 id, bool flag)
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
ossim_uint16 theHighElevationUnits
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.
ossimString theProjectionCode
ossim_uint16 theEasterlyMagChangeUnits
ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder)
Method to parse the record.
ossimErrorCode parseStream(std::istream &in)
Method to parse the record.
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.
RPF replace/update section subheader record.
ossimString theLegendFileName
virtual ossimByteOrder getByteOrder() const
ossimString theOldHorDatum
ossimString theProductionDate
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimErrorCode populateCoverageSection(std::istream &in)
ossimRpfCoverageSection * getNewCoverageSection(const ossimFilename &file) const
ossim_uint16 theNavSystemCode
ossimRefPtr< ossimRpfReplaceUpdateTable > getRpfReplaceUpdateTable() const
ossimString ext() const
ossimErrorCode parseStream(ossim::istream &in, ossimByteOrder byteOrder)
bool parseFile(const ossimFilename &file)
ossimRpfColorGrayscaleSubheader * getNewColorGrayscaleSubheader(std::istream &in) const
ossimRpfAttributes * theAttributes
ossimRpfMaskSubheader * theMaskSubheader
const unsigned long OSSIM_RPF_ULONG_NULL
void setNumberOfColorConverterOffsetRecords(ossim_uint16 numberOfRecords)
ossim_uint16 theWesterlyMagChangeUnits
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.
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimRpfCompressionSection * getNewCompressionSection(std::istream &in) const
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
RPF replace/update section subheader record.
ossim_uint16 theVertRelUnits
const std::string & string() const
Definition: ossimString.h:414
ossimRpfImageDescriptionSubheader * theImageDescriptionSubheader