OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
ossimImageHandlerFactory Class Reference

#include <ossimImageHandlerFactory.h>

Inheritance diagram for ossimImageHandlerFactory:
ossimImageHandlerFactoryBase ossimObjectFactory ossimObject ossimReferenced

Public Member Functions

virtual ~ossimImageHandlerFactory ()
 
virtual ossimImageHandleropen (const ossimFilename &fileName, bool openOverview=true) const
 
virtual ossimImageHandleropen (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual ossimRefPtr< ossimImageHandleropen (std::shared_ptr< ossim::ImageHandlerState > state) const
 
virtual ossimRefPtr< ossimImageHandleropen (std::shared_ptr< ossim::istream > &str, const std::string &connectionString, bool openOverview) const
 Open method that takes a stream. More...
 
virtual ossimRefPtr< ossimImageHandleropenOverview (const ossimFilename &file) const
 Open overview that takes a file name. More...
 
virtual ossimObjectcreateObject (const ossimString &typeName) const
 
virtual ossimObjectcreateObject (const ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 
virtual void getSupportedExtensions (ossimImageHandlerFactoryBase::UniqueStringList &extensionList) const
 
virtual void getImageHandlersBySuffix (ossimImageHandlerFactoryBase::ImageHandlerList &result, const ossimString &ext) const
 
virtual void getImageHandlersByMimeType (ossimImageHandlerFactoryBase::ImageHandlerList &result, const ossimString &mimeType) const
 
- Public Member Functions inherited from ossimImageHandlerFactoryBase
virtual ossimRefPtr< ossimImageHandleropenOverview (std::shared_ptr< ossim::istream > &str, const ossimString &connectionString) const
 Open method that takes a stream. More...
 
- Public Member Functions inherited from ossimObjectFactory
virtual ~ossimObjectFactory ()
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () 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)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (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
 

Static Public Member Functions

static ossimImageHandlerFactoryinstance ()
 

Protected Member Functions

ossimRefPtr< ossimImageHandleropenSrcRecord (std::shared_ptr< ossim::istream > &str, const std::string &connectionString, bool openOverview) const
 Open dot.src (ossimSrcRecord). More...
 
 ossimImageHandlerFactory ()
 Open method that looks at extension e.g. More...
 
 ossimImageHandlerFactory (const ossimImageHandlerFactory &)
 
void operator= (const ossimImageHandlerFactory &)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Static Protected Attributes

static ossimImageHandlerFactorytheInstance = 0
 

Additional Inherited Members

- Public Types inherited from ossimImageHandlerFactoryBase
typedef UniqueList< ossimStringUniqueStringList
 
typedef std::vector< ossimRefPtr< ossimImageHandler > > ImageHandlerList
 

Detailed Description

Definition at line 26 of file ossimImageHandlerFactory.h.

Constructor & Destructor Documentation

◆ ~ossimImageHandlerFactory()

ossimImageHandlerFactory::~ossimImageHandlerFactory ( )
virtual

Definition at line 56 of file ossimImageHandlerFactory.cpp.

References theInstance.

◆ ossimImageHandlerFactory() [1/2]

ossimImageHandlerFactory::ossimImageHandlerFactory ( )
inlineprotected

Open method that looks at extension e.g.

"tif", "jpg" to select class to open.

This is to be called by standard open before just going down the list of classes the brute force hard way.

Parameters
fileNameThe filename to open.
Returns
Pointer to image handler or null if nothing opened.

Definition at line 122 of file ossimImageHandlerFactory.h.

Referenced by instance().

122 {}

◆ ossimImageHandlerFactory() [2/2]

ossimImageHandlerFactory::ossimImageHandlerFactory ( const ossimImageHandlerFactory )
inlineprotected

Definition at line 123 of file ossimImageHandlerFactory.h.

123 {}

Member Function Documentation

◆ createObject() [1/2]

ossimObject * ossimImageHandlerFactory::createObject ( const ossimString typeName) const
virtual

Creates an object given a type name.

Implements ossimObjectFactory.

Definition at line 639 of file ossimImageHandlerFactory.cpp.

References STATIC_TYPE_NAME.

Referenced by open().

640 {
641  if(STATIC_TYPE_NAME(ossimAdrgTileSource) == typeName)
642  {
643  return new ossimAdrgTileSource();
644  }
645  if(STATIC_TYPE_NAME(ossimCcfTileSource) == typeName)
646  {
647  return new ossimCcfTileSource();
648  }
650  {
651  return new ossimCibCadrgTileSource();
652  }
654  {
655  return new ossimRpfCacheTileSource();
656  }
658  {
659  return new ossimImageCacheTileSource();
660  }
661  if(STATIC_TYPE_NAME(ossimDoqqTileSource) == typeName)
662  {
663  return new ossimDoqqTileSource();
664  }
665  if(STATIC_TYPE_NAME(ossimDtedTileSource) == typeName)
666  {
667  return new ossimDtedTileSource();
668  }
669  if(STATIC_TYPE_NAME(ossimEnviTileSource) == typeName)
670  {
671  return new ossimEnviTileSource();
672  }
673  if(STATIC_TYPE_NAME(ossimJpegTileSource) == typeName)
674  {
675  return new ossimJpegTileSource();
676  }
677  if(STATIC_TYPE_NAME(ossimNitfTileSource) == typeName)
678  {
679  return new ossimNitfTileSource();
680  }
681  if(STATIC_TYPE_NAME(ossimTiffTileSource) == typeName)
682  {
683  return new ossimTiffTileSource();
684  }
686  {
687  return new ossimUsgsDemTileSource();
688  }
690  {
691  return new ossimLandsatTileSource();
692  }
693  if(STATIC_TYPE_NAME(ossimERSTileSource) == typeName)
694  {
695  return new ossimERSTileSource();
696  }
697  if(STATIC_TYPE_NAME(ossimSrtmTileSource) == typeName)
698  {
699  return new ossimSrtmTileSource();
700  }
702  {
703  return new ossimGeneralRasterTileSource();
704  }
706  {
707  return new ossimQuickbirdNitfTileSource();
708  }
710  {
711  return new ossimQbTileFilesHandler();
712  }
714  {
715  return new ossimBitMaskTileSource();
716  }
718  {
719  return new ossimBandSeparateHandler();
720  }
722  {
723  return new ossimRangeDomeTileSource();
724  }
725 #if OSSIM_HAS_HDF5
726  if(STATIC_TYPE_NAME(ossimViirsHandler) == typeName)
727  {
728  return new ossimViirsHandler();
729  }
730 #endif
731 
732  #ifdef ENABLE_POINT_CLOUD_HANDLER
734  {
735  return new ossimPointCloudImageHandler();
736  }
737 #endif
739  {
740  return new ossimImageHandlerMtAdaptor();
741  }
742 
743  return (ossimObject*)0;
744 }
Intended mainly to provide a mechanism for mutex-locking access to a shared resource during a getTile...
Class used for rendering point cloud data into a raster tile.
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325
This class defines an abstract Handler which all image handlers(loaders) should derive from...
This is the image handler for providing mask pixels to an ossimMaskFilter object. ...
CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a c...
Image handler used for tiled Quickbird imagery.
Class used for rendering range domes (a.k.a.
Concrete class for reading VIIRS data from HDF5 file.

◆ createObject() [2/2]

ossimObject * ossimImageHandlerFactory::createObject ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Creates and object given a keyword list.

Implements ossimObjectFactory.

Definition at line 948 of file ossimImageHandlerFactory.cpp.

950 {
951  if(traceDebug())
952  {
954  << "ossimImageHandlerFactory::createObject(kwl, prefix) DEBUG:"
955  << " entering ..." << std::endl;
956  }
957  ossimObject* result = (ossimObject*)0;
958  const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
959 
960  if(type)
961  {
962  if (ossimString(type).trim() == STATIC_TYPE_NAME(ossimImageHandler))
963  {
964  const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
965 
966  if (lookup)
967  {
968  if(traceDebug())
969  {
970  ossimNotify(ossimNotifyLevel_DEBUG) << "BEBUG: filename " << lookup << std::endl;
971  }
972  // Call the open that takes a filename...
973  result = this->open(kwl, prefix);//ossimFilename(lookup));
974  }
975  }
976  else
977  {
978  result = createObject(ossimString(type));
979  if(result)
980  {
981  result->loadState(kwl, prefix);
982  }
983  }
984  }
985 
986  if(traceDebug())
987  {
988  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageHandlerFactory::createObject(kwl, prefix) DEBUG: returning result ..." << std::endl;
989  }
990  return result;
991 }
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const char * TYPE_KW
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325
virtual ossimImageHandler * open(const ossimFilename &fileName, bool openOverview=true) const
virtual ossimObject * createObject(const ossimString &typeName) const
This class defines an abstract Handler which all image handlers(loaders) should derive from...
static const char * FILENAME_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getImageHandlersByMimeType()

void ossimImageHandlerFactory::getImageHandlersByMimeType ( ossimImageHandlerFactoryBase::ImageHandlerList result,
const ossimString mimeType 
) const
virtual

Reimplemented from ossimImageHandlerFactoryBase.

Definition at line 934 of file ossimImageHandlerFactory.cpp.

References ossimString::begin(), ossimString::end(), and getImageHandlersBySuffix().

935 {
936  ossimString test(mimeType.begin(), mimeType.begin()+6);
937  if(test == "image/")
938  {
939  ossimString mimeTypeTest(mimeType.begin() + 6, mimeType.end());
940  getImageHandlersBySuffix(result, mimeTypeTest);
941  if(mimeTypeTest == "dted")
942  {
943  result.push_back(new ossimDtedTileSource);
944  }
945  }
946 }
std::string::iterator end()
Definition: ossimString.h:423
std::string::iterator begin()
Definition: ossimString.h:420
virtual void getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList &result, const ossimString &ext) const

◆ getImageHandlersBySuffix()

void ossimImageHandlerFactory::getImageHandlersBySuffix ( ossimImageHandlerFactoryBase::ImageHandlerList result,
const ossimString ext 
) const
virtual

Reimplemented from ossimImageHandlerFactoryBase.

Definition at line 778 of file ossimImageHandlerFactory.cpp.

Referenced by getImageHandlersByMimeType().

779 {
780  static const char* M = "ossimImageHandlerFactory::getImageHandlersBySuffix() -- ";
781  // OVR can be combined with "tif" once we get rid of ossimQuickbirdTiffTileSource
782  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying OVR...\n";
783  ossimString testExt = ext.downcase();
784  if (testExt == "ovr")
785  {
786  result.push_back(new ossimTiffTileSource);
787  return;
788  }
789 
790  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TIF or TIFF...\n";
791  if ( (testExt == "tif") || (testExt == "tiff") )
792  {
793  // this must be checked first before the TIFF handler
794  result.push_back(new ossimQuickbirdTiffTileSource);
795  result.push_back(new ossimTiffTileSource);
796  return;
797  }
798 
799  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing NTF or NITF...\n";
800  if ( (testExt == "ntf") || (testExt == "nitf") )
801  {
802  // this must be checked first before the NITF raw handler
803  result.push_back(new ossimQuickbirdNitfTileSource);
804  result.push_back(new ossimNitfTileSource);
805  return;
806  }
807 
808  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing RPF...\n";
809  if ( (testExt == "rpf"))
810  {
811  result.push_back(new ossimRpfCacheTileSource);
812  result.push_back(new ossimImageCacheTileSource);
813  return;
814  }
815 
816  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TOC...\n";
817  if ( testExt == "toc")
818  {
819  result.push_back(new ossimCibCadrgTileSource);
820  return;
821  }
822 
823  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing JPG or JPEG...\n";
824  if ( (testExt == "jpg") || (testExt == "jpeg") )
825  {
826  result.push_back(new ossimJpegTileSource);
827  return;
828  }
829 
830  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DOQ or DOQQ...\n";
831  if ( (testExt == "doq") || (testExt == "doqq") )
832  {
833  result.push_back(new ossimDoqqTileSource);
834  return;
835  }
836 
837  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DTn...\n";
838  ossimString regExpStr = "dt[0-9]";
839  ossimRegExp regExp(regExpStr);
840  if(regExp.find(testExt))
841  {
842  result.push_back(new ossimDtedTileSource);
843  return;
844  }
845 
846  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing HGT...\n";
847  if (testExt == "hgt")
848  {
849  result.push_back(new ossimSrtmTileSource);
850  return;
851  }
852 
853  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing HRI,HSI...\n";
854  if ( (testExt == "hri") || (testExt == "hsi") )
855  {
856  result.push_back(new ossimEnviTileSource);
857  return;
858  }
859 
860  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DEM...\n";
861  if (testExt == "dem")
862  {
863  result.push_back(new ossimUsgsDemTileSource);
864  return;
865  }
866 
867  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing FST...\n";
868  if (testExt == "fst")
869  {
870  result.push_back(new ossimLandsatTileSource);
871  return;
872  }
873 
874  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing RAS or RAW or General Raster...\n";
875  if ( (testExt == "ras") || (testExt == "raw") || (testExt == "bil"))
876  {
877  result.push_back(new ossimGeneralRasterTileSource);
878  return;
879  }
880 
881  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing IMG...\n";
882  if (testExt == "img")
883  {
884  result.push_back(new ossimAdrgTileSource);
885  return;
886  }
887 
888  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing CCF...\n";
889  if (testExt == "ccf")
890  {
891  result.push_back(new ossimCcfTileSource);
892  return;
893  }
894 
895  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TIL...\n";
896  if (testExt == "til")
897  {
898  result.push_back(new ossimQbTileFilesHandler);
899  return;
900  }
901 
902  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing MASK...\n";
903  if (testExt == "mask")
904  {
905  result.push_back(new ossimBitMaskTileSource);
906  return;
907  }
908 
909  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TXT...\n";
910  if (testExt == "txt")
911  {
912  result.push_back(new ossimBandSeparateHandler);
913  return;
914  }
915 
916  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing CSV...\n";
917  if (testExt == "csv")
918  {
919  result.push_back(new ossimRangeDomeTileSource);
920  return;
921  }
922 
923 #if OSSIM_HAS_HDF5
924  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing VIIRS...\n";
925  if (testExt == "h5")
926  {
927  result.push_back(new ossimViirsHandler);
928  return;
929  }
930 #endif
931 
932 }
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
This class defines an abstract Handler which all image handlers(loaders) should derive from...
This is the image handler for providing mask pixels to an ossimMaskFilter object. ...
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a c...
Image handler used for tiled Quickbird imagery.
Class used for rendering range domes (a.k.a.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
Concrete class for reading VIIRS data from HDF5 file.

◆ getSupportedExtensions()

void ossimImageHandlerFactory::getSupportedExtensions ( ossimImageHandlerFactoryBase::UniqueStringList extensionList) const
virtual

Implements ossimImageHandlerFactoryBase.

Definition at line 746 of file ossimImageHandlerFactory.cpp.

References ossimImageHandlerFactoryBase::UniqueList< T >::push_back().

747 {
748  extensionList.push_back("img");
749  extensionList.push_back("ccf");
750  extensionList.push_back("toc");
751  extensionList.push_back("tif");
752  extensionList.push_back("tiff");
753  extensionList.push_back("doq");
754  extensionList.push_back("doqq");
755  extensionList.push_back("dt0");
756  extensionList.push_back("dt1");
757  extensionList.push_back("dt2");
758  extensionList.push_back("dt3");
759  extensionList.push_back("jpg");
760  extensionList.push_back("jpeg");
761  extensionList.push_back("dem");
762  extensionList.push_back("fst");
763  extensionList.push_back("hdr");
764  extensionList.push_back("ras");
765  extensionList.push_back("hgt");
766  extensionList.push_back("nsf");
767  extensionList.push_back("nitf");
768  extensionList.push_back("ntf");
769  extensionList.push_back("til");
770  extensionList.push_back("mask");
771  extensionList.push_back("txt");
772  extensionList.push_back("csv");
773 #if OSSIM_HAS_HDF5
774  extensionList.push_back("h5");
775 #endif
776 }

◆ getTypeNameList()

void ossimImageHandlerFactory::getTypeNameList ( std::vector< ossimString > &  typeList) const
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 993 of file ossimImageHandlerFactory.cpp.

References STATIC_TYPE_NAME.

994 {
995  typeList.push_back(STATIC_TYPE_NAME(ossimAdrgTileSource));
996  typeList.push_back(STATIC_TYPE_NAME(ossimCcfTileSource));
997  typeList.push_back(STATIC_TYPE_NAME(ossimCibCadrgTileSource));
998  typeList.push_back(STATIC_TYPE_NAME(ossimEnviTileSource));
999  typeList.push_back(STATIC_TYPE_NAME(ossimRpfCacheTileSource));
1000  typeList.push_back(STATIC_TYPE_NAME(ossimImageCacheTileSource));
1001  typeList.push_back(STATIC_TYPE_NAME(ossimDoqqTileSource));
1002  typeList.push_back(STATIC_TYPE_NAME(ossimDtedTileSource));
1003  typeList.push_back(STATIC_TYPE_NAME(ossimJpegTileSource));
1004  typeList.push_back(STATIC_TYPE_NAME(ossimNitfTileSource));
1005  typeList.push_back(STATIC_TYPE_NAME(ossimTiffTileSource));
1006  typeList.push_back(STATIC_TYPE_NAME(ossimUsgsDemTileSource));
1007  typeList.push_back(STATIC_TYPE_NAME(ossimLandsatTileSource));
1008  typeList.push_back(STATIC_TYPE_NAME(ossimERSTileSource));
1009  typeList.push_back(STATIC_TYPE_NAME(ossimSrtmTileSource));
1010  typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterTileSource));
1011  typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdNitfTileSource));
1012  typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdTiffTileSource));
1013  typeList.push_back(STATIC_TYPE_NAME(ossimQbTileFilesHandler));
1014  typeList.push_back(STATIC_TYPE_NAME(ossimBitMaskTileSource));
1015  typeList.push_back(STATIC_TYPE_NAME(ossimRangeDomeTileSource));
1016 
1017 #if OSSIM_HAS_HDF5
1018  typeList.push_back(STATIC_TYPE_NAME(ossimViirsHandler));
1019 #endif
1020 
1021 #ifdef ENABLE_POINT_CLOUD_HANDLER
1022  typeList.push_back(STATIC_TYPE_NAME(ossimPointCloudImageHandler));
1023 #endif
1024 
1025  typeList.push_back(STATIC_TYPE_NAME(ossimImageHandlerMtAdaptor));
1026 }
Intended mainly to provide a mechanism for mutex-locking access to a shared resource during a getTile...
Class used for rendering point cloud data into a raster tile.
#define STATIC_TYPE_NAME(T)
Definition: ossimRtti.h:325
This is the image handler for providing mask pixels to an ossimMaskFilter object. ...
CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a c...
Image handler used for tiled Quickbird imagery.
Class used for rendering range domes (a.k.a.
Concrete class for reading VIIRS data from HDF5 file.

◆ instance()

ossimImageHandlerFactory * ossimImageHandlerFactory::instance ( )
static

Definition at line 61 of file ossimImageHandlerFactory.cpp.

References ossimImageHandlerFactory(), and theInstance.

Referenced by ossimImageHandlerRegistry::ossimImageHandlerRegistry().

62 {
63  if(!theInstance)
64  {
66 
67  // let's turn off tiff error reporting
68  TIFFSetErrorHandler(0);
69  TIFFSetWarningHandler(0);
70  }
71 
72  return theInstance;
73 }
ossimImageHandlerFactory()
Open method that looks at extension e.g.
static ossimImageHandlerFactory * theInstance

◆ open() [1/4]

ossimImageHandler * ossimImageHandlerFactory::open ( const ossimFilename fileName,
bool  openOverview = true 
) const
virtual
Parameters
openOverviewIf true image handler will attempt to open overview. default = true

Implements ossimImageHandlerFactoryBase.

Definition at line 125 of file ossimImageHandlerFactory.cpp.

127 {
128  static const char* M = "ossimImageHandlerFactory::open(filename) -- ";
129  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" Entering..." << std::endl;
130 
131  ossimFilename copyFilename = fileName;
132  if (traceDebug())
133  {
135  << "Attempting to open file: " << fileName.c_str()
136  << "\nopen overview flag: " << (openOverview?"true":"false") << "\n";
137  }
138 
140  while (true)
141  {
142  // Check for empty file.
143  copyFilename.trim();
144  if (copyFilename.empty()) break;
145 
146  // for all of our imagehandlers the filename must exist.
147  // if we have any imagehandlers that require an encoded string and is contrlled in this factory then
148  // we need to move this.
149  if (!copyFilename.exists()) break;
150 
151  ossimString ext = copyFilename.ext().downcase();
152  if(ext == "gz")
153  copyFilename = copyFilename.setExtension("");
154 
155  // Try opening from extension logic first (this is faster than instantiating each type).
156 // if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying via extension...";
157 // result = openFromExtension(copyFilename);
158 // if (result.valid()) break;
159 
160  //---
161  // If here do it the brute force way by going down the list of available
162  // readers...
163  //---
164 
165  //---
166  // NITF at top of list.
167  //
168  // This must be checked first before the NITF raw handler.
169  //---
170  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Quickbird Nitf...\n";
171  result = new ossimQuickbirdNitfTileSource;
173  if (result->open(copyFilename)) break;
174 
175  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying NITF...\n";
176  result = new ossimNitfTileSource;
178  if (result->open(copyFilename)) break;
179 
180  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying RPF Cache Image...\n";
181  result = new ossimRpfCacheTileSource;
183  if (result->open(copyFilename)) break;
184 
185  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying RPF Image Cache Image...\n";
186  result = new ossimImageCacheTileSource;
188  if (result->open(copyFilename)) break;
189 
190  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying JPEG...\n";
191  result = new ossimJpegTileSource;
193  if (result->open(copyFilename)) break;
194 
195  // this must be checked first before the TIFF handler
196  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Quickbird TIFF...\n";
197  result = new ossimQuickbirdTiffTileSource;
199  if (result->open(copyFilename)) break;
200 
201  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying TIFF...\n";
202  result = new ossimTiffTileSource;
204  if (result->open(copyFilename)) break;
205 
206  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying CIB/CADRG...\n";
207  result = new ossimCibCadrgTileSource;
209  if (result->open(copyFilename)) break;
210 
211  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying DOQQ...\n";
212  result = new ossimDoqqTileSource;
214  if (result->open(copyFilename)) break;
215 
216  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying DTED...\n";
217  result = new ossimDtedTileSource;
219  if (result->open(copyFilename)) break;
220 
221  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying USGS Dem...\n";
222  result = new ossimUsgsDemTileSource;
224  if (result->open(copyFilename)) break;
225 
226  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Landsat...\n";
227  result = new ossimLandsatTileSource;
229  if (result->open(copyFilename)) break;
230 
231  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying VPF...\n";
232  result = new ossimVpfTileSource;
234  if (result->open(copyFilename)) break;
235 
236  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ERS...\n";
237  result = new ossimERSTileSource;
239  if (result->open(copyFilename)) break;
240 
241  //---
242  // The srtm and general raser readers were picking up j2k overviews because the
243  // matching base file has an "omd" file that the raster reader can load
244  // so added extension check. (drb - 20100709)
245  //---
246  if (copyFilename.ext() != "ovr")
247  {
248  // Note: ENVI should be in front of general raster..
249  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ENVI...\n";
250  result = new ossimEnviTileSource;
252  if (result->open(copyFilename)) break;
253 
254  // Note: SRTM should be in front of general raster..
255  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying SRTM...\n";
256  result = new ossimSrtmTileSource;
258  if (result->open(copyFilename)) break;
259 
260  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying General Raster...\n";
261  result = new ossimGeneralRasterTileSource;
263  if (result->open(copyFilename)) break;
264  }
265 
266  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ADRG...\n";
267  result = new ossimAdrgTileSource();
269  if (result->open(copyFilename)) break;
270 
271  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ossimQbTileFilesHandler...\n";
272  result = new ossimQbTileFilesHandler();
274  if (result->open(copyFilename)) break;
275 
276  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Bit Mask...\n";
277  result = new ossimBitMaskTileSource();
279  if (result->open(copyFilename)) break;
280 
281  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying band-separated files...\n";
282  result = new ossimBandSeparateHandler();
284  if (result->open(copyFilename)) break;
285 
286  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying CCF...\n";
287  result = new ossimCcfTileSource();
289  if (result->open(copyFilename)) break;
290 
291  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying OSSIM Range Domes...\n";
292  result = new ossimRangeDomeTileSource();
294  if (result->open(copyFilename)) break;
295 
296  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Point Cloud...\n";
297  result = new ossimPointCloudImageHandler();
299  if (result->open(copyFilename)) break;
300 
301  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying LAS Reader...\n";
303  result = new ossimLasReader();
304  if (result->open(copyFilename)) break;
305 
306 #if OSSIM_HAS_HDF5
307  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying VIIRS...\n";
308  result = new ossimViirsHandler();
310  if (result->open(copyFilename)) break;
311 #endif
312 
313  result = 0;
314  break;
315  }
316 
317  if (traceDebug())
318  {
319  if (result.valid())
320  ossimNotify(ossimNotifyLevel_DEBUG)<<M<< " SUCCESS" << std::endl;
321  else
322  ossimNotify(ossimNotifyLevel_DEBUG)<<M<< " Open FAILED" << std::endl;
323  }
324 
325  return result.release();
326 }
virtual bool open()=0
Pure virtual open.
void setOpenOverviewFlag(bool flag)
Sets theOpenOverviewFlag.
bool valid() const
Definition: ossimRefPtr.h:75
Class used for rendering point cloud data into a raster tile.
virtual ossimRefPtr< ossimImageHandler > openOverview(const ossimFilename &file) const
Open overview that takes a file name.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
bool exists() const
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
This is the image handler for providing mask pixels to an ossimMaskFilter object. ...
T * release()
Definition: ossimRefPtr.h:93
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a c...
Image handler used for tiled Quickbird imagery.
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
bool empty() const
Definition: ossimString.h:411
ossimString ext() const
Class used for rendering range domes (a.k.a.
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
Concrete class for reading VIIRS data from HDF5 file.
OSSIM LAS LIDAR reader.

◆ open() [2/4]

ossimImageHandler * ossimImageHandlerFactory::open ( const ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Implements ossimImageHandlerFactoryBase.

Definition at line 328 of file ossimImageHandlerFactory.cpp.

330 {
331  static const char* M = "ossimImageHandlerFactory::open(kwl,prefix) -- ";
332  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" entered..." << std::endl;
333 
335  while (true)
336  {
337  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying adrg...\n";
338  result = new ossimAdrgTileSource();
339  if (result->loadState(kwl, prefix)) break;
340 
341  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ccf...\n";
342  result = new ossimCcfTileSource();
343  if (result->loadState(kwl, prefix)) break;
344 
345  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying CIB/CADRG...\n";
346  result = new ossimCibCadrgTileSource();
347  if (result->loadState(kwl, prefix)) break;
348 
349  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "trying RpfCache...\n";
350  result = new ossimRpfCacheTileSource();
351  if (result->loadState(kwl, prefix)) break;
352 
353  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "trying Rpf ImageCache...\n";
354  result = new ossimImageCacheTileSource();
355  if (result->loadState(kwl, prefix)) break;
356 
357  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying DOQQ...\n";
358  result = new ossimDoqqTileSource();
359  if (result->loadState(kwl, prefix)) break;
360 
361  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying DTED...\n";
362  result = new ossimDtedTileSource();
363  if (result->loadState(kwl, prefix)) break;
364 
365  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying jpeg...\n";
366  result = new ossimJpegTileSource();
367  if (result->loadState(kwl, prefix)) break;
368 
369  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Quickbird NITF...\n";
370  result = new ossimQuickbirdNitfTileSource;
371  if (result->loadState(kwl, prefix)) break;
372 
373  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying Nitf...\n";
374  result = new ossimNitfTileSource();
375  if (result->loadState(kwl, prefix)) break;
376 
377  // Must be before tiff...
378  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Quickbird TIFF...\n";
379  result = new ossimQuickbirdTiffTileSource;
380  if (result->loadState(kwl, prefix)) break;
381 
382  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying tiff...\n";
383  result = new ossimTiffTileSource();
384  if (result->loadState(kwl, prefix)) break;
385 
386  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying USGS Dem...\n";
387  result = new ossimUsgsDemTileSource();
388  if (result->loadState(kwl, prefix)) break;
389 
390  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Landsat...\n";
391  result = new ossimLandsatTileSource();
392  if (result->loadState(kwl, prefix)) break;
393 
394  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying VPF...\n";
395  result = new ossimVpfTileSource;
396  if (result->loadState(kwl, prefix)) break;
397 
398  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ERS...\n";
399  result = new ossimERSTileSource;
400  if (result->loadState(kwl, prefix)) break;
401 
402  // Note: ENVI should be in front of general raster...
403  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ENVI...\n"<< std::endl;
404  result = new ossimEnviTileSource();
405  if (result->loadState(kwl, prefix)) break;
406 
407  // Note: SRTM should be in front of general raster...
408  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying SRTM...\n"<< std::endl;
409  result = new ossimSrtmTileSource();
410  if (result->loadState(kwl, prefix)) break;
411 
412  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying General Raster...\n"<< std::endl;
413  result = new ossimGeneralRasterTileSource();
414  if (result->loadState(kwl, prefix)) break;
415 
416  if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"trying ossimQbTileFilesHandler...\n"<<std::endl;
417  result = new ossimQbTileFilesHandler;
418  if (result->loadState(kwl, prefix)) break;
419 
420  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying band-separated files...\n";
421  result = new ossimBandSeparateHandler();
422  if (result->loadState(kwl, prefix)) break;
423 
424  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Range Domes CSV...\n";
425  result = new ossimRangeDomeTileSource();
426  if (result->loadState(kwl, prefix)) break;
427 
428 #if OSSIM_HAS_HDF5
429  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying VIIRS...\n";
430  result = new ossimViirsHandler();
431  if (result->loadState(kwl, prefix)) break;
432 #endif
433 
434 #ifdef ENABLE_POINT_CLOUD_HANDLER
435  if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ossimPointCloudImageHandler...\n";
436  result = new ossimPointCloudImageHandler();
437  if (result->loadState(kwl, prefix)) break;
438 #endif
439  result = 0;
440  break;
441  }
442 
443  if (traceDebug())
444  {
445  if (result.valid())
446  ossimNotify(ossimNotifyLevel_DEBUG)<<M<< " SUCCESS" << std::endl;
447  else
448  ossimNotify(ossimNotifyLevel_DEBUG)<<M<< " Open FAILED" << std::endl;
449  }
450 
451  return result.release();
452 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
Class used for rendering point cloud data into a raster tile.
This class defines an abstract Handler which all image handlers(loaders) should derive from...
T * release()
Definition: ossimRefPtr.h:93
CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a c...
Image handler used for tiled Quickbird imagery.
Class used for rendering range domes (a.k.a.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
Concrete class for reading VIIRS data from HDF5 file.

◆ open() [3/4]

ossimRefPtr< ossimImageHandler > ossimImageHandlerFactory::open ( std::shared_ptr< ossim::ImageHandlerState >  state) const
virtual

Reimplemented from ossimImageHandlerFactoryBase.

Definition at line 454 of file ossimImageHandlerFactory.cpp.

References createObject(), ossimRefPtr< T >::get(), and ossimImageHandler::open().

455 {
457  if(state)
458  {
459  ossimRefPtr<ossimObject> obj = createObject(state->getImageHandlerType());
460  if(obj)
461  {
462  result = dynamic_cast<ossimImageHandler*>(obj.get());
463  if(result)
464  {
465  if(!result->open(state))
466  {
467  result = 0;
468  }
469  }
470  obj = 0;
471  }
472 
473  }
474 
475  return result;
476 }
virtual bool open()=0
Pure virtual open.
virtual ossimObject * createObject(const ossimString &typeName) const
This class defines an abstract Handler which all image handlers(loaders) should derive from...

◆ open() [4/4]

ossimRefPtr< ossimImageHandler > ossimImageHandlerFactory::open ( std::shared_ptr< ossim::istream > &  str,
const std::string &  connectionString,
bool  openOverview 
) const
virtual

Open method that takes a stream.

Parameters
strOpen stream to image.
connectionString
openOverviewIf true attempt to open overview file.
Returns
ossimImageHandler

Reimplemented from ossimImageHandlerFactoryBase.

Definition at line 75 of file ossimImageHandlerFactory.cpp.

References ossimRefPtr< T >::get(), ossimTiffTileSource::open(), ossimNitfTileSource::open(), openOverview(), openSrcRecord(), and ossimImageHandler::setOpenOverviewFlag().

79 {
81 
82  // NITF:
85  if ( ih->open( str, connectionString ) )
86  {
87  result = ih.get();
88  }
89 
90  if( !result )
91  {
92  // Reset the stream for downstream code.
93  str->seekg(0, std::ios_base::beg);
94  str->clear();
95 
96  // TIFF:
99  if ( ihTiff->open( str, connectionString ) )
100  {
101  result = ihTiff.get();
102  }
103 
104  if(!result)
105  {
106  // Reset the stream for downstream code.
107  str->seekg(0, std::ios_base::beg);
108  str->clear();
109 
110  // ossim dot.src file:
111  result = openSrcRecord( str, connectionString, openOverview );
112 
113  if ( !result )
114  {
115  // Reset the stream for downstream code.
116  str->seekg(0, std::ios_base::beg);
117  str->clear();
118  }
119  }
120  }
121 
122  return result;
123 }
void setOpenOverviewFlag(bool flag)
Sets theOpenOverviewFlag.
virtual ossimRefPtr< ossimImageHandler > openOverview(const ossimFilename &file) const
Open overview that takes a file name.
ossimRefPtr< ossimImageHandler > openSrcRecord(std::shared_ptr< ossim::istream > &str, const std::string &connectionString, bool openOverview) const
Open dot.src (ossimSrcRecord).
virtual bool open()
Returns true if the image_file can be opened and is a valid nitf file.
virtual bool open(const ossimFilename &image_file)
Returns true if the image_file can be opened and is a valid tiff file.

◆ openOverview()

ossimRefPtr< ossimImageHandler > ossimImageHandlerFactory::openOverview ( const ossimFilename file) const
virtual

Open overview that takes a file name.

Parameters
fileFile to open.
Returns
ossimRefPtr to image handler on success or null on failure.

Reimplemented from ossimImageHandlerFactoryBase.

Definition at line 478 of file ossimImageHandlerFactory.cpp.

References ossimImageHandler::open(), ossimImageHandler::setOpenOverviewFlag(), and ossimString::size().

Referenced by open(), and openSrcRecord().

480 {
482  if ( file.size() )
483  {
484  result = new ossimTiffTileSource;
485 
486  result->setOpenOverviewFlag( false ); // Always false.
487 
488  if ( result->open( file ) == false )
489  {
490  result = 0;
491  }
492  }
493  return result;
494 }
virtual bool open()=0
Pure virtual open.
void setOpenOverviewFlag(bool flag)
Sets theOpenOverviewFlag.
std::string::size_type size() const
Definition: ossimString.h:405

◆ openSrcRecord()

ossimRefPtr< ossimImageHandler > ossimImageHandlerFactory::openSrcRecord ( std::shared_ptr< ossim::istream > &  str,
const std::string &  connectionString,
bool  openOverview 
) const
protected

Open dot.src (ossimSrcRecord).

Currently only opens a single image. Can be used for split base image with overviews and histograms in a separate "support" directory.

Input record example:

ossim_src_record_version: 1.0 image0.entry: 0 image0.file: s3://your_bucket/data1/test/data/public/tif/ls7-ff-fusion.tif image0.ovr: /data1/s3_test/ls7-ff-fusion.ovr image0.hist: /data1/s3_test/ls7-ff-fusion.his image0.support: /data1/s3_test

Parameters
strOpen stream to src record.
connectionStringPath to src file.
openOverviewIf true attempt to open overview file.
Returns
ossimRefPtr to image handler on success or null on failure.

Definition at line 1028 of file ossimImageHandlerFactory.cpp.

References ossimString::empty(), ossimSrcRecord::getEntryIndex(), ossimSrcRecord::getFilename(), ossimSrcRecord::getHistogramPath(), ossimImageHandler::getOverview(), ossimSrcRecord::getOverviewPath(), ossimSrcRecord::getSupportDir(), ossimImageHandlerRegistry::instance(), ossimFilename::isDir(), ossimSrcRecord::loadState(), openOverview(), ossimImageHandler::openOverview(), ossimKeywordlist::parseStream(), ossimFilename::path(), ossimImageHandler::setCurrentEntry(), ossimImageHandler::setSupplementaryDirectory(), ossimString::size(), ossimString::string(), and ossimRefPtr< T >::valid().

Referenced by open().

1032 {
1033  ossimRefPtr<ossimImageHandler> result = 0;
1034  if(!str) return result;
1035  // Check the extension for ".src" before going any further:
1036  std::size_t found = connectionString.find( std::string(".src") );
1037  if ( found != std::string::npos && ( found == (connectionString.size() - 4) ) )
1038  {
1039  ossimKeywordlist kwl;
1040  if ( kwl.parseStream( *str ) )
1041  {
1042  // Right now only concidering one image, i.e. "image0":
1043  std::string prefix = "image0.";
1044  ossimSrcRecord src;
1045  if ( src.loadState(kwl, prefix.c_str() ) )
1046  {
1047  if ( src.getFilename().string().size() )
1048  {
1049  // Avoid recursive loop:
1050  if (src.getFilename().string() != connectionString )
1051  {
1053  openConnection( src.getFilename(), false );
1054 
1055  if ( result.valid() )
1056  {
1057  ossimFilename supportDir = src.getSupportDir();
1058  if ( supportDir.empty() )
1059  {
1060  if ( src.getOverviewPath().size() )
1061  {
1062  if ( src.getOverviewPath().isDir() )
1063  {
1064  supportDir = src.getOverviewPath();
1065  }
1066  else
1067  {
1068  supportDir = src.getOverviewPath().path();
1069  }
1070  }
1071  else if ( src.getHistogramPath().size() )
1072  {
1073  if ( src.getHistogramPath().isDir() )
1074  {
1075  supportDir = src.getHistogramPath();
1076  }
1077  else
1078  {
1079  supportDir = src.getHistogramPath().path();
1080  }
1081  }
1082  }
1083 
1084  if ( supportDir.size() && (src.getFilename().path() != supportDir) )
1085  {
1086  result->setSupplementaryDirectory( supportDir );
1087  }
1088 
1089  if ( src.getEntryIndex() > 0 ) // defaulted to -1.
1090  {
1091  result->setCurrentEntry(
1092  static_cast<ossim_uint32>( src.getEntryIndex() ) );
1093  }
1094 
1095  if ( openOverview && ( result->getOverview() == 0 ) )
1096  {
1097  if ( src.getOverviewPath().size() )
1098  {
1099  result->openOverview( src.getOverviewPath() );
1100  }
1101  else
1102  {
1103  ossimFilename ovrFile = result->
1104  getFilenameWithThisExtension(ossimString(".ovr"));
1105  result->openOverview( ovrFile );
1106  }
1107  }
1108  }
1109  }
1110  }
1111  }
1112 
1113  } // Matches: if ( kwl.parseStream( str ) )
1114 
1115  if ( !result )
1116  {
1117  // Reset the stream for downstream code.
1118  str->seekg(0, std::ios_base::beg);
1119  str->clear();
1120  }
1121  }
1122  return result;
1123 }
Class used for parsing the command line *.src files.
ossim_int32 getEntryIndex() const
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Initializes record from an in-memory KWL and prefix.
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
virtual const ossimImageHandler * getOverview() const
virtual ossimRefPtr< ossimImageHandler > openOverview(const ossimFilename &file) const
Open overview that takes a file name.
bool isDir() const
const ossimFilename & getSupportDir() const
virtual bool openOverview()
Searches for an overview.
const ossimFilename & getOverviewPath() const
See note below on these data members.
const ossimFilename & getFilename() const
std::string::size_type size() const
Definition: ossimString.h:405
const ossimFilename & getHistogramPath() const
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated method
bool empty() const
Definition: ossimString.h:411
virtual void setSupplementaryDirectory(const ossimFilename &dir)
Sets the supplementary directory.
static ossimImageHandlerRegistry * instance()
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
ossimFilename path() const
const std::string & string() const
Definition: ossimString.h:414

◆ operator=()

void ossimImageHandlerFactory::operator= ( const ossimImageHandlerFactory )
inlineprotected

Definition at line 124 of file ossimImageHandlerFactory.h.

124 {}

Member Data Documentation

◆ theInstance

ossimImageHandlerFactory * ossimImageHandlerFactory::theInstance = 0
staticprotected

Definition at line 126 of file ossimImageHandlerFactory.h.

Referenced by instance(), and ~ossimImageHandlerFactory().


The documentation for this class was generated from the following files: