OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
ossimImageHandlerRegistry supports the new state cache. More...
#include <ossimImageHandlerRegistry.h>
Public Member Functions | |
virtual | ~ossimImageHandlerRegistry () |
std::shared_ptr< ossim::ImageHandlerState > | getState (const ossimString &connectionString, ossim_uint32 entry) const |
std::shared_ptr< ossim::ImageHandlerState > | getState (const ossimString &id) const |
ossimRefPtr< ossimImageHandler > | openConnection (const ossimString &connectionString, bool openOverview=true) const |
virtual ossimImageHandler * | open (const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const |
open that takes a filename. More... | |
virtual ossimImageHandler * | open (const ossimKeywordlist &kwl, const char *prefix=0) const |
Given a keyword list return a pointer to an ImageHandler. More... | |
virtual ossimRefPtr< ossimImageHandler > | open (std::shared_ptr< ossim::ImageHandlerState > state) const |
virtual ossimRefPtr< ossimImageHandler > | open (std::shared_ptr< ossim::istream > &str, const std::string &connectionString, bool openOverview) const |
Open method that takes a stream. More... | |
virtual ossimRefPtr< ossimImageHandler > | openOverview (const ossimFilename &file) const |
Open overview that takes a file name. More... | |
virtual ossimObject * | createObject (const ossimString &typeName) const |
virtual ossimObject * | createObject (const ossimKeywordlist &kwl, const char *prefix=0) const |
virtual ossimRefPtr< ossimImageHandler > | openBySuffix (const ossimFilename &file, bool openOverview=true) const |
openBySuffix will call the mthod getImageHandlersBySuffix and go through each handler to try and open the file. More... | |
virtual void | getImageHandlersBySuffix (ossimImageHandlerFactoryBase::ImageHandlerList &result, const ossimString &ext) const |
Will add to the result list any handler that supports the passed in extensions. More... | |
virtual void | getImageHandlersByMimeType (ossimImageHandlerFactoryBase::ImageHandlerList &result, const ossimString &mimeType) const |
Will add to the result list and handler that supports the passed in mime type. More... | |
virtual void | getTypeNameList (std::vector< ossimString > &typeList) const |
virtual void | getSupportedExtensions (ossimImageHandlerFactoryBase::UniqueStringList &extensionList) const |
std::ostream & | printReaderProps (std::ostream &out) const |
Prints list of readers and properties. More... | |
![]() | |
virtual | ~ossimObjectFactory () |
![]() | |
ossimObject () | |
virtual | ~ossimObject () |
virtual ossimObject * | dup () const |
virtual ossimString | getShortName () const |
virtual ossimString | getLongName () const |
virtual ossimString | getDescription () const |
virtual ossimString | getClassName () const |
virtual RTTItypeid | getType () const |
virtual bool | canCastTo (ossimObject *obj) const |
virtual bool | canCastTo (const RTTItypeid &id) const |
virtual bool | canCastTo (const ossimString &parentClassName) const |
virtual bool | saveState (ossimKeywordlist &kwl, const char *prefix=0) const |
virtual bool | loadState (const ossimKeywordlist &kwl, const char *prefix=0) |
virtual std::ostream & | print (std::ostream &out) const |
Generic print method. More... | |
virtual bool | isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const |
virtual void | accept (ossimVisitor &visitor) |
![]() | |
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 |
![]() | |
ossimFactoryListInterface () | |
void | addFactory (ossimImageHandlerFactoryBase *factory) |
This is for backward compatability and calls registerFactory for simple adds. More... | |
bool | isFactoryRegistered (ossimImageHandlerFactoryBase *factory) const |
Public access method to determine if a factory is already registered to this list. More... | |
void | registerFactory (ossimImageHandlerFactoryBase *factory, bool pushToFrontFlag=false) |
Will register a factory to the factory list. More... | |
void | unregisterFactory (ossimImageHandlerFactoryBase *factory) |
Will remove the factory from the registry. More... | |
void | unregisterFactory (const ossimString &factoryTypeName) |
Will remove the factory from the registry by name. More... | |
void | unregisterAllFactories () |
Will remove all factories from the registry. More... | |
void | registerFactoryToFront (ossimImageHandlerFactoryBase *factory) |
Inserts the factory to the front of the list. More... | |
void | registerFactoryBefore (ossimImageHandlerFactoryBase *factory, ossimImageHandlerFactoryBase *beforeThisFactory) |
Will insert the factory before the beforeThisFactory. More... | |
void | getAllTypeNamesFromRegistry (std::vector< ossimString > &typeList) const |
Will add all object types the factories can allocate. More... | |
ossimObject * | createObjectFromRegistry (const ossimString &typeName) const |
This is the base object return for all objects in the system. More... | |
ossimObject * | createObjectFromRegistry (const ossimKeywordlist &kwl, const char *prefix=0) const |
This is the base object return for all objects in the system. More... | |
ossimImageHandler * | createNativeObjectFromRegistry (const ossimString &typeName) const |
This is a helper method that calls the createObject and makes sure that the returned object is of the NativeType base type this registry supports. More... | |
ossimImageHandler * | createNativeObjectFromRegistry (const ossimKeywordlist &kwl, const char *prefix=0) const |
This is a helper method that calls the createObject and makes sure that the returned object is of the NativeType base type this registry supports. More... | |
Static Public Member Functions | |
static ossimImageHandlerRegistry * | instance () |
Protected Member Functions | |
ossimImageHandlerRegistry () | |
ossimImageHandlerRegistry (const ossimImageHandlerRegistry &rhs) | |
const ossimImageHandlerRegistry & | operator= (const ossimImageHandlerRegistry &rhs) |
void | initializeStateCache () const |
void | addToStateCache (ossimImageHandler *handler) const |
![]() | |
virtual | ~ossimReferenced () |
![]() | |
bool | findFactory (ossimImageHandlerFactoryBase *factory) const |
Utility to find a factory in the list. More... | |
Protected Attributes | |
std::shared_ptr< ossim::ItemCache< ossim::ImageHandlerState > > | m_stateCache |
![]() | |
std::mutex | m_factoryListMutex |
FactoryListType | m_factoryList |
Additional Inherited Members | |
![]() | |
typedef std::vector< ossimImageHandlerFactoryBase *> | FactoryListType |
typedef ossimImageHandlerFactoryBase | FactoryType |
typedef ossimImageHandler | NativeReturnType |
ossimImageHandlerRegistry supports the new state cache.
During initialization the properties are read from the global preferences. The keywords are:
ossim.imaging.handler.registry.state_cache.enabled: true or false ossim.imaging.handler.registry.state_cache.min_size: min number of items ossim.imaging.handler.registry.state_cache.max_size: max number of items
On open if the state cache is enabled it will determine if a state exists when a file is passed in to be open and if a state exists it will try to open the handler based on the state.
Definition at line 41 of file ossimImageHandlerRegistry.h.
|
virtual |
Definition at line 48 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::unregisterAllFactories().
|
protected |
Definition at line 34 of file ossimImageHandlerRegistry.cpp.
References initializeStateCache(), ossimObjectFactoryRegistry::instance(), ossimImageHandlerFactory::instance(), ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::registerFactory(), and ossimFactoryListInterface< T, NativeType >::registerFactory().
|
protected |
Definition at line 542 of file ossimImageHandlerRegistry.cpp.
|
protected |
Definition at line 583 of file ossimImageHandlerRegistry.cpp.
References ossimImageHandler::getFilename(), ossimImageHandler::getState(), m_stateCache, and ossimString::toString().
Referenced by open().
|
virtual |
Creates an object given a type name.
Implements ossimObjectFactory.
Definition at line 471 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::createObjectFromRegistry().
|
virtual |
Creates and object given a keyword list.
Implements ossimObjectFactory.
Definition at line 54 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::createObjectFromRegistry(), and open().
|
virtual |
Will add to the result list and handler that supports the passed in mime type.
Definition at line 108 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::m_factoryList.
|
virtual |
Will add to the result list any handler that supports the passed in extensions.
Definition at line 86 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::m_factoryList.
Referenced by openBySuffix().
std::shared_ptr< ossim::ImageHandlerState > ossimImageHandlerRegistry::getState | ( | const ossimString & | connectionString, |
ossim_uint32 | entry | ||
) | const |
Definition at line 151 of file ossimImageHandlerRegistry.cpp.
References ossimString::toString().
std::shared_ptr< ossim::ImageHandlerState > ossimImageHandlerRegistry::getState | ( | const ossimString & | id | ) | const |
Definition at line 157 of file ossimImageHandlerRegistry.cpp.
References m_stateCache.
|
virtual |
Definition at line 135 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::m_factoryList.
Referenced by ossimInfo::printExtensions().
|
virtual |
This should return the type name of all objects in all factories. This is the name used to construct the objects dynamially and this name must be unique.
Implements ossimObjectFactory.
Definition at line 130 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::getAllTypeNamesFromRegistry().
|
protected |
Definition at line 546 of file ossimImageHandlerRegistry.cpp.
References ossimString::empty(), ossimPreferences::findPreference(), ossimPreferences::instance(), m_stateCache, ossimString::toBool(), and ossimString::toUInt32().
Referenced by ossimImageHandlerRegistry().
|
static |
Definition at line 41 of file ossimImageHandlerRegistry.cpp.
Referenced by ossimSingleImageChain::addImageHandler(), ossimPointObservation::addMeasurement(), ATP::AtpGenerator::constructChain(), demo1(), demo2(), demo3(), ossimShorelineTool::doThreshold(), ossimVerticesFinderTool::execute(), ossimImageCacheTileSource::fillTile(), ossimSubImageTool::initialize(), ossimInit::initializeDefaultFactories(), ossimEquationUtil::initInputSources(), ossimHdf5Tool::loadImageFiles(), main(), ossimBandSeparateHandler::open(), ossimGdalDataset::open(), ossimGeoidImage::open(), ossimImageElevationHandler::open(), ossimImageGeometry::open(), ossimInfo::openImageFromState(), ossimInfo::openImageHandler(), ossimImageHandlerFactory::openSrcRecord(), ossimImageHandlerRegistryGetInstance(), ossimplugins::ossimSharedLibraryFinalize(), ossimSharedLibraryFinalize(), ossimplugins::ossimSharedLibraryInitialize(), ossimSharedLibraryInitialize(), ossimTilingPoly::parseShpFile(), ossimInfo::printExtensions(), ossimInfo::printReaderProps(), ossimRpcSolver::solve(), ossimGpkgReader::uncompressPngTile(), ossimImageFileWriter::writeHistogramFile(), and ossimImageFileWriter::writeOverviewFile().
|
virtual |
open that takes a filename.
fileName | File to open. |
trySuffixFirst | If true calls code to try to open by suffix first, then goes through the list of available handlers. default=true. |
openOverview | If true image handler will attempt to open overview. default = true |
Definition at line 231 of file ossimImageHandlerRegistry.cpp.
Referenced by ossimSingleImageChain::addImageHandler(), ossimPointObservation::addMeasurement(), ATP::AtpGenerator::constructChain(), createObject(), demo1(), demo2(), demo3(), ossimShorelineTool::doThreshold(), ossimVerticesFinderTool::execute(), ossimImageCacheTileSource::fillTile(), ossimSubImageTool::initialize(), ossimEquationUtil::initInputSources(), ossimHdf5Tool::loadImageFiles(), main(), ossimBandSeparateHandler::open(), ossimGdalDataset::open(), ossimGeoidImage::open(), ossimImageElevationHandler::open(), ossimImageGeometry::open(), openBySuffix(), ossimInfo::openImageFromState(), ossimInfo::openImageHandler(), ossimTilingPoly::parseShpFile(), ossimRpcSolver::solve(), ossimGpkgReader::uncompressPngTile(), and ossimImageFileWriter::writeOverviewFile().
|
virtual |
Given a keyword list return a pointer to an ImageHandler.
Returns null if a valid handler cannot be found.
Definition at line 289 of file ossimImageHandlerRegistry.cpp.
References addToStateCache(), ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::m_factoryList, and ossimImageHandler::open().
|
virtual |
Definition at line 360 of file ossimImageHandlerRegistry.cpp.
References ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::m_factoryList.
|
virtual |
Open method that takes a stream.
str | Open stream to image. |
connectionString | |
openOverview | If true attempt to open overview file. |
Definition at line 310 of file ossimImageHandlerRegistry.cpp.
|
virtual |
openBySuffix will call the mthod getImageHandlersBySuffix and go through each handler to try and open the file.
This should be a faster open for we do not have to do a magic number compare on all prior files and keep opening and closing files.
openOverview | If true image handler will attempt to open overview. default = true |
Definition at line 65 of file ossimImageHandlerRegistry.cpp.
References ossimFilename::ext(), getImageHandlersBySuffix(), open(), openOverview(), and size.
ossimRefPtr< ossimImageHandler > ossimImageHandlerRegistry::openConnection | ( | const ossimString & | connectionString, |
bool | openOverview = true |
||
) | const |
Definition at line 170 of file ossimImageHandlerRegistry.cpp.
Referenced by ossimSingleImageChain::addImageHandler().
|
virtual |
Open overview that takes a file name.
This will only check readers that can be overview handlers.
file | File to open. |
Definition at line 404 of file ossimImageHandlerRegistry.cpp.
Referenced by openBySuffix().
|
protected |
Definition at line 603 of file ossimImageHandlerRegistry.cpp.
std::ostream & ossimImageHandlerRegistry::printReaderProps | ( | std::ostream & | out | ) | const |
Prints list of readers and properties.
out | Stream to print to. |
Definition at line 476 of file ossimImageHandlerRegistry.cpp.
References ossimRefPtr< T >::get(), ossimObject::getClassName(), ossimStringProperty::getConstraints(), ossimImageHandler::getProperty(), ossimImageHandler::getPropertyNames(), ossimFactoryListInterface< ossimImageHandlerFactoryBase, ossimImageHandler >::m_factoryList, and ossimRefPtr< T >::valid().
Referenced by ossimInfo::printReaderProps().
|
mutableprotected |
Definition at line 187 of file ossimImageHandlerRegistry.h.
Referenced by addToStateCache(), getState(), and initializeStateCache().