OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimRpfToc.h>
Public Member Functions | |
ossimRpfToc () | |
virtual | ~ossimRpfToc () |
ossimErrorCode | parseFile (const ossimFilename &fileName, bool keepFileHeader=false) |
Parses a.toc file. More... | |
void | createTocAndCopyFrames (const ossimFilename &dotRpfFile, const ossimFilename &outputDir) |
Creates a new a.toc file from list of rpf frames in output directory. More... | |
std::ostream & | print (std::ostream &out, const std::string &prefix=std::string(), bool printOverviews=false) const |
print method that outputs a key/value type format adding prefix to keys. More... | |
std::ostream & | printHeader (std::ostream &out, const std::string &prefix=std::string()) const |
print method that outputs a key/value type format adding prefix to keys. More... | |
std::ostream & | printTocEntry (std::ostream &out, ossim_uint32 entryIndex, const std::string &prefix=std::string(), bool printOverviews=false) const |
print method that outputs a key/value type format adding prefix to keys. More... | |
ossim_uint32 | getNumberOfEntries () const |
const ossimRpfTocEntry * | getTocEntry (ossim_uint32 index) const |
ossim_int32 | getTocEntryIndex (const ossimRpfTocEntry *entry) |
Returns -1 if not found. More... | |
const ossimNitfFileHeader * | getNitfFileHeader () const |
Get the nitf file header. More... | |
const ossimRpfHeader * | getRpfHeader () const |
ossim_uint32 | getNumberOfFramesHorizontal (ossim_uint32 idx) const |
For the given entry index, this routine returns the number of frames that exist in the horizontal direction. More... | |
ossim_uint32 | getNumberOfFramesVertical (ossim_uint32 idx) const |
For the given entry index, this routine returns the number of frames that exist in the vertical direction. More... | |
bool | getRpfFrameEntry (ossim_uint32 entryIdx, ossim_uint32 row, ossim_uint32 col, ossimRpfFrameEntry &result) const |
For the given entry index, frame row, and frame column, this routine returns the corresponding ossimRpfFrameEntry instance. More... | |
const ossimString | getRelativeFramePath (ossim_uint32 entryIdx, ossim_uint32 row, ossim_uint32 col) const |
For the given entry index, frame row, and frame column, this routine returns the corresponding name of the frame image with respect to the location of the toc file. More... | |
void | getRootDirectory (ossimFilename &dir) const |
Method to get the root directory from the a.toc file name. More... | |
![]() | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (const ossimReferenced &) |
void | ref () const |
increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
void | unref () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
void | unref_nodelete () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
int | referenceCount () const |
Private Member Functions | |
void | deleteAll () |
void | clearAll () |
void | deleteTocEntryList () |
void | buildTocEntryList (ossimRpfHeader *rpfHeader) |
void | allocateTocEntryList (ossim_uint32 numberOfEntries) |
void | getFirstEntry (const ossimRpfTocEntry *rpfTocEntry, ossimRpfFrameEntry &frameEntry) const |
Walks through frames to find the first entry that exists... More... | |
void | writeFrameFileIndexSection (ossimRpfFrameFileIndexSubsection *frameFileSubSection, std::ifstream &dotRpfStr, std::ofstream &dotTocStr) |
Writes the frame file sub section of an a.toc. More... | |
void | copyFrames (std::ifstream &dotRpfStr, const ossimFilename &outputDir) |
Copies frame to output directory. More... | |
ossim_uint32 | getNumberOfFrames (std::ifstream &dotRpfStr) const |
Get the number of frames from the dot rpf file. More... | |
ossimFilename | getSourceTocFile (std::ifstream &dotRpfStr) const |
Get a.toc file from the dot rpf file. More... | |
bool | getCorespondingEntry (ossimRpfFrameFileIndexSubsection *frameFileSubSection, std::ifstream &dotRpfStr, ossim_uint32 &entry) const |
Gets the zero based entry number for the first file in the dot rpf file. More... | |
bool | getFile (const std::string &line, ossimFilename &file) const |
Gets the filename from line in. More... | |
Private Attributes | |
std::vector< ossimRpfTocEntry * > | m_tocEntryList |
ossimFilename | m_filename |
ossimRefPtr< const ossimNitfFileHeader > | m_nitfFileHeader |
ossimRefPtr< ossimRpfHeader > | m_rpfHeader |
Friends | |
OSSIM_DLL std::ostream & | operator<< (std::ostream &out, const ossimRpfToc &data) |
Additional Inherited Members | |
![]() | |
virtual | ~ossimReferenced () |
Definition at line 30 of file ossimRpfToc.h.
ossimRpfToc::ossimRpfToc | ( | ) |
Definition at line 42 of file ossimRpfToc.cpp.
|
virtual |
Definition at line 50 of file ossimRpfToc.cpp.
References deleteAll().
|
private |
Definition at line 921 of file ossimRpfToc.cpp.
References deleteTocEntryList(), and m_tocEntryList.
|
private |
Definition at line 804 of file ossimRpfToc.cpp.
|
private |
|
private |
Copies frame to output directory.
This is a utility method for createTocAndCopyFrames method.
Definition at line 1056 of file ossimRpfToc.cpp.
void ossimRpfToc::createTocAndCopyFrames | ( | const ossimFilename & | dotRpfFile, |
const ossimFilename & | outputDir | ||
) |
Creates a new a.toc file from list of rpf frames in output directory.
dotRpfFile | File containing list of rpf frames wanted. |
outputDir | Directory to write a.toc file and rpf frames to. |
Definition at line 165 of file ossimRpfToc.cpp.
|
private |
Definition at line 775 of file ossimRpfToc.cpp.
References deleteTocEntryList(), and m_rpfHeader.
Referenced by ~ossimRpfToc().
|
private |
Definition at line 788 of file ossimRpfToc.cpp.
References m_tocEntryList.
Referenced by allocateTocEntryList(), clearAll(), and deleteAll().
|
private |
Gets the zero based entry number for the first file in the dot rpf file.
This is a utility method for createTocAndCopyFrames method.
Definition at line 1244 of file ossimRpfToc.cpp.
References ossimFilename::file(), ossimRpfFrameFileIndexRecord::getBoundaryRecNumber(), getFile(), ossimRpfFrameFileIndexSubsection::getFrameFileIndexRecordFromFile(), and getline().
|
private |
Gets the filename from line in.
Line format:
/data/spadac/rpf-frame-test/t1/N03E030/005FNU1B.I21|30.9141787715578,3.03831480449669|30.9889225265623,3.10741371349693
line | Line to extract filename from. |
out | Filename to initialize. |
This is a utility method for createTocAndCopyFrames method.
Definition at line 1285 of file ossimRpfToc.cpp.
References ossimString::split().
Referenced by getCorespondingEntry(), and getSourceTocFile().
|
private |
Walks through frames to find the first entry that exists...
Definition at line 938 of file ossimRpfToc.cpp.
References ossimRpfFrameEntry::exists(), ossimRpfTocEntry::getEntry(), ossimRpfTocEntry::getNumberOfFramesHorizontal(), and ossimRpfTocEntry::getNumberOfFramesVertical().
const ossimNitfFileHeader * ossimRpfToc::getNitfFileHeader | ( | ) | const |
Get the nitf file header.
Definition at line 717 of file ossimRpfToc.cpp.
References ossimRefPtr< T >::get(), and m_nitfFileHeader.
ossim_uint32 ossimRpfToc::getNumberOfEntries | ( | ) | const |
Definition at line 689 of file ossimRpfToc.cpp.
References m_tocEntryList.
Referenced by ossimCibCadrgTileSource::getProductEntryList(), and ossimCibCadrgTileSource::getProductScaleList().
|
private |
Get the number of frames from the dot rpf file.
This is a utility method for createTocAndCopyFrames method.
Definition at line 1155 of file ossimRpfToc.cpp.
References getline().
ossim_uint32 ossimRpfToc::getNumberOfFramesHorizontal | ( | ossim_uint32 | idx | ) | const |
For the given entry index, this routine returns the number of frames that exist in the horizontal direction.
If the entry index is invalid, 0 frames are returned.
idx | the entry index. |
Definition at line 727 of file ossimRpfToc.cpp.
References ossimRpfTocEntry::getNumberOfFramesHorizontal(), and getTocEntry().
ossim_uint32 ossimRpfToc::getNumberOfFramesVertical | ( | ossim_uint32 | idx | ) | const |
For the given entry index, this routine returns the number of frames that exist in the vertical direction.
If the entry index is invalid, 0 frames are returned.
idx | the entry index. |
Definition at line 738 of file ossimRpfToc.cpp.
References ossimRpfTocEntry::getNumberOfFramesVertical(), and getTocEntry().
const ossimString ossimRpfToc::getRelativeFramePath | ( | ossim_uint32 | entryIdx, |
ossim_uint32 | row, | ||
ossim_uint32 | col | ||
) | const |
For the given entry index, frame row, and frame column, this routine returns the corresponding name of the frame image with respect to the location of the toc file.
entryIdx | the entry index. |
row | the frame row. |
col | the frame col. |
Definition at line 762 of file ossimRpfToc.cpp.
References ossimRpfFrameEntry::getPathToFrameFileFromRoot(), and getRpfFrameEntry().
void ossimRpfToc::getRootDirectory | ( | ossimFilename & | dir | ) | const |
Method to get the root directory from the a.toc file name.
dir | This initializes dir. |
Definition at line 933 of file ossimRpfToc.cpp.
References ossimFilename::expand(), m_filename, and ossimFilename::path().
bool ossimRpfToc::getRpfFrameEntry | ( | ossim_uint32 | entryIdx, |
ossim_uint32 | row, | ||
ossim_uint32 | col, | ||
ossimRpfFrameEntry & | result | ||
) | const |
For the given entry index, frame row, and frame column, this routine returns the corresponding ossimRpfFrameEntry instance.
entryIdx | the entry index. |
row | the frame row. |
col | the frame col. |
Definition at line 749 of file ossimRpfToc.cpp.
References ossimRpfTocEntry::getEntry(), and getTocEntry().
Referenced by getRelativeFramePath().
const ossimRpfHeader * ossimRpfToc::getRpfHeader | ( | ) | const |
Definition at line 722 of file ossimRpfToc.cpp.
References ossimRefPtr< T >::get(), and m_rpfHeader.
Referenced by ossimCibCadrgTileSource::getPropertyNames(), and ossimCibCadrgTileSource::getSecurityClassification().
|
private |
Get a.toc file from the dot rpf file.
This is a utility method for createTocAndCopyFrames method.
Definition at line 1187 of file ossimRpfToc.cpp.
References ossimString::clear(), ossimFilename::dirCat(), ossimFilename::exists(), getFile(), getline(), and ossimFilename::path().
const ossimRpfTocEntry * ossimRpfToc::getTocEntry | ( | ossim_uint32 | index | ) | const |
Definition at line 694 of file ossimRpfToc.cpp.
References m_tocEntryList.
Referenced by ossimCibCadrgTileSource::findFirstFrame(), getNumberOfFramesHorizontal(), getNumberOfFramesVertical(), ossimCibCadrgTileSource::getProductEntryList(), ossimCibCadrgTileSource::getProductScale(), ossimCibCadrgTileSource::getProductScaleList(), getRpfFrameEntry(), printTocEntry(), and ossimCibCadrgTileSource::setEntryToRender().
ossim_int32 ossimRpfToc::getTocEntryIndex | ( | const ossimRpfTocEntry * | entry | ) |
Returns -1 if not found.
Definition at line 703 of file ossimRpfToc.cpp.
References m_tocEntryList.
Referenced by ossimCibCadrgTileSource::setTocEntryToRender().
ossimErrorCode ossimRpfToc::parseFile | ( | const ossimFilename & | fileName, |
bool | keepFileHeader = false |
||
) |
Parses a.toc file.
fileName | File to parse. |
keepFileHeader | If true the ossimNitfFileHeader will be kept. |
Definition at line 55 of file ossimRpfToc.cpp.
Referenced by ossimNitfFile::print().
std::ostream & ossimRpfToc::print | ( | std::ostream & | out, |
const std::string & | prefix = std::string() , |
||
bool | printOverviews = false |
||
) | const |
print method that outputs a key/value type format adding prefix to keys.
out | String to output to. |
prefix | This will be prepended to key. e.g. Where prefix = "nitf.rpf." and key is "file_name" key becomes: "nitf.rpm.file_name:" |
Definition at line 616 of file ossimRpfToc.cpp.
References m_tocEntryList, printHeader(), and printTocEntry().
Referenced by operator<<(), and ossimNitfFile::print().
std::ostream & ossimRpfToc::printHeader | ( | std::ostream & | out, |
const std::string & | prefix = std::string() |
||
) | const |
print method that outputs a key/value type format adding prefix to keys.
This prints the rpf header part only.
out | String to output to. |
prefix | This will be prepended to key. e.g. Where prefix = "nitf.rpf." and key is "file_name" key becomes: "nitf.rpf.file_name:" |
Definition at line 634 of file ossimRpfToc.cpp.
References m_rpfHeader, ossimRpfHeader::print(), and ossimRefPtr< T >::valid().
Referenced by ossimNitfFile::print(), and print().
std::ostream & ossimRpfToc::printTocEntry | ( | std::ostream & | out, |
ossim_uint32 | entryIndex, | ||
const std::string & | prefix = std::string() , |
||
bool | printOverviews = false |
||
) | const |
print method that outputs a key/value type format adding prefix to keys.
This prints the specific rpf toc entry.
out | String to output to. |
prefix | This will be prepended to key. e.g. Where prefix = "nitf.rpf." and key is "file_name" key becomes: "nitf.rpf.file_name:" |
Definition at line 644 of file ossimRpfToc.cpp.
References getTocEntry().
Referenced by ossimNitfFile::print(), and print().
|
private |
Writes the frame file sub section of an a.toc.
This is a utility method for createTocAndCopyFrames method.
Definition at line 968 of file ossimRpfToc.cpp.
|
friend |
Definition at line 37 of file ossimRpfToc.cpp.
|
private |
We will remember the file that we opened
Definition at line 255 of file ossimRpfToc.h.
Referenced by clearAll(), and getRootDirectory().
|
private |
Definition at line 257 of file ossimRpfToc.h.
Referenced by getNitfFileHeader().
|
private |
Definition at line 259 of file ossimRpfToc.h.
Referenced by deleteAll(), getRpfHeader(), and printHeader().
|
private |
This will hold a list of table of content entries. There is one entry per directory. Each entry will have its geographic coverage. Each directory is then divided into frames. There could be 30 or more frame images that make up an entire image.
Definition at line 250 of file ossimRpfToc.h.
Referenced by allocateTocEntryList(), deleteTocEntryList(), getNumberOfEntries(), getTocEntry(), getTocEntryIndex(), and print().