OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimImageHandler Class Referenceabstract

This class defines an abstract Handler which all image handlers(loaders) should derive from. More...

#include <ossimImageHandler.h>

Inheritance diagram for ossimImageHandler:
ossimImageSource ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced ossimAdrgTileSource ossimBandSeparateHandler ossimBitMaskTileSource ossimCcfTileSource ossimCibCadrgTileSource ossimDtedTileSource ossimGdalTileSource ossimGeneralRasterTileSource ossimGeoPdfReader ossimGpkgReader ossimH5ImageHandler ossimHdf5ImageHandler ossimHdfReader ossimImageCacheBase ossimImageHandlerMtAdaptor ossimJpegTileSource ossimKakaduJ2kReader ossimKakaduJp2Reader ossimKakaduJpipHandler ossimKmlSuperOverlayReader ossimLasReader ossimMG4LidarReader ossimMrSidReader ossimNitfTileSource ossimOgrGdalTileSource ossimOgrVectorTileSource ossimOpjJp2Reader ossimPngReader ossimPointCloudImageHandler ossimRangeDomeTileSource ossimRpfCacheTileSource ossimTiffTileSource ossimTiledImageHandler ossimUsgsDemTileSource ossimVideoImageHandler ossimVpfTileSource

Public Types

enum  ossimImageHandlerOverviewCompressionType {
  OSSIM_OVERVIEW_COMPRESSION_NONE = 0, OSSIM_OVERVIEW_COMPRESSION_JPEG, OSSIM_OVERVIEW_COMPRESSION_LZW, OSSIM_OVERVIEW_COMPRESSION_DEFLATE,
  OSSIM_OVERVIEW_COMPRESSION_PACKBITS
}
 
- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 

Public Member Functions

 ossimImageHandler ()
 Constructor (default): More...
 
virtual ~ossimImageHandler ()
 Destructor: Derived classes should implement. More...
 
virtual void initialize ()
 initialize Does nothing in this class. More...
 
virtual bool openOverview ()
 Searches for an overview. More...
 
virtual bool openOverview (const ossimFilename &overview_file)
 Calls closeOverview(), then attempts to open the overview_file. More...
 
virtual void closeOverview ()
 If theOverview is initialized it will be deleted and set to NULL. More...
 
virtual const ossimImageHandlergetOverview () const
 
virtual bool hasOverviews () const
 
virtual ossimFilename createDefaultOverviewFilename () const
 
virtual ossimFilename createDefaultGeometryFilename () const
 
virtual ossimFilename createDefaultMetadataFilename () const
 
virtual ossimFilename createDefaultHistogramFilename () const
 
virtual ossimFilename createDefaultValidVerticesFilename () const
 
virtual bool writeValidImageVertices (const std::vector< ossimIpt > &vertices, const ossimFilename &file=ossimFilename(""))
 Outputs vertices to file and updates the internal vertex array variable "theValidImageVertices". More...
 
virtual bool openValidVertices (const ossimFilename &vertices_file)
 Opens the valid image vertices file and sets theValidImageVerticesFile variable. More...
 
virtual bool openValidVertices ()
 Creates vertices file name based on image, then tries to open. More...
 
virtual bool open ()=0
 Pure virtual open. More...
 
virtual bool open (const ossimFilename &imageFile, ossim_uint32 entryIndex)
 Opens the image file. More...
 
virtual bool open (const ossimFilename &imageFile)
 
virtual bool open (std::shared_ptr< ossim::ImageHandlerState > state)
 
virtual void close ()
 Deletes the overview and clears the valid image vertices. More...
 
virtual bool isOpen () const =0
 Derived classes must implement this method to be concrete. More...
 
virtual bool buildHistogram (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histogram for image file. More...
 
virtual bool buildAllHistograms (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histograms for all image entries. More...
 
virtual bool buildOverview (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for theImageFile. More...
 
virtual bool buildAllOverviews (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for all image entries. More...
 
virtual bool buildOverview (const ossimFilename &filename, ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build an over file for filename. More...
 
ossimRefPtr< ossimMultiResLevelHistogramgetImageHistogram () const
 Fetches the current entry image's histogram. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual void setImageGeometry (ossimImageGeometry *geom)
 Sets the image geometry object. More...
 
virtual void saveImageGeometry () const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const =0
 Pure virtual, derived classes must implement. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const =0
 Pure virtual, derived classes must implement. More...
 
virtual ossimIrect getImageRectangle (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 
virtual void getDecimationFactors (vector< ossimDpt > &decimations) const
 This returns all decimation for all levels. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 This returns the total number of decimation levels. More...
 
virtual ossim_uint32 getNumberOfReducedResSets () const
 This method is obsolete. More...
 
virtual void setFilename (const ossimFilename &filename)
 Sets the filename. More...
 
virtual const ossimFilenamegetFilename () const
 Returns the filename. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual bool isValidRLevel (ossim_uint32 resLevel) const
 Determines if the passed in reslution level is valid. More...
 
bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 Connection rule. More...
 
virtual void getValidImageVertices (vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual bool isBandSelector () const
 Indicates whether or not the image handler can control output band selection via the setOutputBandList method. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &band_list)
 If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled. More...
 
virtual bool setOutputToInputBandList ()
 If the image handler "isBandSeletor()" then the band selection of the output are set to input or identity. More...
 
virtual bool isIdentityBandList (const std::vector< ossim_uint32 > &bandList) const
 Convenience method to see if band list is identity. More...
 
virtual bool isImageTiled () const
 Indicates whether or not the image is tiled internally. More...
 
virtual ossim_uint32 getImageTileWidth () const =0
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossim_uint32 getImageTileHeight () const =0
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual bool hasMetaData () const
 
virtual ossimRefPtr< ossimNBandLutDataObjectgetLut () const
 
virtual bool hasLut () const
 
virtual void loadMetaData ()
 There is an external file with an omd extension. More...
 
virtual double getMinPixelValue (ossim_uint32 band=0) const
 Retuns the min pixel value. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual void setMinPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set min pixel value. More...
 
virtual void setMaxPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set max pixel value. More...
 
virtual void setNullPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set null pixel value. More...
 
virtual ossim_uint32 getCurrentEntry () const
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
virtual void getEntryNames (std::vector< ossimString > &entryNames) const
 
bool useEntryIndex () const
 Convenience method to determine if entry index should be used for support files, e.g. More...
 
ossimFilename getOverviewFile () const
 
virtual bool setCurrentEntry (ossim_uint32 entryIdx)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
ossimFilename getFilenameWithThisExtension (const ossimString &ext, bool set_e0_prefix=false) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
void getFilenameWithThisExt (const ossimString &ext, ossimFilename &f) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
ossim_uint32 getStartingResLevel () const
 
void setStartingResLevel (ossim_uint32 level)
 
bool getOpenOverviewFlag () const
 
void setOpenOverviewFlag (bool flag)
 Sets theOpenOverviewFlag. More...
 
virtual void setSupplementaryDirectory (const ossimFilename &dir)
 Sets the supplementary directory. More...
 
virtual const ossimFilenamegetSupplementaryDirectory () const
 Returns the supplementary directory. More...
 
const ossimStringgetImageID () const
 Fetches the image ID. More...
 
void setImageID (const ossimString &id)
 Sets the image ID in case it is externally generated. More...
 
ossimPixelType getPixelType () const
 Returns the raster pixel alignment type. More...
 
virtual bool getRgbBandList (std::vector< ossim_uint32 > &bandList) const
 Convenience method to get the zero based rgb output band list. More...
 
template<class T >
std::shared_ptr< T > getStateAs ()
 
template<class T >
std::shared_ptr< const T > getStateAs () const
 
std::shared_ptr< ossim::ImageHandlerState > getState ()
 
std::shared_ptr< const ossim::ImageHandlerState > getState () const
 
void setState (std::shared_ptr< ossim::ImageHandlerState > state)
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual ossim_uint32 getNumberOfInputBands () const =0
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual ossimScalarType getOutputScalarType () const
 This will be used to query the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () 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 isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- 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
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

virtual ossimRefPtr< ossimImageGeometrygetExternalImageGeometry () const
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () const
 
virtual bool getOverviewTile (ossim_uint32 resLevel, ossimImageData *result)
 Method to get an overview tile. More...
 
bool initVertices (const char *file)
 Opens file and attempts to initialize the valid image vertices. More...
 
virtual void completeOpen ()
 Will complete the opening process. More...
 
void initImageParameters (ossimImageGeometry *geom) const
 Convenience method to set things needed in the image geometry from the image handler. More...
 
virtual void establishDecimationFactors ()
 Virtual method determines the decimation factors at each resolution level. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &inBandList, std::vector< ossim_uint32 > &outBandList)
 Convenience method to set output band list. More...
 
void getFilenameWithNoExtension (ossimFilename &f) const
 Get filename with no extension, using supplentary directory for dirname if set. More...
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

ossimFilename theImageFile
 
ossimFilename theOverviewFile
 
ossimFilename theSupplementaryDirectory
 
ossimRefPtr< ossimImageHandlertheOverview
 
vector< ossimIpttheValidImageVertices
 
ossimImageMetaData theMetaData
 
ossimRefPtr< ossimImageGeometrytheGeometry
 
ossimRefPtr< ossimNBandLutDataObjecttheLut
 
std::vector< ossimDpttheDecimationFactors
 
ossimString theImageID
 
ossim_uint32 theStartingResLevel
 theStartingResLevel If set to something other than zero(default) this is indicative that the reader is an overview. More...
 
bool theOpenOverviewFlag
 If true opening of overviews will be attempted. More...
 
ossimPixelType thePixelType
 
std::shared_ptr< ossim::ImageHandlerState > m_state
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

This class defines an abstract Handler which all image handlers(loaders) should derive from.

Definition at line 35 of file ossimImageHandler.h.

Member Enumeration Documentation

◆ ossimImageHandlerOverviewCompressionType

Constructor & Destructor Documentation

◆ ossimImageHandler()

ossimImageHandler::ossimImageHandler ( )

Constructor (default):

Definition at line 65 of file ossimImageHandler.cpp.

66 :
67 ossimImageSource(0, 0, 0, true, false /* output list is not fixed */ ),
71 theOverview(0),
73 theMetaData(),
74 theGeometry(),
75 theLut(0),
77 theImageID(""),
81 {
82  if (traceDebug())
83  {
85  << "ossimImageHandler::ossimImageHandler() DEBUG:" << std::endl;
86 #ifdef OSSIM_ID_ENABLED
88  << "OSSIM_ID: "
89  << OSSIM_ID
90  << std::endl;
91 #endif
92  }
93 
94  // Check for global preference supplementary dir.
96  preferencesKWL().findKey( std::string("ossim_supplementary_directory") );
97 }
ossimRefPtr< ossimImageGeometry > theGeometry
ossimFilename theImageFile
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
Definition: ossimFilename.h:40
std::vector< ossimDpt > theDecimationFactors
bool theOpenOverviewFlag
If true opening of overviews will be attempted.
ossimFilename theSupplementaryDirectory
ossimPixelType thePixelType
ossimImageSource(ossimObject *owner=0)
vector< ossimIpt > theValidImageVertices
static ossimPreferences * instance()
ossimImageMetaData theMetaData
ossimRefPtr< ossimImageHandler > theOverview
ossimFilename theOverviewFile
ossimRefPtr< ossimNBandLutDataObject > theLut
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_uint32 theStartingResLevel
theStartingResLevel If set to something other than zero(default) this is indicative that the reader i...
const std::string & string() const
Definition: ossimString.h:414

◆ ~ossimImageHandler()

ossimImageHandler::~ossimImageHandler ( )
virtual

Destructor: Derived classes should implement.

Definition at line 99 of file ossimImageHandler.cpp.

References theOverview.

100 {
101  theOverview = 0;
102 }
ossimRefPtr< ossimImageHandler > theOverview

Member Function Documentation

◆ buildAllHistograms()

bool ossimImageHandler::buildAllHistograms ( int  numberOfRLevels = 0,
ossimHistogramMode  mode = OSSIM_HISTO_MODE_NORMAL 
)
virtual

Build a histograms for all image entries.

Parameters
numberOfRLevelssets the maximum number of reduced resolution level to compute histogram for.
modeOSSIM_HISTO_MODE_NORMAL or OSSIM_HISTO_MODE_FAST.
Returns
true on success, false if not open.

Definition at line 552 of file ossimImageHandler.cpp.

References buildHistogram(), getCurrentEntry(), getEntryList(), and setCurrentEntry().

554 {
555  ossim_uint32 currentEntry = getCurrentEntry();
556  std::vector<ossim_uint32> entryList;
557  getEntryList(entryList);
558  ossim_uint32 idx = 0;
559  for(idx = 0; idx < entryList.size(); ++idx)
560  {
561  setCurrentEntry(entryList[idx]);
562  if(!buildHistogram( numberOfRLevels, mode ))
563  {
564  setCurrentEntry(currentEntry);
565  return false;
566  }
567  }
568 
569  setCurrentEntry(currentEntry);
570  return true;
571 }
unsigned int ossim_uint32
virtual ossim_uint32 getCurrentEntry() const
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
virtual bool buildHistogram(int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
Build a histogram for image file.

◆ buildAllOverviews()

bool ossimImageHandler::buildAllOverviews ( ossimImageHandlerOverviewCompressionType  compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
ossim_uint32  quality = 75,
ossimFilterResampler::ossimFilterResamplerType  resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
bool  includeFullResFlag = false 
)
virtual

Will build over file for all image entries.

Parameters
includeFullResFlagif true the full resolution layer will also be put in the overview format. This is handly for inefficeint formats.

Definition at line 589 of file ossimImageHandler.cpp.

References buildOverview(), getCurrentEntry(), getEntryList(), and setCurrentEntry().

593 {
594  ossim_uint32 currentEntry = getCurrentEntry();
595  std::vector<ossim_uint32> entryList;
596  getEntryList(entryList);
597  ossim_uint32 idx = 0;
598  for(idx = 0; idx < entryList.size(); ++idx)
599  {
600  setCurrentEntry(entryList[idx]);
601  if(!buildOverview(compressionType, quality, resampleType, includeFullResFlag))
602  {
603  setCurrentEntry(currentEntry);
604  return false;
605  }
606  }
607 
608  setCurrentEntry(currentEntry);
609  return true;
610 }
virtual bool buildOverview(ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
Will build over file for theImageFile.
unsigned int ossim_uint32
virtual ossim_uint32 getCurrentEntry() const
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
virtual bool setCurrentEntry(ossim_uint32 entryIdx)

◆ buildHistogram()

bool ossimImageHandler::buildHistogram ( int  numberOfRLevels = 0,
ossimHistogramMode  mode = OSSIM_HISTO_MODE_NORMAL 
)
virtual

Build a histogram for image file.

Parameters
numberOfRLevelssets the maximum number of reduced resolution level to compute histogram for.
modeOSSIM_HISTO_MODE_NORMAL or OSSIM_HISTO_MODE_FAST.
Returns
true on success, false if not open.

Definition at line 507 of file ossimImageHandler.cpp.

References ossimListenerManager::addListener(), ossimConnectableObject::connectMyInputTo(), ossimConnectableObject::disconnect(), ossimSource::enableSource(), ossimHistogramWriter::execute(), ossimRefPtr< T >::get(), getFilenameWithThisExtension(), getNumberOfDecimationLevels(), isOpen(), ossimImageHistogramSource::setComputationMode(), ossimHistogramWriter::setFilename(), ossimImageHistogramSource::setMaxNumberOfRLevels(), and theStdOutProgress.

Referenced by buildAllHistograms(), and ATP::AtpGenerator::constructChain().

509 {
510  if(isOpen())
511  {
512  ossimFilename file =
514 
517 
518  if(numberOfRLevels)
519  {
520  histoSource->setMaxNumberOfRLevels(numberOfRLevels);
521  }
522  else
523  {
525  }
526 
527  //---
528  // Note if mode==OSSIM_HISTO_MODE_UNKNOWN the histoSource defaults to
529  // normal mode.
530  //---
531  histoSource->setComputationMode( mode );
532 
533  histoSource->connectMyInputTo(0, this);
534  histoSource->enableSource();
535  writer->connectMyInputTo(0, histoSource.get());
536  writer->setFilename(file);
537  writer->addListener(&theStdOutProgress);
538  writer->execute();
539  histoSource->disconnect();
540  writer->disconnect();
541  histoSource = 0;
542  writer = 0;
543  }
544  else
545  {
546  return false;
547  }
548 
549  return true;
550 }
virtual bool addListener(ossimListener *listener)
void setComputationMode(ossimHistogramMode mode)
virtual void disconnect(ossimConnectableObject *object=0)
Will disconnect the object passed in.
OSSIM_DLL ossimStdOutProgress theStdOutProgress
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
virtual void enableSource()
Definition: ossimSource.cpp:84
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
virtual void setMaxNumberOfRLevels(ossim_uint32 number)
virtual void setFilename(const ossimFilename &filename)
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ buildOverview() [1/2]

bool ossimImageHandler::buildOverview ( ossimImageHandlerOverviewCompressionType  compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
ossim_uint32  quality = 75,
ossimFilterResampler::ossimFilterResamplerType  resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
bool  includeFullResFlag = false 
)
virtual

Will build over file for theImageFile.

Parameters
includeFullResFlagif true the full resolution layer will also be put in the overview format. This is handly for inefficeint formats.

Definition at line 573 of file ossimImageHandler.cpp.

References getFilenameWithThisExtension(), openOverview(), and theOverviewFile.

Referenced by buildAllOverviews().

577 {
579 
580  theOverviewFile = file;
581  if(buildOverview(file, compressionType, quality, resampleType, includeFullResFlag))
582  {
583  openOverview();
584  }
585 
586  return true;
587 }
virtual bool buildOverview(ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
Will build over file for theImageFile.
virtual bool openOverview()
Searches for an overview.
ossimFilename theOverviewFile
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ buildOverview() [2/2]

bool ossimImageHandler::buildOverview ( const ossimFilename filename,
ossimImageHandlerOverviewCompressionType  compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
ossim_uint32  quality = 75,
ossimFilterResampler::ossimFilterResamplerType  resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
bool  includeFullResFlag = false 
)
virtual

Will build an over file for filename.

Parameters
filenameName of image file.
includeFullResFlagif true the full resolution layer will also be put in the overview format. This is handly for inefficeint formats.

Definition at line 613 of file ossimImageHandler.cpp.

References ossimTiffOverviewBuilder::buildOverview(), closeOverview(), ossim::COMPRESSION_NONE, isOpen(), OSSIM_OVERVIEW_COMPRESSION_DEFLATE, OSSIM_OVERVIEW_COMPRESSION_JPEG, OSSIM_OVERVIEW_COMPRESSION_LZW, OSSIM_OVERVIEW_COMPRESSION_NONE, OSSIM_OVERVIEW_COMPRESSION_PACKBITS, ossimTiffOverviewBuilder::setCompressionType(), ossimTiffOverviewBuilder::setInputSource(), ossimTiffOverviewBuilder::setJpegCompressionQuality(), ossimTiffOverviewBuilder::setResampleType(), and theOverviewFile.

618 {
619  closeOverview();
620  if(!isOpen())
621  {
622  return false;
623  }
624 
625  theOverviewFile = filename;
626  ossimTiffOverviewBuilder tiffBuilder;
627  if ( tiffBuilder.setInputSource(this) == false )
628  {
629  return false;
630  }
631 
633  switch(compressionType)
634  {
636  {
637  cType = COMPRESSION_NONE;
638  break;
639  }
641  {
642  cType = COMPRESSION_JPEG;
643  break;
644  }
646  {
647  cType = COMPRESSION_LZW;
648  break;
649  }
651  {
652 
653  cType = COMPRESSION_DEFLATE;
654  break;
655  }
657  {
658  cType = COMPRESSION_PACKBITS;
659  break;
660  }
661  }
662  tiffBuilder.setJpegCompressionQuality(quality);
663  tiffBuilder.setCompressionType(cType);
664  tiffBuilder.setResampleType(resampleType);
665  tiffBuilder.buildOverview(filename, includeFullResFlag);
666 
667  return true;
668 }
virtual void closeOverview()
If theOverview is initialized it will be deleted and set to NULL.
unsigned short ossim_uint16
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
void setJpegCompressionQuality(ossim_int32 quality)
Sets the compression quality for use when using a compression type of COMPRESSION_JPEG.
virtual bool setInputSource(ossimImageHandler *imageSource)
Sets the input to the builder.
void setCompressionType(ossim_uint16 compression_type)
Sets the compression type to use when building overviews.
ossimFilename theOverviewFile
bool buildOverview(const ossimFilename &overview_file, bool copy_all=false)
Builds overview file and sets "theOutputFile" to that of the overview_file.
void setResampleType(ossimFilterResampler::ossimFilterResamplerType resampleType)
Supports BOX or NEAREST NEIGHBOR.

◆ canConnectMyInputTo()

bool ossimImageHandler::canConnectMyInputTo ( ossim_int32  inputIndex,
const ossimConnectableObject object 
) const
virtual

Connection rule.

Since image handler currently don't have any inputs this will just return false saying we can't connect anything to an image handler.

Implements ossimConnectableObject.

Reimplemented in ossimImageHandlerMtAdaptor.

Definition at line 1538 of file ossimImageHandler.cpp.

1540 {
1541  return false;
1542 }

◆ close()

void ossimImageHandler::close ( )
virtual

Deletes the overview and clears the valid image vertices.

Derived classes should implement.

Reimplemented in ossimPngReader, ossimGpkgReader, ossimOpjJp2Reader, ossimJpegTileSource, ossimH5ImageHandler, ossimHdfReader, ossimHdf5ImageHandler, ossimAdrgTileSource, ossimGeneralRasterTileSource, ossimBitMaskTileSource, ossimNitfTileSource, ossimRangeDomeTileSource, ossimCibCadrgTileSource, ossimTiffTileSource, ossimLasReader, ossimplugins::ossimTerraSarTiffReader, ossimRpfCacheTileSource, ossimPointCloudImageHandler, ossimplugins::ossimRadarSat2TiffReader, ossimImageHandlerMtAdaptor, ossimDtedTileSource, ossimCcfTileSource, ossimImageCacheTileSource, ossimOgrGdalTileSource, ossimOgrVectorTileSource, ossimTiledImageHandler, ossimGdalTileSource, ossimKakaduJpipHandler, ossimBandSeparateHandler, ossimKmlSuperOverlayReader, ossimImageCacheBase, ossimVideoImageHandler, and ossimVpfTileSource.

Definition at line 1264 of file ossimImageHandler.cpp.

References setState(), theDecimationFactors, theGeometry, theOverview, and theValidImageVertices.

Referenced by ossimKakaduJpipHandler::close(), ossimImageHandlerMtAdaptor::close(), ossimPointCloudImageHandler::close(), ossimLasReader::close(), ossimTiffTileSource::close(), ossimCibCadrgTileSource::close(), ossimBitMaskTileSource::close(), ossimGeneralRasterTileSource::close(), ossimHdf5ImageHandler::close(), ossimH5ImageHandler::close(), ossimOpjJp2Reader::close(), ossimGpkgReader::close(), ossimPngReader::close(), ossimMG4LidarReader::closeEntry(), ossimGeoPdfReader::closeEntry(), ossimMrSidReader::closeEntry(), ossimKakaduJp2Reader::closeEntry(), ossimKakaduJ2kReader::closeEntry(), ossimGeoidImage::open(), open(), and ossimHdfReader::~ossimHdfReader().

1265 {
1266  theOverview = 0;
1267  theGeometry = 0;
1268  theValidImageVertices.clear();
1269  theDecimationFactors.clear();
1270  setState(0);
1271 }
ossimRefPtr< ossimImageGeometry > theGeometry
void setState(std::shared_ptr< ossim::ImageHandlerState > state)
std::vector< ossimDpt > theDecimationFactors
vector< ossimIpt > theValidImageVertices
ossimRefPtr< ossimImageHandler > theOverview

◆ closeOverview()

void ossimImageHandler::closeOverview ( )
virtual

If theOverview is initialized it will be deleted and set to NULL.

Also clears theOverviewFile.

Returns
void

Definition at line 830 of file ossimImageHandler.cpp.

References theOverview.

Referenced by buildOverview(), and ossimImageHandlerMtAdaptor::close().

831 {
832  theOverview = 0;
833 }
ossimRefPtr< ossimImageHandler > theOverview

◆ completeOpen()

void ossimImageHandler::completeOpen ( )
protectedvirtual

Will complete the opening process.

If there are overviews it will open them. If there is meta data it will open that and if there is valid vertices it will open that.

Reimplemented in ossimLasReader.

Definition at line 1519 of file ossimImageHandler.cpp.

Referenced by ossimBandSeparateHandler::open(), ossimPointCloudImageHandler::open(), ossimPngReader::open(), ossimKakaduJpipHandler::openStream(), ossimHdf5ImageHandler::setCurrentEntry(), ossimH5ImageHandler::setCurrentEntry(), ossimNitfTileSource::setCurrentEntry(), ossimGpkgReader::setCurrentEntry(), ossimRpfCacheTileSource::setCurrentEntry(), ossimCibCadrgTileSource::setCurrentEntry(), ossimPointCloudImageHandler::setPointCloudHandler(), and setSupplementaryDirectory().

1520 {
1521  if(traceDebug())
1522  {
1523  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageHandler::completeOpen(): Entered........" << std::endl;
1524  }
1525  loadMetaData();
1526  if ( theOpenOverviewFlag )
1527  {
1528  openOverview();
1529  }
1531  if(traceDebug())
1532  {
1533  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageHandler::completeOpen(): Leaving......." << std::endl;
1534  }
1536 }
bool theOpenOverviewFlag
If true opening of overviews will be attempted.
virtual bool openOverview()
Searches for an overview.
virtual bool openValidVertices()
Creates vertices file name based on image, then tries to open.
virtual void establishDecimationFactors()
Virtual method determines the decimation factors at each resolution level.
virtual void loadMetaData()
There is an external file with an omd extension.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ createDefaultGeometryFilename()

ossimFilename ossimImageHandler::createDefaultGeometryFilename ( ) const
virtual
Returns
ossimFilename represents an external OSSIM geometry filename.

Definition at line 1844 of file ossimImageHandler.cpp.

References getFilenameWithThisExtension().

Referenced by getProperty().

1845 {
1846  return getFilenameWithThisExtension("geom");
1847 }
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ createDefaultHistogramFilename()

ossimFilename ossimImageHandler::createDefaultHistogramFilename ( ) const
virtual
Returns
ossimFilename represents an external OSSIM histogram filename.

Definition at line 1854 of file ossimImageHandler.cpp.

References getFilenameWithThisExtension().

Referenced by getProperty().

1855 {
1856  return getFilenameWithThisExtension("his");
1857 }
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ createDefaultMetadataFilename()

ossimFilename ossimImageHandler::createDefaultMetadataFilename ( ) const
virtual
Returns
ossimFilename represents an external OSSIM metadata filename.

Definition at line 1849 of file ossimImageHandler.cpp.

References getFilenameWithThisExtension().

Referenced by getProperty().

1850 {
1851  return getFilenameWithThisExtension("omd");
1852 }
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ createDefaultOverviewFilename()

ossimFilename ossimImageHandler::createDefaultOverviewFilename ( ) const
virtual
Returns
ossimFilename represents an external OSSIM overview filename.

Definition at line 1839 of file ossimImageHandler.cpp.

References getFilenameWithThisExtension().

Referenced by getProperty().

1840 {
1841  return getFilenameWithThisExtension("ovr");
1842 }
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ createDefaultValidVerticesFilename()

ossimFilename ossimImageHandler::createDefaultValidVerticesFilename ( ) const
virtual
Returns
ossimFilename represents an external OSSIM valid vertices filename.

Definition at line 1859 of file ossimImageHandler.cpp.

References ossimFilename::dirCat(), ossimFilename::fileNoExtension(), getCurrentEntry(), getNumberOfEntries(), ossimFilename::path(), theImageFile, and ossimString::toString().

Referenced by getProperty(), ATP::AtpGenerator::getValidVertices(), and writeValidImageVertices().

1860 {
1861  ossimFilename result;
1862 
1863  result = theImageFile.path();
1864  result = result.dirCat(theImageFile.fileNoExtension());
1865  result += "_vertices";
1866  if(getNumberOfEntries() > 1)
1867  {
1868  result += "_e";
1870  }
1871  result += ".kwl";
1872 
1873  return result;
1874 }
ossimFilename theImageFile
static ossimString toString(bool aValue)
Numeric to string methods.
virtual ossim_uint32 getCurrentEntry() const
virtual ossim_uint32 getNumberOfEntries() const
ossimFilename fileNoExtension() const
ossimFilename dirCat(const ossimFilename &file) const
ossimFilename path() const

◆ establishDecimationFactors()

void ossimImageHandler::establishDecimationFactors ( )
protectedvirtual

Virtual method determines the decimation factors at each resolution level.

This base class implementation computes the decimation by considering the ratios in image size between resolution levels, with fuzzy logic for rounding ratios to the nearest power of 2 if possible. Derived classes need to override this method if the decimations are provided as part of the image metadata.

Reimplemented in ossimNitfTileSource, ossimRpfCacheTileSource, ossimImageCacheBase, and ossimBitMaskTileSource.

Definition at line 442 of file ossimImageHandler.cpp.

References getNumberOfDecimationLevels(), getNumberOfLines(), getNumberOfSamples(), theDecimationFactors, ossimDpt::x, and ossimDpt::y.

Referenced by ossimLasReader::completeOpen(), ossimImageCacheBase::establishDecimationFactors(), ossimRpfCacheTileSource::establishDecimationFactors(), and ossimNitfTileSource::establishDecimationFactors().

443 {
444  double line_decimation, samp_decimation, decimation, ratio;
445  ossim_uint32 num_lines, num_samps;
446 
447  // The error margin here is effectively the percent error tolerated between ideal number of
448  // pixels for given power-of-2 decimation, and the actual number of pixels found at this
449  // decimation level. Typically, the last level will have fewer pixels than expected, hence the
450  // need for this logic...
451  static const double ERROR_MARGIN = 1.1; // 10% allowance
452 
453  // NOTE -- Until the end of this method, all decimation values are actually inverse quantities,
454  // i.e., a decimation of 0.5 typical for rlevel 1 is represented here as 2. This facilitates the
455  // fuzzy logic for recognizing powers of 2 (as integers)
456 
457  // Default implementation assumes R0 is not decimated. Check for R0 defined by derived class
458  // however, in case this is not the case:
459  ossimDpt decimation_r0 (1.0, 1.0);
460  if (theDecimationFactors.size() > 0)
461  {
462  decimation_r0.x = 1.0/theDecimationFactors[0].x; // note use of inverse decimation
463  decimation_r0.y = 1.0/theDecimationFactors[0].y;
464  }
465  else
466  theDecimationFactors.push_back(decimation_r0);
467 
468  // Variables used in loop below:
469  ossim_uint32 num_lines_r0 = getNumberOfLines(0);
470  ossim_uint32 num_samps_r0 = getNumberOfSamples(0);
471  ossim_uint32 power_of_2_decimation = (ossim_uint32) decimation_r0.x;
472 
473  // Remaining res levels are computed as a ratio of image size at R0 to image size at Rn:
475  for(ossim_uint32 res_level = 1; res_level < nRlevels; ++res_level)
476  {
477  num_lines = getNumberOfLines(res_level);
478  num_samps = getNumberOfSamples(res_level);
479 
480  if ((num_lines < 2) || (num_samps < 2))
481  break;
482 
483  line_decimation = decimation_r0.y * num_lines_r0 / (double)num_lines;
484  samp_decimation = decimation_r0.x * num_samps_r0 / (double)num_samps;
485  decimation = line_decimation<samp_decimation ? line_decimation:samp_decimation;
486 
487  // Check for possible error due to inexact ratios.
488  // Loop until reasonable effort was made to establish the corresponding power-of-2 decimation.
489  // If close match is found, the exact integer value is assigned:
490  do
491  {
492  power_of_2_decimation *= 2;
493  ratio = (double)power_of_2_decimation / decimation;
494  if (ratio < 1.0)
495  ratio = 1.0/ratio;
496  if (ratio < ERROR_MARGIN)
497  decimation = (double) power_of_2_decimation;
498 
499  } while ((double) power_of_2_decimation < decimation);
500 
501  // Convert the computed decimation back to fractional form before saving in the factors list:
502  decimation = 1.0/decimation;
503  theDecimationFactors.push_back(ossimDpt(decimation, decimation));
504  }
505 }
std::vector< ossimDpt > theDecimationFactors
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
unsigned int ossim_uint32
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getBoundingRect()

ossimIrect ossimImageHandler::getBoundingRect ( ossim_uint32  resLevel = 0) const
virtual

◆ getCurrentEntry()

ossim_uint32 ossimImageHandler::getCurrentEntry ( ) const
virtual

◆ getDecimationFactor()

void ossimImageHandler::getDecimationFactor ( ossim_uint32  resLevel,
ossimDpt result 
) const
virtual
Parameters
resLevelReduced resolution set for requested decimation.
resultossimDpt to initialize with requested decimation.
Note
Initialized "result" with the decimation factor for the passed in resLevel. Most of the time the returned factor is a square decimation along x and y indicated by result.x and .y = 1.0/(resLevel^2) where ^ means rasing to the power of. If the resLevel is 1 then the return decimation .5, .5. this is not the decimation to each resolution level but the total decimation from res level 0. So if resLevel is 2 then the return is .25, .25.
Derived classes should override if the decimation is anything other than a power of two change in each direction per res level.

Reimplemented from ossimImageSource.

Reimplemented in ossimGdalTileSource, ossimKakaduJ2kReader, and ossimMrSidReader.

Definition at line 419 of file ossimImageHandler.cpp.

References ossimDpt::makeNan(), and theDecimationFactors.

Referenced by ossimTiledImageHandler::getImageRectangle(), and getValidImageVertices().

420 {
421  if (resLevel < theDecimationFactors.size())
422  result = theDecimationFactors[resLevel];
423  else
424  result.makeNan();
425 }
std::vector< ossimDpt > theDecimationFactors
void makeNan()
Definition: ossimDpt.h:65

◆ getDecimationFactors()

void ossimImageHandler::getDecimationFactors ( vector< ossimDpt > &  decimations) const
virtual

This returns all decimation for all levels.

Reimplemented in ossimKakaduJ2kReader, and ossimMrSidReader.

Definition at line 427 of file ossimImageHandler.cpp.

References theDecimationFactors.

Referenced by ossimImageModel::initialize().

428 {
429  decimations = theDecimationFactors;
430 }
std::vector< ossimDpt > theDecimationFactors

◆ getEntryList()

void ossimImageHandler::getEntryList ( std::vector< ossim_uint32 > &  entryList) const
virtual

◆ getEntryName()

void ossimImageHandler::getEntryName ( ossim_uint32  entryIdx,
std::string &  name 
) const
virtual

Get the name of entry as a string.

This implementation clears name. Derived classes that support multiple entries and have "named" entries should re-implement to provide entry names. Example given from HDF5 file:

entry_name: /All_Data/VIIRS-IMG-GTM-EDR-GEO_All/QF1_VIIRSGTMGEO

Parameters
entryIdxZero based entry index. If out of range name will be cleared.
nameInitialized by this.

Definition at line 1510 of file ossimImageHandler.cpp.

References getEntryNames().

Referenced by ossimInfo::getImageInfo().

1511 {
1512  name = "";
1513  std::vector<ossimString> entryNames;
1514  getEntryNames(entryNames);
1515  if (entryIdx < entryNames.size())
1516  name = entryNames[entryIdx].string();
1517 }
virtual void getEntryNames(std::vector< ossimString > &entryNames) const

◆ getEntryNames()

void ossimImageHandler::getEntryNames ( std::vector< ossimString > &  entryNames) const
virtual
Parameters
getEntryNamesList to initialize with strings associated with entries.
Note
This implementation calls getEntryList and converts entries in the list to strings. Derived classes that support multiple entries with associated strings should re-implement.

Reimplemented in ossimGpkgReader, ossimGdalTileSource, ossimH5ImageHandler, ossimHdf5ImageHandler, and ossimPointCloudImageHandler.

Definition at line 1505 of file ossimImageHandler.cpp.

Referenced by getEntryName(), and ossimGdalTileSource::getEntryNames().

1506 {
1507  entryStringList.clear();
1508 }

◆ getExternalImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimImageHandler::getExternalImageGeometry ( ) const
protectedvirtual

Returns the image geometry object associated with this tile source or NULL if non defined.

The geometry contains full-to-local image transform as well as projection (image-to-world).

This method just looks for external .geom style override only. If you want to go through a registry then call getImageGeometry().

Reimplemented in ossimMrSidReader.

Definition at line 726 of file ossimImageHandler.cpp.

References ossimFilename::dirCat(), ossimFilename::exists(), ossimFilename::expand(), ossimFilename::file(), ossimKeywordlist::findKey(), getCurrentEntry(), getFilenameWithThisExt(), getFilenameWithThisExtension(), ossimImageGeometry::loadState(), ossimString::string(), theSupplementaryDirectory, ossimString::toString(), and ossimKeywordNames::TYPE_KW.

Referenced by ossimMrSidReader::getExternalImageGeometry(), ossimViirsHandler::getImageGeometry(), ossimQuickbirdTiffTileSource::getImageGeometry(), ossimQbTileFilesHandler::getImageGeometry(), ossimERSTileSource::getImageGeometry(), ossimGdalTileSource::getImageGeometry(), ossimAdrgTileSource::getImageGeometry(), ossimUsgsDemTileSource::getImageGeometry(), ossimGeneralRasterTileSource::getImageGeometry(), ossimOpjJp2Reader::getImageGeometry(), ossimJpegTileSource::getImageGeometry(), ossimMG4LidarReader::getImageGeometry(), ossimPointCloudImageHandler::getImageGeometry(), ossimGeoPdfReader::getImageGeometry(), ossimH5ImageHandler::getImageGeometry(), ossimLasReader::getImageGeometry(), ossimKakaduJp2Reader::getImageGeometry(), ossimPngReader::getImageGeometry(), ossimGpkgReader::getImageGeometry(), ossimCibCadrgTileSource::getImageGeometry(), and getImageGeometry().

727 {
729  // No geometry object has been set up yet. Check for external geometry file.
730  // Try "foo.geom" if image is "foo.tif":
731  ossimFilename filename;
732  getFilenameWithThisExt( ossimString(".geom"), filename );
733 
734  if(!filename.exists())
735  {
736  // Try "foo_e0.tif" if image is "foo.tif" where "e0" is entry index.
737  filename = getFilenameWithThisExtension(ossimString(".geom"), true);
738  }
739 
740 #if 0
741 /* getgetFilenameWithThisExt... methods tack on sup dir if set. drb */
742  if(!filename.exists())
743  {
744  // Try supplementary data directory for remote geometry:
745  filename = getFilenameWithThisExtension(ossimString(".geom"), false);
746  filename = theSupplementaryDirectory.dirCat(filename.file());
747  }
748  if(!filename.exists())
749  {
750  // Try supplementary data directory for remote geometry with entry index:
751  filename = getFilenameWithThisExtension(ossimString(".geom"), true);
752  filename = theSupplementaryDirectory.dirCat(filename.file());
753  }
754 #endif
755 
756  if(filename.exists())
757  {
758  // Open the geom file as a KWL and initialize our geometry object:
759  filename = filename.expand();
760  ossimKeywordlist geomKwl(filename);
761 
762  // Try loadState with no prefix.
763  std::string prefix = "";
764  std::string key = ossimKeywordNames::TYPE_KW;
765  std::string value = geomKwl.findKey(prefix, key);
766 
767  if ( value.empty() || (value != "ossimImageGeometry") )
768  {
769  // Try with "image0." type prefix.
770  prefix += std::string("image") + ossimString::toString(getCurrentEntry()).string() +
771  std::string(".");
772  value = geomKwl.findKey(prefix, key);
773 
774  if ( value.empty() || (value != "ossimImageGeometry") )
775  {
776  // Try with "image0.geometry." prefix.
777  prefix += std::string( "geometry." );
778  value = geomKwl.findKey(prefix, key);
779 
780  if ( value.empty() || (value != "ossimImageGeometry") )
781  {
782  // Try with "geometry." prefix.
783  prefix = std::string( "geometry." );
784  value = geomKwl.findKey(prefix, key);
785  }
786  }
787  }
788 
789  if ( value == "ossimImageGeometry" )
790  {
791  geom = new ossimImageGeometry;
792  if( !geom->loadState(geomKwl, prefix.c_str()) )
793  {
794  geom = 0;
795  }
796  }
797  }
798 
799  return geom;
800 }
Represents serializable keyword/value map.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Attempts to initialize a transform and a projection given the KWL.
ossimFilename expand() const
Method to do file name expansion.
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * TYPE_KW
ossimFilename theSupplementaryDirectory
bool exists() const
virtual ossim_uint32 getCurrentEntry() const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
void getFilenameWithThisExt(const ossimString &ext, ossimFilename &f) const
Returns the image file with extension set using supplentary directory for dirname if set...
ossimFilename dirCat(const ossimFilename &file) const
ossimFilename file() const
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...
const std::string & string() const
Definition: ossimString.h:414

◆ getFilename()

const ossimFilename & ossimImageHandler::getFilename ( ) const
virtual

◆ getFilenameWithNoExtension()

void ossimImageHandler::getFilenameWithNoExtension ( ossimFilename f) const
protected

Get filename with no extension, using supplentary directory for dirname if set.

Examples:

f = "foo.tif" f = "foo"

Definition at line 1784 of file ossimImageHandler.cpp.

References ossimString::after(), ossimFilename::drive(), ossimFilename::merge(), ossimFilename::setExtension(), ossimString::size(), ossimFilename::split(), and theSupplementaryDirectory.

Referenced by getFilenameWithThisExt(), and getFilenameWithThisExtension().

1785 {
1786  //---
1787  // If the supplementary directory is set, find the extension at that
1788  // location instead of at the default.
1789  //---
1791  {
1792  ossimString drivePart;
1793  ossimString pathPart;
1794  ossimString filePart;
1795  ossimString extPart;
1796 
1797  f.split(drivePart,
1798  pathPart,
1799  filePart,
1800  extPart);
1801 
1803  ossimFilename newPathPart = theSupplementaryDirectory.after(newDrivePart);
1804 
1805  f.merge( newDrivePart, newPathPart, filePart, extPart );
1806  }
1807 
1808  // Wipe out the extension.
1809  f.setExtension("");
1810 }
void split(ossimString &drivePart, ossimString &pathPart, ossimString &filePart, ossimString &extPart) const
ossimFilename theSupplementaryDirectory
std::string::size_type size() const
Definition: ossimString.h:405
void merge(const ossimString &drivePart, const ossimString &pathPart, const ossimString &filePart, const ossimString &extPart)
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
ossimString after(const ossimString &str, std::string::size_type pos=0) const
METHOD: after(str, pos) Returns string immediately after the token str.
ossimFilename drive() const

◆ getFilenameWithThisExt()

void ossimImageHandler::getFilenameWithThisExt ( const ossimString ext,
ossimFilename f 
) const

Returns the image file with extension set using supplentary directory for dirname if set.

This is like the getFilenameWithThisExtension(...) method except it does NOT add the "_en" if image is multi entry.

Examples:

  • theImageFile = "foo.tif"
  • ext parameter = "geom"
  • return of method will = "foo.geom"
Parameters
extExtension to tack onto file. Can have or have not ".", it will be added if "." is not the first character.
fInitialized by this.

Definition at line 1766 of file ossimImageHandler.cpp.

References getFilename(), getFilenameWithNoExtension(), ossimString::size(), and ossimString::string().

Referenced by getExternalImageGeometry(), and ossimLasReader::init().

1768 {
1769  // Get the image file.
1770  f = getFilename();
1771 
1773 
1774  if (ext.size())
1775  {
1776  if (ext.string()[0] != '.')
1777  {
1778  f += ".";
1779  }
1780  f += ext;
1781  }
1782 }
virtual const ossimFilename & getFilename() const
Returns the filename.
std::string::size_type size() const
Definition: ossimString.h:405
void getFilenameWithNoExtension(ossimFilename &f) const
Get filename with no extension, using supplentary directory for dirname if set.
const std::string & string() const
Definition: ossimString.h:414

◆ getFilenameWithThisExtension()

ossimFilename ossimImageHandler::getFilenameWithThisExtension ( const ossimString ext,
bool  set_e0_prefix = false 
) const

Returns the image file with extension set using supplentary directory for dirname if set.

Default behaviour is to add the "_en.ext" only if the file is multi-entry. Use set_e0_prefix to override this.

Examples:

  • theImageFile = "foo.hdf"
  • The number of entries = 1
  • ext parameter = "geom"
  • return of method will = "foo.geom"
  • theImageFile = "foo.hdf"
  • The number of entries = 12
  • The current entry = 3
  • ext parameter = "geom"
  • return of method will = "foo_e3.geom"
Parameters
extExtension to tack onto file. Can have or have not ".", it will be added if "." is not the first character.
set_e0_prefixIf true and the number of entries = 1 then "foo.geom" would come out "foo_e0.geom" instead. Default = false.
Returns
theImageFile with the extension replaced with ext.

Definition at line 1740 of file ossimImageHandler.cpp.

References getCurrentEntry(), getFilename(), getFilenameWithNoExtension(), getNumberOfEntries(), ossimString::size(), ossimString::string(), and ossimString::toString().

Referenced by ossimSingleImageChain::addHistogramRemapper(), ossimSingleImageChain::addImageHandler(), buildHistogram(), buildOverview(), createDefaultGeometryFilename(), createDefaultHistogramFilename(), createDefaultMetadataFilename(), createDefaultOverviewFilename(), getExternalImageGeometry(), getImageHistogram(), ossimImageUtil::getThumbnailFilename(), loadMetaData(), ossimSingleImageChain::openHistogram(), saveImageGeometry(), and ossimOverviewSequencer::writeHistogram().

1743 {
1744  // Get the image file.
1745  ossimFilename f = getFilename();
1746 
1748 
1749  if (set_e0_prefix || (getNumberOfEntries() > 1))
1750  {
1751  f += "_e";
1753  }
1754 
1755  if (ext.size())
1756  {
1757  if (ext.string()[0] != '.')
1758  {
1759  f += ".";
1760  }
1761  f += ext;
1762  }
1763  return f;
1764 }
static ossimString toString(bool aValue)
Numeric to string methods.
virtual const ossimFilename & getFilename() const
Returns the filename.
std::string::size_type size() const
Definition: ossimString.h:405
virtual ossim_uint32 getCurrentEntry() const
virtual ossim_uint32 getNumberOfEntries() const
void getFilenameWithNoExtension(ossimFilename &f) const
Get filename with no extension, using supplentary directory for dirname if set.
const std::string & string() const
Definition: ossimString.h:414

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimImageHandler::getImageGeometry ( )
virtual

Returns the image geometry object associated with this tile source or NULL if non defined.

The geometry contains full-to-local image transform as well as projection (image-to-world).

Reimplemented from ossimImageSource.

Reimplemented in ossimCibCadrgTileSource, ossimGpkgReader, ossimPngReader, ossimImageCacheBase, ossimKakaduJp2Reader, ossimRpfCacheTileSource, ossimLasReader, ossimH5ImageHandler, ossimMrSidReader, ossimGeoPdfReader, ossimPointCloudImageHandler, ossimMG4LidarReader, ossimJpegTileSource, ossimOpjJp2Reader, ossimHdfReader, ossimGeneralRasterTileSource, ossimUsgsDemTileSource, ossimOgrVectorTileSource, ossimAdrgTileSource, ossimKmlSuperOverlayReader, ossimDtedTileSource, ossimGdalTileSource, ossimVpfTileSource, ossimRangeDomeTileSource, ossimBitMaskTileSource, ossimBandSeparateHandler, ossimplugins::ossimTerraSarTiffReader, ossimplugins::ossimRadarSat2TiffReader, ossimKakaduJpipHandler, ossimVideoImageHandler, ossimLandsatTileSource, ossimEnviTileSource, ossimERSTileSource, ossimSrtmTileSource, ossimQbTileFilesHandler, ossimDoqqTileSource, ossimQuickbirdTiffTileSource, ossimViirsHandler, ossimViirsHandler, and ossimQuickbirdNitfTileSource.

Definition at line 685 of file ossimImageHandler.cpp.

References ossimImageGeometryRegistry::extendGeometry(), ossimRefPtr< T >::get(), getExternalImageGeometry(), getInternalImageGeometry(), initImageParameters(), ossimImageGeometryRegistry::instance(), and theGeometry.

Referenced by ossimPointObservation::addMeasurement(), ATP::AtpGenerator::constructChain(), ossimKakaduJpipImageGeometryFactory::extendGeometry(), ossimImageGeometryFactory::extendGeometry(), ossimInfo::getCenterGround(), ossimInfo::getGrd2img(), ossimInfo::getImageBounds(), ossimQuickbirdNitfTileSource::getImageGeometry(), ossimKakaduJpipHandler::getImageGeometry(), ossimInfo::getImageGeometryInfo(), ossimInfo::getImg2grd(), ossimChipperUtil::getIrect(), ossimInfo::getNorthUpAngle(), ossimInfo::getUpIsUpAngle(), ATP::AtpGenerator::getValidVertices(), ossimChipperUtil::hasSensorModelInput(), ossimImageProjectionModel::initialize(), ossimTiledElevationDatabase::initializeReferenceProjection(), ossimEquationUtil::initInputSources(), main(), ossimChipProcTool::newIdentityProjection(), ossimGeoidImage::open(), ossimImageElevationHandler::open(), ossimImageGeometry::open(), ossimTilingPoly::parseShpFile(), ossimRpcSolver::solve(), and ossimIvtGeomXformVisitor::visit().

686 {
687  if ( !theGeometry )
688  {
689  //---
690  // Check factory for external geom:
691  //---
693 
694  if ( !theGeometry )
695  {
696  //---
697  // WARNING:
698  // Must create/set the geometry at this point or the next call to
699  // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
700  // as it does a recursive call back to ossimImageHandler::getImageGeometry().
701  //---
704 
705  //---
706  // And finally allow factories to extend the internal geometry.
707  // This allows plugins for tagged formats with tags not know in the base
708  // to extend the internal geometry.
709  //
710  // Plugins can do handler->getImageGeometry() then modify/extend.
711  //---
713  {
714  //---
715  // Check for internal, for geotiff, nitf and so on as last resort for getting some
716  // kind of geometry loaded
717  //---
720  }
721  }
722  }
723  return theGeometry;
724 }
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
virtual bool extendGeometry(ossimImageHandler *handler) const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...

◆ getImageHistogram()

ossimRefPtr< ossimMultiResLevelHistogram > ossimImageHandler::getImageHistogram ( ) const

Fetches the current entry image's histogram.

Returns
Ref pointer to histogram or null if histogram does not exist.
Note
Old behaviour: "If none exists, it will be created." taken out.

Do: ossimRefPtr<ossimMultiResLevelHistogram> his = ih->getImageHistogram(); if ( ih.valid() ) { } else { ih->buildHistogram(); }

Definition at line 670 of file ossimImageHandler.cpp.

References getFilenameWithThisExtension(), ossimMultiResLevelHistogram::importHistogram(), and isOpen().

Referenced by ossimShorelineTool::autoComputeThreshold(), ATP::AtpGenerator::constructChain(), and ossimBandMergeTool::initHistogramStretch().

671 {
673  if ( isOpen() )
674  {
676  histogram = new ossimMultiResLevelHistogram();
677  if ( histogram->importHistogram(histoFile) == false )
678  {
679  histogram = 0;
680  }
681  }
682  return histogram;
683 }
virtual bool importHistogram(const ossimFilename &inputFile)
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ getImageID()

const ossimString& ossimImageHandler::getImageID ( ) const
inline

Fetches the image ID.

This is initialized to -1 in the constructor but is searched for in loadState():

Definition at line 715 of file ossimImageHandler.h.

Referenced by ATP::AtpGenerator::constructChain(), ATP::AtpGenerator::getCmpImageID(), and ATP::AtpGenerator::getRefImageID().

715 { return theImageID; }

◆ getImageRectangle()

ossimIrect ossimImageHandler::getImageRectangle ( ossim_uint32  resLevel = 0) const
virtual

Returns zero-based bounding rectangle of the image.

Note sub-image offset now in ossimImageGeometry class.

Parameters
resLevelReduced resolution level for rectangle.
Returns
Rectangle of reduced resolution level.

Reimplemented in ossimCibCadrgTileSource, ossimRpfCacheTileSource, ossimOgrGdalTileSource, ossimAdrgTileSource, ossimOgrVectorTileSource, ossimDtedTileSource, ossimH5ImageHandler, ossimOpjJp2Reader, ossimPngReader, ossimCcfTileSource, ossimGdalTileSource, ossimTiledImageHandler, ossimHdf5ImageHandler, ossimGpkgReader, ossimJpegTileSource, ossimUsgsDemTileSource, ossimKmlSuperOverlayReader, ossimVpfTileSource, and ossimImageCacheBase.

Definition at line 388 of file ossimImageHandler.cpp.

References getNumberOfLines(), getNumberOfSamples(), isOpen(), isValidRLevel(), and ossimIrect::makeNan().

Referenced by getBoundingRect(), ossimGdalTileSource::getImageRectangle(), ossimGeoPdfReader::getIntersectingEntries(), ossimChipperUtil::getIrect(), ossimHdfReader::getTile(), ossimBitMaskTileSource::getTile(), ossimTiffTileSource::getTile(), ossimGeoPdfReader::getTile(), ossimGdalDataset::init(), ossimOverviewSequencer::initialize(), ossimTiffTileSource::loadFromScanLine(), ossimGeoidImage::open(), and ossimQuickbirdRpcModel::parseTiffFile().

389 {
390  ossimIrect result;
391 
392  if( isOpen() && isValidRLevel(resLevel) )
393  {
394  ossim_int32 lines = getNumberOfLines(resLevel);
395  ossim_int32 samples = getNumberOfSamples(resLevel);
396  if( !lines || !samples )
397  {
398  result.makeNan();
399  }
400  else
401  {
402  result = ossimIrect(0, 0, samples-1, lines-1);
403  }
404  }
405  else
406  {
407  result.makeNan();
408  }
409 
410  return result;
411 }
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
void makeNan()
Definition: ossimIrect.h:329
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
int ossim_int32

◆ getImageTileHeight()

virtual ossim_uint32 ossimImageHandler::getImageTileHeight ( ) const
pure virtual

◆ getImageTileWidth()

virtual ossim_uint32 ossimImageHandler::getImageTileWidth ( ) const
pure virtual

◆ getInternalImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimImageHandler::getInternalImageGeometry ( ) const
protectedvirtual

Reimplemented in ossimMrSidReader, ossimGeoPdfReader, ossimMG4LidarReader, ossimJpegTileSource, ossimUsgsDemTileSource, ossimGdalTileSource, ossimOgrGdalTileSource, ossimOgrVectorTileSource, ossimKmlSuperOverlayReader, ossimEnviTileSource, ossimplugins::ossimTerraSarTiffReader, and ossimplugins::ossimRadarSat2TiffReader.

Definition at line 802 of file ossimImageHandler.cpp.

Referenced by getImageGeometry().

803 {
804  // Default, derived classes should override.
806  return geom;
807 }
Container class that holds both 2D transform and 3D projection information for an image Only one inst...

◆ getLut()

ossimRefPtr< ossimNBandLutDataObject > ossimImageHandler::getLut ( ) const
virtual

Definition at line 1829 of file ossimImageHandler.cpp.

References theLut.

Referenced by ossimGdalWriter::checkColorLut(), ossimTiffWriter::checkColorLut(), and ossimInfo::getImagePalette().

1830 {
1831  return theLut;
1832 }
ossimRefPtr< ossimNBandLutDataObject > theLut

◆ getMaxPixelValue()

double ossimImageHandler::getMaxPixelValue ( ossim_uint32  band = 0) const
virtual

Returns the max pixel of the band.

Reimplemented from ossimImageSource.

Reimplemented in ossimNitfTileSource, ossimGdalTileSource, ossimLasReader, ossimTiffTileSource, ossimPointCloudImageHandler, ossimHdf5ImageHandler, ossimPngReader, ossimOgrVectorTileSource, ossimOgrGdalTileSource, ossimKakaduNitfReader, ossimGeneralRasterTileSource, ossimOpjJp2Reader, ossimVpfTileSource, ossimImageCacheTileSource, ossimDtedTileSource, ossimBitMaskTileSource, ossimUsgsDemTileSource, ossimImageHandlerMtAdaptor, and ossimLandsatTileSource.

Definition at line 1424 of file ossimImageHandler.cpp.

References ossim::defaultMax(), ossimImageMetaData::getMaxPix(), ossimImageMetaData::getNumberOfBands(), ossimImageSource::getOutputScalarType(), and theMetaData.

Referenced by ossimInfo::getImageInfo(), ossimImageHandlerMtAdaptor::getMaxPixelValue(), ossimImageCacheTileSource::getMaxPixelValue(), ossimKakaduNitfReader::getMaxPixelValue(), ossimHdf5ImageHandler::getMaxPixelValue(), ossimTiffTileSource::getMaxPixelValue(), ossimGdalTileSource::getMaxPixelValue(), and ossimNitfTileSource::getMaxPixelValue().

1425 {
1427  {
1428  return theMetaData.getMaxPix(band);
1429  }
1431 }
double getMaxPix(ossim_uint32 band) const
ossim_uint32 getNumberOfBands() const
ossimImageMetaData theMetaData
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.

◆ getMinPixelValue()

double ossimImageHandler::getMinPixelValue ( ossim_uint32  band = 0) const
virtual

Retuns the min pixel value.

If there was an external eta data file then use the meta data from that file. If not given then we will return the default min

Reimplemented from ossimImageSource.

Reimplemented in ossimNitfTileSource, ossimGdalTileSource, ossimTiffTileSource, ossimLasReader, ossimHdf5ImageHandler, ossimPointCloudImageHandler, ossimOgrVectorTileSource, ossimOgrGdalTileSource, ossimKakaduNitfReader, ossimGeneralRasterTileSource, ossimVpfTileSource, ossimImageCacheTileSource, ossimDtedTileSource, ossimBitMaskTileSource, ossimUsgsDemTileSource, ossimImageHandlerMtAdaptor, and ossimLandsatTileSource.

Definition at line 1415 of file ossimImageHandler.cpp.

References ossim::defaultMin(), ossimImageMetaData::getMinPix(), ossimImageMetaData::getNumberOfBands(), ossimImageSource::getOutputScalarType(), and theMetaData.

Referenced by ossimInfo::getImageInfo(), ossimImageHandlerMtAdaptor::getMinPixelValue(), ossimImageCacheTileSource::getMinPixelValue(), ossimKakaduNitfReader::getMinPixelValue(), ossimHdf5ImageHandler::getMinPixelValue(), ossimTiffTileSource::getMinPixelValue(), ossimGdalTileSource::getMinPixelValue(), and ossimNitfTileSource::getMinPixelValue().

1416 {
1418  {
1419  return theMetaData.getMinPix(band);
1420  }
1422 }
double getMinPix(ossim_uint32 band) const
ossim_uint32 getNumberOfBands() const
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
ossimImageMetaData theMetaData
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.

◆ getNullPixelValue()

double ossimImageHandler::getNullPixelValue ( ossim_uint32  band = 0) const
virtual

Each band has a null pixel associated with it.

The null pixel represents an invalid value.

Reimplemented from ossimImageSource.

Reimplemented in ossimNitfTileSource, ossimGdalTileSource, ossimLasReader, ossimTiffTileSource, ossimH5ImageHandler, ossimPointCloudImageHandler, ossimHdf5ImageHandler, ossimOgrVectorTileSource, ossimOgrGdalTileSource, ossimKakaduNitfReader, ossimGeneralRasterTileSource, ossimVpfTileSource, ossimImageCacheTileSource, ossimDtedTileSource, ossimBitMaskTileSource, ossimUsgsDemTileSource, ossimImageHandlerMtAdaptor, ossimLandsatTileSource, ossimViirsHandler, and ossimViirsHandler.

Definition at line 1433 of file ossimImageHandler.cpp.

References ossim::defaultNull(), ossimImageMetaData::getNullPix(), ossimImageMetaData::getNumberOfBands(), ossimImageSource::getOutputScalarType(), and theMetaData.

Referenced by ossimInfo::getImageInfo(), ossimImageHandlerMtAdaptor::getNullPixelValue(), ossimImageCacheTileSource::getNullPixelValue(), ossimKakaduNitfReader::getNullPixelValue(), ossimHdf5ImageHandler::getNullPixelValue(), ossimH5ImageHandler::getNullPixelValue(), ossimTiffTileSource::getNullPixelValue(), ossimGdalTileSource::getNullPixelValue(), ossimNitfTileSource::getNullPixelValue(), and ossimRangeDomeTileSource::getTile().

1434 {
1436  {
1437  return theMetaData.getNullPix(band);
1438  }
1439 
1441 }
double getNullPix(ossim_uint32 band) const
ossim_uint32 getNumberOfBands() const
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
ossimImageMetaData theMetaData
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.

◆ getNumberOfDecimationLevels()

ossim_uint32 ossimImageHandler::getNumberOfDecimationLevels ( ) const
virtual

This returns the total number of decimation levels.

It is important to note that res level 0 or full resolution is included in the list and has decimation values 1.0, 1.0

Reimplemented from ossimImageSource.

Reimplemented in ossimLasReader, ossimGpkgReader, ossimPointCloudImageHandler, ossimTiffTileSource, ossimKakaduJ2kReader, ossimKakaduJp2Reader, ossimMrSidReader, ossimMG4LidarReader, ossimOgrGdalTileSource, ossimOgrVectorTileSource, ossimBitMaskTileSource, ossimCcfTileSource, ossimGdalTileSource, ossimOpjJp2Reader, ossimKakaduNitfReader, ossimVpfTileSource, ossimImageHandlerMtAdaptor, and ossimKakaduJpipHandler.

Definition at line 373 of file ossimImageHandler.cpp.

References getNumberOfDecimationLevels(), theOverview, and ossimRefPtr< T >::valid().

Referenced by buildHistogram(), establishDecimationFactors(), ossimAdrgTileSource::getImageGeometry(), ossimInfo::getImageInfo(), ossimKakaduJpipHandler::getNumberOfDecimationLevels(), ossimImageHandlerMtAdaptor::getNumberOfDecimationLevels(), ossimKakaduNitfReader::getNumberOfDecimationLevels(), ossimOpjJp2Reader::getNumberOfDecimationLevels(), ossimGdalTileSource::getNumberOfDecimationLevels(), ossimMG4LidarReader::getNumberOfDecimationLevels(), ossimMrSidReader::getNumberOfDecimationLevels(), ossimKakaduJp2Reader::getNumberOfDecimationLevels(), ossimKakaduJ2kReader::getNumberOfDecimationLevels(), ossimTiffTileSource::getNumberOfDecimationLevels(), ossimGpkgReader::getNumberOfDecimationLevels(), getNumberOfDecimationLevels(), getNumberOfReducedResSets(), getProperty(), hasOverviews(), ossimImageUtil::hasRequiredOverview(), initImageParameters(), ossimJpegTileSource::isValidRLevel(), isValidRLevel(), main(), and ossimBitMaskTileSource::open().

374 {
375  ossim_uint32 result = 1; // Add r0
376  if (theOverview.valid())
377  {
379  }
380  return result;
381 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview

◆ getNumberOfEntries()

ossim_uint32 ossimImageHandler::getNumberOfEntries ( ) const
virtual
Returns
The number of entries (images) in the image file.

Reimplemented in ossimGeoPdfReader, ossimNitfTileSource, ossimGpkgReader, ossimOgrVectorTileSource, ossimHdfReader, ossimH5ImageHandler, ossimHdf5ImageHandler, and ossimVideoImageHandler.

Definition at line 1497 of file ossimImageHandler.cpp.

References getEntryList().

Referenced by createDefaultValidVerticesFilename(), getFilenameWithThisExtension(), ossimInfo::getImagePalette(), ossimKakaduNitfOverviewBuilder::getOutputFile(), and openValidVertices().

1498 {
1499  std::vector<ossim_uint32> tempList;
1500  getEntryList(tempList);
1501 
1502  return (ossim_uint32)tempList.size();
1503 }
unsigned int ossim_uint32
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const

◆ getNumberOfLines()

virtual ossim_uint32 ossimImageHandler::getNumberOfLines ( ossim_uint32  resLevel = 0) const
pure virtual

Pure virtual, derived classes must implement.

Parameters
resLevelReduced resolution level to return lines of. Default = 0
Returns
The number of lines for specified reduced resolution level.

Implemented in ossimKakaduJ2kReader, ossimKakaduJp2Reader, ossimMrSidReader, ossimGeoPdfReader, ossimMG4LidarReader, ossimCibCadrgTileSource, ossimTiffTileSource, ossimNitfTileSource, ossimHdfReader, ossimLasReader, ossimRpfCacheTileSource, ossimPointCloudImageHandler, ossimKakaduNitfReader, ossimAdrgTileSource, ossimH5ImageHandler, ossimOpjJp2Reader, ossimPngReader, ossimRangeDomeTileSource, ossimDtedTileSource, ossimOgrGdalTileSource, ossimHdf5ImageHandler, ossimOgrVectorTileSource, ossimGpkgReader, ossimGdalTileSource, ossimCcfTileSource, ossimJpegTileSource, ossimGeneralRasterTileSource, ossimKmlSuperOverlayReader, ossimBitMaskTileSource, ossimUsgsDemTileSource, ossimVpfTileSource, ossimTiledImageHandler, ossimImageHandlerMtAdaptor, ossimBandSeparateHandler, ossimKakaduJpipHandler, ossimImageCacheBase, and ossimVideoImageHandler.

Referenced by establishDecimationFactors(), ossimKakaduJ2kReader::getDecimationFactor(), getImageRectangle(), ossimVideoImageHandler::getImageTileHeight(), ossimKakaduJpipHandler::getNumberOfLines(), ossimImageHandlerMtAdaptor::getNumberOfLines(), ossimUsgsDemTileSource::getNumberOfLines(), ossimJpegTileSource::getNumberOfLines(), ossimGdalTileSource::getNumberOfLines(), ossimGpkgReader::getNumberOfLines(), ossimHdf5ImageHandler::getNumberOfLines(), ossimDtedTileSource::getNumberOfLines(), ossimH5ImageHandler::getNumberOfLines(), ossimOpjJp2Reader::getNumberOfLines(), ossimPngReader::getNumberOfLines(), ossimAdrgTileSource::getNumberOfLines(), ossimKakaduNitfReader::getNumberOfLines(), ossimRpfCacheTileSource::getNumberOfLines(), ossimNitfTileSource::getNumberOfLines(), ossimCibCadrgTileSource::getNumberOfLines(), ossimTiffTileSource::getNumberOfLines(), ossimGeoPdfReader::getNumberOfLines(), ossimKakaduJp2Reader::getNumberOfLines(), ossimGdalTileSource::getNumberOfSamples(), ossimOpjJp2Reader::getNumberOfSamples(), getProperty(), ossimOverviewBuilderBase::getRequiredResLevels(), ossimImageElevationHandler::getSizeOfElevCell(), ossimImageUtil::hasRequiredOverview(), ossimImageModel::initialize(), and ossimImageElevationHandler::open().

◆ getNumberOfReducedResSets()

ossim_uint32 ossimImageHandler::getNumberOfReducedResSets ( ) const
virtual

This method is obsolete.

Please use getNumberOfDecimationLevels.

For backwards compatibility this calls getNumberOfDecimationLevels.

Definition at line 383 of file ossimImageHandler.cpp.

References getNumberOfDecimationLevels().

384 {
386 }
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.

◆ getNumberOfSamples()

virtual ossim_uint32 ossimImageHandler::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
pure virtual

Pure virtual, derived classes must implement.

Parameters
resLevelReduced resolution level to return samples of. Default = 0
Returns
The number of samples for specified reduced resolution level.

Implemented in ossimKakaduJ2kReader, ossimKakaduJp2Reader, ossimMrSidReader, ossimGeoPdfReader, ossimMG4LidarReader, ossimCibCadrgTileSource, ossimTiffTileSource, ossimLasReader, ossimHdfReader, ossimNitfTileSource, ossimRpfCacheTileSource, ossimPointCloudImageHandler, ossimKakaduNitfReader, ossimAdrgTileSource, ossimH5ImageHandler, ossimOpjJp2Reader, ossimPngReader, ossimDtedTileSource, ossimOgrGdalTileSource, ossimHdf5ImageHandler, ossimRangeDomeTileSource, ossimOgrVectorTileSource, ossimGpkgReader, ossimGdalTileSource, ossimCcfTileSource, ossimJpegTileSource, ossimGeneralRasterTileSource, ossimKmlSuperOverlayReader, ossimUsgsDemTileSource, ossimBitMaskTileSource, ossimVpfTileSource, ossimTiledImageHandler, ossimImageHandlerMtAdaptor, ossimBandSeparateHandler, ossimImageCacheBase, ossimKakaduJpipHandler, and ossimVideoImageHandler.

Referenced by establishDecimationFactors(), ossimKakaduJ2kReader::getDecimationFactor(), getImageRectangle(), ossimVideoImageHandler::getImageTileWidth(), ossimHdfReader::getNumberOfLines(), ossimMG4LidarReader::getNumberOfLines(), ossimMrSidReader::getNumberOfLines(), ossimKakaduJpipHandler::getNumberOfSamples(), ossimImageHandlerMtAdaptor::getNumberOfSamples(), ossimUsgsDemTileSource::getNumberOfSamples(), ossimJpegTileSource::getNumberOfSamples(), ossimGpkgReader::getNumberOfSamples(), ossimHdf5ImageHandler::getNumberOfSamples(), ossimDtedTileSource::getNumberOfSamples(), ossimPngReader::getNumberOfSamples(), ossimH5ImageHandler::getNumberOfSamples(), ossimAdrgTileSource::getNumberOfSamples(), ossimKakaduNitfReader::getNumberOfSamples(), ossimRpfCacheTileSource::getNumberOfSamples(), ossimNitfTileSource::getNumberOfSamples(), ossimHdfReader::getNumberOfSamples(), ossimTiffTileSource::getNumberOfSamples(), ossimCibCadrgTileSource::getNumberOfSamples(), ossimMG4LidarReader::getNumberOfSamples(), ossimGeoPdfReader::getNumberOfSamples(), ossimMrSidReader::getNumberOfSamples(), ossimKakaduJp2Reader::getNumberOfSamples(), getProperty(), ossimOverviewBuilderBase::getRequiredResLevels(), ossimImageElevationHandler::getSizeOfElevCell(), ossimImageUtil::hasRequiredOverview(), ossimImageModel::initialize(), and ossimImageElevationHandler::open().

◆ getOpenOverviewFlag()

bool ossimImageHandler::getOpenOverviewFlag ( ) const
Returns
theOpenOverviewFlag

Definition at line 1886 of file ossimImageHandler.cpp.

References theOpenOverviewFlag.

1887 {
1888  return theOpenOverviewFlag;
1889 }
bool theOpenOverviewFlag
If true opening of overviews will be attempted.

◆ getOverview()

const ossimImageHandler * ossimImageHandler::getOverview ( ) const
virtual
Returns
the image handler of the overview, if it has been successfully opened.

Definition at line 835 of file ossimImageHandler.cpp.

References ossimRefPtr< T >::get(), and theOverview.

Referenced by ossimSingleImageChain::addImageHandler(), ossimInfo::getImageInfo(), and ossimImageHandlerFactory::openSrcRecord().

836 {
837  return theOverview.get();
838 }
ossimRefPtr< ossimImageHandler > theOverview

◆ getOverviewFile()

ossimFilename ossimImageHandler::getOverviewFile ( ) const

Definition at line 1471 of file ossimImageHandler.cpp.

References theOverviewFile.

1472 {
1473  return theOverviewFile;
1474 }
ossimFilename theOverviewFile

◆ getOverviewTile()

bool ossimImageHandler::getOverviewTile ( ossim_uint32  resLevel,
ossimImageData result 
)
protectedvirtual

Method to get an overview tile.

Derived classes should override if they have built in overviews or something different than the standard external overview file. Image handlers can call this method from getTile in place of inlining code or if derived class needs to override this method.

Parameters
resLevelThe resolution level to pull from with resLevel 0 being full res.
resultThe tile to stuff. passing.
Returns
true on success false on error. Typically this will return false if resLevel==0 unless the overview has r0. If return is false, result is undefined so caller should handle appropriately with makeBlank or whatever.

Reimplemented in ossimKakaduJp2Reader, ossimKakaduJ2kReader, ossimOpjJp2Reader, and ossimKakaduNitfReader.

Definition at line 1812 of file ossimImageHandler.cpp.

References ossimImageData::getNumberOfBands(), ossimImageSource::getNumberOfOutputBands(), ossimImageSource::getTile(), isValidRLevel(), status, theOverview, and ossimRefPtr< T >::valid().

Referenced by ossimKakaduNitfReader::getOverviewTile(), ossimUsgsDemTileSource::getTile(), ossimJpegTileSource::getTile(), ossimGpkgReader::getTile(), ossimHdf5ImageHandler::getTile(), ossimCcfTileSource::getTile(), ossimHdfReader::getTile(), ossimDtedTileSource::getTile(), ossimPngReader::getTile(), ossimH5ImageHandler::getTile(), ossimAdrgTileSource::getTile(), ossimTiffTileSource::getTile(), ossimGeoPdfReader::getTile(), ossimRpfCacheTileSource::getTile(), ossimNitfTileSource::getTile(), ossimCibCadrgTileSource::getTile(), and ossimKakaduJpipHandler::getTileAtRes().

1814 {
1815  bool status = false;
1816 
1817  if (theOverview.valid())
1818  {
1819  if (theOverview->isValidRLevel(resLevel) && result &&
1820  (result->getNumberOfBands() == getNumberOfOutputBands()) )
1821  {
1822  status = theOverview->getTile(result, resLevel);
1823  }
1824  }
1825 
1826  return status;
1827 }
virtual ossim_uint32 getNumberOfBands() const
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
return status
ossimRefPtr< ossimImageHandler > theOverview
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ getPixelType()

ossimPixelType ossimImageHandler::getPixelType ( ) const
inline

Returns the raster pixel alignment type.

OSSIM treats all alignments internally as pixel-is-point. This is only a flag to identify the source's alignment type.

Definition at line 722 of file ossimImageHandler.h.

722 { return thePixelType; }
ossimPixelType thePixelType

◆ getProperty()

ossimRefPtr< ossimProperty > ossimImageHandler::getProperty ( const ossimString name) const
virtual

Reimplemented from ossimImageSource.

Reimplemented in ossimCibCadrgTileSource, ossimRpfCacheTileSource, ossimLasReader, ossimTiffTileSource, ossimGdalTileSource, ossimPointCloudImageHandler, ossimH5ImageHandler, ossimNitfTileSource, ossimHdf5ImageHandler, ossimOgrGdalTileSource, ossimDtedTileSource, ossimAdrgTileSource, ossimCcfTileSource, ossimJpegTileSource, ossimPngReader, ossimGpkgReader, ossimRangeDomeTileSource, ossimEnviTileSource, ossimLandsatTileSource, ossimKakaduJpipHandler, ossimSrtmTileSource, and ossimDoqqTileSource.

Definition at line 1601 of file ossimImageHandler.cpp.

References ossimStringProperty::addConstraint(), createDefaultGeometryFilename(), createDefaultHistogramFilename(), createDefaultMetadataFilename(), createDefaultOverviewFilename(), createDefaultValidVerticesFilename(), ossimKeywordNames::ENTRY_KW, getCurrentEntry(), getEntryList(), getFilename(), getNumberOfDecimationLevels(), ossimImageSource::getNumberOfInputBands(), getNumberOfLines(), getNumberOfSamples(), ossimImageSource::getOutputScalarType(), ossimScalarTypeLut::instance(), ossimKeywordNames::NUMBER_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT, ossimKeywordNames::SCALAR_TYPE_KW, ossimProperty::setCacheRefreshBit(), ossimStringProperty::setEditableFlag(), ossimProperty::setFullRefreshBit(), ossimFilenameProperty::setIoType(), ossimProperty::setReadOnlyFlag(), and ossimString::toString().

Referenced by ossimHistogramMatchFilter::autoLoadInputHistogram(), ossimDoqqTileSource::getProperty(), ossimRangeDomeTileSource::getProperty(), ossimGpkgReader::getProperty(), ossimJpegTileSource::getProperty(), ossimCcfTileSource::getProperty(), ossimAdrgTileSource::getProperty(), ossimDtedTileSource::getProperty(), ossimNitfTileSource::getProperty(), ossimTiffTileSource::getProperty(), ossimRpfCacheTileSource::getProperty(), ossimCibCadrgTileSource::getProperty(), ossimInfo::isImageEntryOverview(), and ossimImageHandlerRegistry::printReaderProps().

1602 {
1603 
1604  if(name == ossimKeywordNames::ENTRY_KW)
1605  {
1606  std::vector<ossim_uint32> entryList;
1607  getEntryList(entryList);
1608 
1609  ossimStringProperty* stringProperty = new ossimStringProperty(name,
1611  ossim_uint32 idx = 0;
1612  for(idx = 0; idx < entryList.size(); ++idx)
1613  {
1614  stringProperty->addConstraint(ossimString::toString(entryList[idx]));
1615  }
1616  stringProperty->setFullRefreshBit();
1617  stringProperty->setEditableFlag(false);
1618 
1619  return stringProperty;
1620  }
1621  else if(name == ossimKeywordNames::NUMBER_SAMPLES_KW)
1622  {
1624  prop->setReadOnlyFlag(true);
1625 
1626  return prop;
1627  }
1628  else if(name == ossimKeywordNames::NUMBER_LINES_KW)
1629  {
1631  prop->setReadOnlyFlag(true);
1632 
1633  return prop;
1634  }
1635  else if(name == ossimKeywordNames::NUMBER_BANDS_KW)
1636  {
1638  prop->setReadOnlyFlag(true);
1639 
1640  return prop;
1641  }
1643  {
1645  prop->setReadOnlyFlag(true);
1646 
1647  return prop;
1648  }
1649  else if(name == ossimKeywordNames::SCALAR_TYPE_KW)
1650  {
1652  prop->setReadOnlyFlag(true);
1653 
1654  return prop;
1655  }
1656  else if(name == "histogram_filename")
1657  {
1658  ossimFilenameProperty* filenameProp =
1660 
1662  filenameProp->setCacheRefreshBit();
1663 
1664  return filenameProp;
1665 
1666  }
1667  else if(name == "geometry_filename")
1668  {
1669  ossimFilenameProperty* filenameProp =
1671 
1673  filenameProp->setCacheRefreshBit();
1674 
1675  return filenameProp;
1676 
1677  }
1678  else if(name == "valid_vertices_filename")
1679  {
1680  ossimFilenameProperty* filenameProp =
1682 
1684  filenameProp->setCacheRefreshBit();
1685 
1686  return filenameProp;
1687  }
1688  else if(name == "metadata_filename")
1689  {
1690  ossimFilenameProperty* filenameProp =
1692 
1694  filenameProp->setCacheRefreshBit();
1695 
1696  return filenameProp;
1697  }
1698  else if(name == "overview_filename")
1699  {
1700  ossimFilenameProperty* filenameProp =
1702 
1704  filenameProp->setCacheRefreshBit();
1705 
1706  return filenameProp;
1707  }
1708  else if(name == "filename")
1709  {
1710  ossimFilenameProperty* filenameProp =
1711  new ossimFilenameProperty(name, getFilename());
1712 
1714  filenameProp->setFullRefreshBit();
1715 
1716  return filenameProp;
1717  }
1718  else if ( name == OPEN_OVERVIEW_FLAG_KW)
1719  {
1721  new ossimBooleanProperty(ossimString(OPEN_OVERVIEW_FLAG_KW), theOpenOverviewFlag);
1722  return result;
1723  }
1724 
1725  return ossimImageSource::getProperty(name);
1726 }
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * NUMBER_LINES_KW
bool theOpenOverviewFlag
If true opening of overviews will be attempted.
virtual ossimFilename createDefaultOverviewFilename() const
virtual void setReadOnlyFlag(bool flag)
void addConstraint(const ossimString &value)
void setFullRefreshBit()
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
virtual ossimFilename createDefaultValidVerticesFilename() const
virtual const ossimFilename & getFilename() const
Returns the filename.
unsigned int ossim_uint32
virtual ossim_uint32 getCurrentEntry() const
static const char * NUMBER_BANDS_KW
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
static const char * ENTRY_KW
virtual ossimFilename createDefaultGeometryFilename() const
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
void setIoType(ossimFilenamePropertyIoType ioType)
void setEditableFlag(bool flag)
static const char * SCALAR_TYPE_KW
virtual ossimFilename createDefaultMetadataFilename() const
virtual ossimFilename createDefaultHistogramFilename() const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
static const char * NUMBER_REDUCED_RES_SETS_KW
virtual ossim_uint32 getNumberOfInputBands() const =0
static const char * NUMBER_SAMPLES_KW
void setCacheRefreshBit()

◆ getPropertyNames()

void ossimImageHandler::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual

Reimplemented from ossimImageSource.

Reimplemented in ossimCibCadrgTileSource, ossimLasReader, ossimGdalTileSource, ossimTiffTileSource, ossimH5ImageHandler, ossimHdf5ImageHandler, ossimNitfTileSource, ossimOgrGdalTileSource, ossimDtedTileSource, ossimAdrgTileSource, ossimCcfTileSource, ossimJpegTileSource, ossimPngReader, ossimGpkgReader, ossimEnviTileSource, ossimLandsatTileSource, ossimSrtmTileSource, ossimKakaduJpipHandler, and ossimDoqqTileSource.

Definition at line 1728 of file ossimImageHandler.cpp.

References ossimKeywordNames::ENTRY_KW, ossimImageSource::getPropertyNames(), ossimKeywordNames::NUMBER_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, and ossimKeywordNames::SCALAR_TYPE_KW.

Referenced by ossimDoqqTileSource::getPropertyNames(), ossimKakaduJpipHandler::getPropertyNames(), ossimGpkgReader::getPropertyNames(), ossimJpegTileSource::getPropertyNames(), ossimCcfTileSource::getPropertyNames(), ossimAdrgTileSource::getPropertyNames(), ossimDtedTileSource::getPropertyNames(), ossimNitfTileSource::getPropertyNames(), ossimHdf5ImageHandler::getPropertyNames(), ossimH5ImageHandler::getPropertyNames(), ossimTiffTileSource::getPropertyNames(), ossimCibCadrgTileSource::getPropertyNames(), and ossimImageHandlerRegistry::printReaderProps().

1729 {
1730  ossimImageSource::getPropertyNames(propertyNames);
1731  propertyNames.push_back(ossimKeywordNames::ENTRY_KW);
1732  propertyNames.push_back(ossimKeywordNames::NUMBER_SAMPLES_KW);
1733  propertyNames.push_back(ossimKeywordNames::NUMBER_LINES_KW);
1734  propertyNames.push_back(ossimKeywordNames::NUMBER_BANDS_KW);
1735  propertyNames.push_back(ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW);
1736  propertyNames.push_back(ossimKeywordNames::SCALAR_TYPE_KW);
1737  propertyNames.push_back(OPEN_OVERVIEW_FLAG_KW);
1738 }
static const char * NUMBER_LINES_KW
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
static const char * NUMBER_BANDS_KW
static const char * ENTRY_KW
static const char * SCALAR_TYPE_KW
static const char * NUMBER_REDUCED_RES_SETS_KW
static const char * NUMBER_SAMPLES_KW

◆ getRgbBandList()

bool ossimImageHandler::getRgbBandList ( std::vector< ossim_uint32 > &  bandList) const
virtual

Convenience method to get the zero based rgb output band list.

This method returns false and is here only so derived classes can override.

Parameters
bandList
Returns
false

Reimplemented in ossimNitfTileSource, and ossimEnviTileSource.

Definition at line 1283 of file ossimImageHandler.cpp.

References ossimImageMetaData::getRgbBands(), and theMetaData.

Referenced by ossimBandSelector::getRgbBandList(), ossimInfo::getRgbBands(), and ossimSingleImageChain::setToThreeBands().

1284 {
1285  // Looks for "rgb_bands" key in dot omd file. E.g. "rgb_bands: (2,1,0)"
1286  return theMetaData.getRgbBands( bandList );
1287 }
ossimImageMetaData theMetaData
const std::string & getRgbBands() const

◆ getStartingResLevel()

ossim_uint32 ossimImageHandler::getStartingResLevel ( ) const

Definition at line 1876 of file ossimImageHandler.cpp.

References theStartingResLevel.

1877 {
1878  return theStartingResLevel;
1879 }
ossim_uint32 theStartingResLevel
theStartingResLevel If set to something other than zero(default) this is indicative that the reader i...

◆ getState() [1/2]

std::shared_ptr<ossim::ImageHandlerState> ossimImageHandler::getState ( )
inline

Definition at line 740 of file ossimImageHandler.h.

Referenced by ossimImageHandlerRegistry::addToStateCache(), and ossimTiffProjectionFactory::createProjection().

740 {return m_state;}
std::shared_ptr< ossim::ImageHandlerState > m_state

◆ getState() [2/2]

std::shared_ptr<const ossim::ImageHandlerState> ossimImageHandler::getState ( ) const
inline

Definition at line 741 of file ossimImageHandler.h.

741 {return m_state;}
std::shared_ptr< ossim::ImageHandlerState > m_state

◆ getStateAs() [1/2]

template<class T >
std::shared_ptr<T> ossimImageHandler::getStateAs ( )
inline

Definition at line 737 of file ossimImageHandler.h.

737 {return dynamic_pointer_cast<T> (m_state);}
std::shared_ptr< ossim::ImageHandlerState > m_state

◆ getStateAs() [2/2]

template<class T >
std::shared_ptr<const T> ossimImageHandler::getStateAs ( ) const
inline

Definition at line 739 of file ossimImageHandler.h.

739 {return dynamic_pointer_cast<const T> (m_state);}
std::shared_ptr< ossim::ImageHandlerState > m_state

◆ getSupplementaryDirectory()

const ossimFilename & ossimImageHandler::getSupplementaryDirectory ( ) const
virtual

Returns the supplementary directory.

Definition at line 1577 of file ossimImageHandler.cpp.

References theSupplementaryDirectory.

1578 {
1580 }
ossimFilename theSupplementaryDirectory

◆ getValidImageVertices()

void ossimImageHandler::getValidImageVertices ( vector< ossimIpt > &  validVertices,
ossimVertexOrdering  ordering = OSSIM_CLOCKWISE_ORDER,
ossim_uint32  resLevel = 0 
) const
virtual

ordering specifies how the vertices should be arranged.

valid image vertices is basically the tightly fit convex hull of the image. Usually an image has NULL values and are internally not upright rectangular. This can cause problems some spatial filters.

The default implementation is to return the bounding rect.

Definition at line 1232 of file ossimImageHandler.cpp.

References getDecimationFactor(), ossimImageSource::getValidImageVertices(), ossimDpt::hasNans(), OSSIM_COUNTERCLOCKWISE_ORDER, theValidImageVertices, ossimDpt::x, x, and ossimDpt::y.

Referenced by ATP::AtpGenerator::getValidVertices().

1235 {
1236  ossimDpt decimation;
1237  getDecimationFactor(resLevel, decimation);
1238  if(decimation.hasNans())
1239  {
1240  return;
1241  }
1242  if (theValidImageVertices.size() != 0)
1243  {
1244  validVertices.clear();
1245  for (ossim_uint32 i=0; i<theValidImageVertices.size(); ++i)
1246  {
1247  ossimIpt pt(ossim::round<int>(theValidImageVertices[i].x*decimation.x),
1248  ossim::round<int>(theValidImageVertices[i].y*decimation.y));
1249  validVertices.push_back(pt);
1250  }
1251 
1252  if(ordering == OSSIM_COUNTERCLOCKWISE_ORDER)
1253  {
1254  std::reverse(validVertices.begin()+1, validVertices.end());
1255  }
1256  }
1257  else
1258  {
1259  // Call the base class method which will set to bounding rectangle.
1260  ossimImageSource::getValidImageVertices(validVertices, ordering, resLevel);
1261  }
1262 }
ossim_uint32 x
double y
Definition: ossimDpt.h:165
virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt &result) const
virtual void getValidImageVertices(std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
ordering specifies how the vertices should be arranged.
unsigned int ossim_uint32
vector< ossimIpt > theValidImageVertices
bool hasNans() const
Definition: ossimDpt.h:67
double x
Definition: ossimDpt.h:164

◆ hasLut()

bool ossimImageHandler::hasLut ( ) const
virtual

Definition at line 1834 of file ossimImageHandler.cpp.

References theLut, and ossimRefPtr< T >::valid().

Referenced by ossimGdalWriter::checkColorLut().

1835 {
1836  return theLut.valid();
1837 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimNBandLutDataObject > theLut

◆ hasMetaData()

bool ossimImageHandler::hasMetaData ( ) const
virtual

Definition at line 1544 of file ossimImageHandler.cpp.

References ossimImageMetaData::isValid(), and theMetaData.

Referenced by ossimGdalTileSource::computeMinMax().

1545 {
1546  return theMetaData.isValid();
1547 }
ossimImageMetaData theMetaData

◆ hasOverviews()

bool ossimImageHandler::hasOverviews ( ) const
virtual
Returns
true if getNumberOfReducedResSets > 1, false if not.
See also
getNumberOfReducedResSets()

Definition at line 840 of file ossimImageHandler.cpp.

References getNumberOfDecimationLevels().

841 {
842  return (getNumberOfDecimationLevels() > 1);
843 }
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.

◆ initialize()

void ossimImageHandler::initialize ( )
virtual

initialize Does nothing in this class.

Implemented to satisfy pure virtual.

Implements ossimImageSource.

Reimplemented in ossimRangeDomeTileSource, and ossimVideoImageHandler.

Definition at line 104 of file ossimImageHandler.cpp.

105 {
106 }

◆ initImageParameters()

void ossimImageHandler::initImageParameters ( ossimImageGeometry geom) const
protected

Convenience method to set things needed in the image geometry from the image handler.

At time of writing sets the decimation and image size.

Parameters
geomossimImageGeometry to initiale.

Definition at line 1898 of file ossimImageHandler.cpp.

References getBoundingRect(), ossimImageGeometry::getImageSize(), getNumberOfDecimationLevels(), ossimImageGeometry::getNumberOfDecimations(), ossimIpt::hasNans(), ossimIrect::height(), ossimImageGeometry::setDiscreteDecimation(), ossimImageGeometry::setImageSize(), theDecimationFactors, and ossimIrect::width().

Referenced by ossimDoqqTileSource::getImageGeometry(), ossimQbTileFilesHandler::getImageGeometry(), ossimERSTileSource::getImageGeometry(), ossimKakaduJpipHandler::getImageGeometry(), ossimVpfTileSource::getImageGeometry(), ossimGdalTileSource::getImageGeometry(), ossimDtedTileSource::getImageGeometry(), ossimUsgsDemTileSource::getImageGeometry(), ossimGeneralRasterTileSource::getImageGeometry(), ossimOpjJp2Reader::getImageGeometry(), ossimJpegTileSource::getImageGeometry(), ossimMG4LidarReader::getImageGeometry(), ossimGeoPdfReader::getImageGeometry(), ossimMrSidReader::getImageGeometry(), ossimH5ImageHandler::getImageGeometry(), ossimLasReader::getImageGeometry(), ossimRpfCacheTileSource::getImageGeometry(), ossimKakaduJp2Reader::getImageGeometry(), ossimPngReader::getImageGeometry(), ossimGpkgReader::getImageGeometry(), ossimCibCadrgTileSource::getImageGeometry(), and getImageGeometry().

1899 {
1900  if ( geom )
1901  {
1902  // Set decimation levels
1904  if ((num_levels > 0) && (num_levels != geom->getNumberOfDecimations()))
1905  {
1907  }
1908 
1909  // Set image size.
1910  if(geom->getImageSize().hasNans())
1911  {
1912  ossimIrect rect = getBoundingRect();
1913  geom->setImageSize(ossimIpt(rect.width(), rect.height()));
1914  }
1915  }
1916 }
const ossimIpt & getImageSize() const
std::vector< ossimDpt > theDecimationFactors
ossim_uint32 height() const
Definition: ossimIrect.h:487
void setImageSize(const ossimIpt &size)
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
void setDiscreteDecimation(const std::vector< ossimDpt > &decimation_list)
Sets the decimation scheme to a discrete list of decimation factors.
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
bool hasNans() const
Definition: ossimIpt.h:58
ossim_uint32 getNumberOfDecimations() const

◆ initVertices()

bool ossimImageHandler::initVertices ( const char *  file)
protected

Opens file and attempts to initialize the valid image vertices.

Returns true on success, false on error.

Definition at line 267 of file ossimImageHandler.cpp.

References ossim::StreamFactoryRegistry::createIstream(), ossimString::find(), ossim::StreamFactoryRegistry::instance(), m_state, and ossimErrorCodes::OSSIM_OK.

Referenced by openValidVertices().

268 {
269  static const char MODULE[] = "ossimImageHandler::initVertices";
270  bool loadFromFileFlag = true;
271  std::shared_ptr<ossimKeywordlist> kwl;
272  if(m_state)
273  {
274  bool validVerticesFlag = false;
275  if(m_state->getValidVertices())
276  {
277  loadFromFileFlag = false;
278  kwl = m_state->getValidVertices();
279  if(kwl)
280  {
281  ossimString connectionString = kwl->find("connection_string");
282  if(connectionString != file)
283  {
284  loadFromFileFlag = true;
285  }
286  else if(kwl->getSize()<=0)
287  {
288  return false;
289  }
290  }
291  }
292  else
293  {
294  loadFromFileFlag = true;
295  }
296  }
297  if(!kwl) kwl = std::make_shared<ossimKeywordlist>();
298 
299  if(loadFromFileFlag)
300  {
301  kwl = std::make_shared<ossimKeywordlist>();
302  std::shared_ptr<ossim::istream> instream = ossim::StreamFactoryRegistry::instance()->createIstream(file);
303  kwl->add("connection_string", file, true);
304  if (!instream)
305  {
306  //if(m_state)
307  // m_state->setValidVertices(kwl);
308  return false;
309  }
310 
311  kwl->parseStream(*instream);
312  if(m_state && kwl->getSize())
313  m_state->setValidVertices(kwl);
314  }
315 
316  if (kwl->getErrorStatus() != ossimErrorCodes::OSSIM_OK)
317  {
318  if (traceDebug())
319  {
321  << "ossimImageHandler::initVertices NOTICE:"
322  << "\nError reading valid vertice file: " << file << std::endl;
323  }
324  return false;
325  }
326 
327  // Clean out any old vertices...
328  theValidImageVertices.clear();
329  std::vector<ossimString> indexedPrefixes;
330  kwl->getSortedList(indexedPrefixes, "point");
331  ossim_uint32 number_of_points = indexedPrefixes.size();
332  for (ossim_uint32 i=0; i<number_of_points; i++)
333  {
334  ossimIpt pt;
335  const char* lookup;
336  lookup = kwl->find(indexedPrefixes[i], ".x");
337  if (lookup)
338  {
339  pt.x = atoi(lookup);
340  lookup = kwl->find(indexedPrefixes[i], ".y");
341  if (lookup)
342  pt.y = atoi(lookup);
343  }
344 
345  if (!lookup)
346  {
347  if (traceDebug())
348  CLOG << " ERROR: lookup failed for: " << indexedPrefixes[i] << std::endl;
349  return false;
350  }
351 
352  theValidImageVertices.push_back(pt);
353  }
354 
355 
356  if (traceDebug())
357  {
358  CLOG << " DEBUG:"
359  << "\nVertices file: " << file
360  << "\nValid image vertices:"
361  << std::endl;
362  for (ossim_uint32 i=0; i<theValidImageVertices.size(); ++i)
363  {
365  << "\npoint[" << i << "]: " << theValidImageVertices[i];
366  }
367  ossimNotify(ossimNotifyLevel_DEBUG) << std::endl;
368  }
369 
370  return true;
371 }
#define CLOG
Definition: ossimTrace.h:23
static const ossimErrorCode OSSIM_OK
std::shared_ptr< ossim::ImageHandlerState > m_state
static StreamFactoryRegistry * instance()
unsigned int ossim_uint32
vector< ossimIpt > theValidImageVertices
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
virtual std::shared_ptr< ossim::istream > createIstream(const std::string &connectionString, const ossimKeywordlist &options=ossimKeywordlist(), std::ios_base::openmode mode=std::ios_base::in|std::ios_base::binary) const
Will try to creates an istream interface to the connectionString passed in.
std::string::size_type find(const std::string &s, std::string::size_type pos=0) const
Searches for s as a substring of *this, beginning at character pos of *this.
Definition: ossimString.h:753
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ isBandSelector()

bool ossimImageHandler::isBandSelector ( ) const
virtual

Indicates whether or not the image handler can control output band selection via the setOutputBandList method.

Returns
true if band selector; false, if not.

Reimplemented in ossimGeneralRasterTileSource, and ossimTiffTileSource.

Definition at line 1273 of file ossimImageHandler.cpp.

Referenced by ossimOverviewBuilderBase::finalize(), ossimBandSelector::getBandSelectableImageHandler(), ossimTiffTileSource::isBandSelector(), ossimGeneralRasterTileSource::isBandSelector(), ossimOverviewBuilderBase::setInputSource(), and setOutputToInputBandList().

1274 {
1275  return false;
1276 }

◆ isIdentityBandList()

bool ossimImageHandler::isIdentityBandList ( const std::vector< ossim_uint32 > &  bandList) const
virtual

Convenience method to see if band list is identity.

Parameters
bandListList to check.
Returns
true if band selector; false, if not.

Definition at line 1301 of file ossimImageHandler.cpp.

References ossimImageSource::getOutputBandList().

Referenced by ossimTiffTileSource::saveState().

1302 {
1303  bool result = false;
1304  const ossim_uint32 BANDS = (ossim_uint32)bandList.size();
1305  if ( BANDS )
1306  {
1307  std::vector<ossim_uint32> inputList;
1308  ossimImageSource::getOutputBandList( inputList ); // This populates an identity band list.
1309 
1310  if ( inputList.size() == BANDS )
1311  {
1312  ossim_uint32 band = 0;
1313  while ( band < BANDS )
1314  {
1315  if ( inputList[band] != bandList[band] )
1316  {
1317  break;
1318  }
1319  ++band;
1320  }
1321  if ( band == BANDS )
1322  {
1323  result = true;
1324  }
1325  }
1326  }
1327  return result;
1328 }
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
unsigned int ossim_uint32

◆ isImageTiled()

bool ossimImageHandler::isImageTiled ( ) const
virtual

Indicates whether or not the image is tiled internally.

This implementation returns true if (getImageTileWidth() && getImageTileHeight()) are both non zero. Override in the image handler if something else is desired. Returns true if tiled, false if not.

Reimplemented in ossimTiledImageHandler, and ossimKakaduJpipHandler.

Definition at line 1369 of file ossimImageHandler.cpp.

References getImageTileHeight(), and getImageTileWidth().

Referenced by ossimSingleImageChain::createRenderedChain().

1370 {
1371  return (getImageTileWidth() && getImageTileHeight());
1372 }
virtual ossim_uint32 getImageTileHeight() const =0
Returns the tile width of the image or 0 if the image is not tiled.
virtual ossim_uint32 getImageTileWidth() const =0
Returns the tile width of the image or 0 if the image is not tiled.

◆ isOpen()

virtual bool ossimImageHandler::isOpen ( ) const
pure virtual

◆ isValidRLevel()

bool ossimImageHandler::isValidRLevel ( ossim_uint32  resLevel) const
virtual

Determines if the passed in reslution level is valid.

If this reader is used as an overview the caller should pass in a resLevel relative to the full image.

Parameters
resLevelzero base resolution level.
Returns
true on success, false on error.

Reimplemented in ossimCibCadrgTileSource, ossimRpfCacheTileSource, ossimTiffTileSource, ossimImageCacheBase, ossimJpegTileSource, ossimGeneralRasterTileSource, and ossimBitMaskTileSource.

Definition at line 1207 of file ossimImageHandler.cpp.

References getNumberOfDecimationLevels(), and theStartingResLevel.

Referenced by getImageRectangle(), ossimGdalTileSource::getMaxSize(), ossimGdalTileSource::getNumberOfLines(), ossimOpjJp2Reader::getNumberOfLines(), ossimKakaduNitfReader::getNumberOfLines(), ossimMrSidReader::getNumberOfLines(), ossimKakaduJp2Reader::getNumberOfLines(), ossimGdalTileSource::getNumberOfSamples(), ossimOpjJp2Reader::getNumberOfSamples(), ossimKakaduNitfReader::getNumberOfSamples(), ossimMrSidReader::getNumberOfSamples(), ossimKakaduJp2Reader::getNumberOfSamples(), ossimKakaduNitfReader::getOverviewTile(), getOverviewTile(), ossimUsgsDemTileSource::getTile(), ossimOpjJp2Reader::getTile(), ossimGdalTileSource::getTile(), ossimGpkgReader::getTile(), ossimHdf5ImageHandler::getTile(), ossimCcfTileSource::getTile(), ossimHdfReader::getTile(), ossimDtedTileSource::getTile(), ossimPngReader::getTile(), ossimH5ImageHandler::getTile(), ossimMrSidReader::getTile(), ossimMG4LidarReader::getTile(), ossimAdrgTileSource::getTile(), ossimKakaduJ2kReader::getTile(), ossimKakaduJp2Reader::getTile(), ossimGeoPdfReader::getTile(), ossimNitfTileSource::getTile(), ossimJpegTileSource::isValidRLevel(), ossimRpfCacheTileSource::isValidRLevel(), and ossimCibCadrgTileSource::isValidRLevel().

1208 {
1209  bool result = false;
1210 
1211  const ossim_uint32 LEVELS = getNumberOfDecimationLevels();
1212 
1213  if ( !theStartingResLevel) // Not an overview.
1214  {
1215  result = (resLevel < LEVELS);
1216  }
1217  else // Used as overview.
1218  {
1219  if (resLevel >= theStartingResLevel)
1220  {
1221  //---
1222  // Adjust the res level to be zero based for this overview before
1223  // checking.
1224  //---
1225  result = ( (resLevel - theStartingResLevel) < LEVELS);
1226  }
1227  }
1228 
1229  return result;
1230 }
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
unsigned int ossim_uint32
ossim_uint32 theStartingResLevel
theStartingResLevel If set to something other than zero(default) this is indicative that the reader i...

◆ loadMetaData()

void ossimImageHandler::loadMetaData ( )
virtual

There is an external file with an omd extension.

this file contains additional information about the image such as the null pixel, min and max values. For general raster it will contain much more than that.

Reimplemented in ossimDtedTileSource, and ossimHdf5ImageHandler.

Definition at line 1374 of file ossimImageHandler.cpp.

References ossimString::c_str(), ossimImageMetaData::clear(), ossim::StreamFactoryRegistry::createIstream(), getFilenameWithThisExtension(), ossimImageSource::getOutputScalarType(), ossim::StreamFactoryRegistry::instance(), ossimImageMetaData::loadState(), m_state, ossimKeywordlist::parseStream(), ossimImageMetaData::setScalarType(), and theMetaData.

Referenced by ossimHdf5ImageHandler::loadMetaData().

1375 {
1376 
1377  if(m_state&&m_state->getMetaData())
1378  {
1379  theMetaData = *m_state->getMetaData();
1380  }
1381  else
1382  {
1383  ossimFilename filename = getFilenameWithThisExtension(ossimString(".omd"), false);
1384  theMetaData.clear();
1385 
1386  std::shared_ptr<ossim::istream> instream = ossim::StreamFactoryRegistry::instance()->createIstream(filename.c_str());
1387 
1388  if(!instream)
1389  {
1390  filename = getFilenameWithThisExtension(ossimString(".omd"), true);
1392  }
1393 
1394  if(instream)
1395  {
1396  ossimKeywordlist kwl;
1397 
1398  kwl.parseStream(*instream);
1399 
1400  theMetaData.loadState(kwl);
1401  }
1402  else
1403  {
1405  }
1406  if(m_state)
1407  {
1408  m_state->setMetaData(std::make_shared<ossimImageMetaData>(theMetaData));
1409  }
1410 
1411  }
1412 
1413 }
void setScalarType(ossimScalarType aType)
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Represents serializable keyword/value map.
std::shared_ptr< ossim::ImageHandlerState > m_state
static StreamFactoryRegistry * instance()
ossimImageMetaData theMetaData
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated method
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
virtual std::shared_ptr< ossim::istream > createIstream(const std::string &connectionString, const ossimKeywordlist &options=ossimKeywordlist(), std::ios_base::openmode mode=std::ios_base::in|std::ios_base::binary) const
Will try to creates an istream interface to the connectionString passed in.
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ loadState()

bool ossimImageHandler::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageSource.

Reimplemented in ossimCibCadrgTileSource, ossimLasReader, ossimKakaduJp2Reader, ossimKakaduJ2kReader, ossimPointCloudImageHandler, ossimMrSidReader, ossimGeoPdfReader, ossimMG4LidarReader, ossimTiffTileSource, ossimRpfCacheTileSource, ossimHdfReader, ossimNitfTileSource, ossimCcfTileSource, ossimOgrGdalTileSource, ossimAdrgTileSource, ossimDtedTileSource, ossimOgrVectorTileSource, ossimH5ImageHandler, ossimOpjJp2Reader, ossimPngReader, ossimGdalTileSource, ossimHdf5ImageHandler, ossimGpkgReader, ossimUsgsDemTileSource, ossimJpegTileSource, ossimImageCacheBase, ossimKmlSuperOverlayReader, ossimRangeDomeTileSource, ossimVpfTileSource, ossimGeneralRasterTileSource, ossimTiledImageHandler, ossimKakaduJpipHandler, ossimBandSeparateHandler, ossimplugins::ossimTerraSarTiffReader, ossimplugins::ossimRadarSat2TiffReader, ossimEnviTileSource, ossimLandsatTileSource, ossimImageHandlerMtAdaptor, ossimSrtmTileSource, ossimERSTileSource, ossimQuickbirdNitfTileSource, and ossimDoqqTileSource.

Definition at line 141 of file ossimImageHandler.cpp.

References theDecimationFactors.

Referenced by ossimDoqqTileSource::loadState(), ossimBandSeparateHandler::loadState(), ossimKakaduJpipHandler::loadState(), ossimTiledImageHandler::loadState(), ossimVpfTileSource::loadState(), ossimRangeDomeTileSource::loadState(), ossimKmlSuperOverlayReader::loadState(), ossimJpegTileSource::loadState(), ossimUsgsDemTileSource::loadState(), ossimGpkgReader::loadState(), ossimHdf5ImageHandler::loadState(), ossimGdalTileSource::loadState(), ossimH5ImageHandler::loadState(), ossimOpjJp2Reader::loadState(), ossimPngReader::loadState(), ossimAdrgTileSource::loadState(), ossimDtedTileSource::loadState(), ossimOgrVectorTileSource::loadState(), ossimOgrGdalTileSource::loadState(), ossimCcfTileSource::loadState(), ossimNitfTileSource::loadState(), ossimHdfReader::loadState(), ossimTiffTileSource::loadState(), ossimMG4LidarReader::loadState(), ossimGeoPdfReader::loadState(), ossimMrSidReader::loadState(), ossimKakaduJ2kReader::loadState(), ossimKakaduJp2Reader::loadState(), ossimLasReader::loadState(), ossimKakaduJpipInfo::open(), ossimHdf5PluginHandlerFactory::open(), and ossimplugins::ossimPluginReaderFactory::open().

143 {
144  static const char MODULE[] = "ossimImageHandler::loadState(kwl, prefix)";
145  theDecimationFactors.clear();
146  if(traceDebug())
147  {
149  << MODULE << " DEBUG: entered ..."
150  << std::endl;
151  }
152 
153  ossimImageSource::loadState(kwl, prefix);
154 
156  {
158  << MODULE
159  << "WARNING: error detected in keyword list! State not load."
160  << std::endl;
161 
162  if(traceDebug())
163  {
165  << MODULE << " DEBUG: "
166  << "leaving with error in kwl ..." << std::endl;
167  }
168  return false;
169  }
170 
171  const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
172  if (!lookup)
173  {
174  // Deprecated...
175  lookup = kwl.find(prefix, ossimKeywordNames::IMAGE_FILE_KW);
176  }
177 
178  if (lookup)
179  {
180  theImageFile = lookup;
181  }
182 
183  lookup = kwl.find(prefix, ossimKeywordNames::OVERVIEW_FILE_KW);
184  if(lookup)
185  {
186  theOverviewFile = ossimFilename(lookup);
187  }
188  if(traceDebug())
189  {
191  << MODULE << " DEBUG:\n"
192  << "filename = " << theImageFile << std::endl;
193  }
194 
195  // Check for an external geometry file to initialize our image geometry object:
196  lookup = kwl.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
197  if (lookup)
198  {
199  ossimKeywordlist geomKwl;
200  if (geomKwl.addFile(lookup) == true)
201  {
203  theGeometry->loadState(geomKwl);
204  if(traceDebug())
205  {
207  << MODULE << " DEBUG:"
208  << "Loaded external geometry file: "
209  << lookup
210  << "\n" << geomKwl << std::endl;
211  }
212  }
213  }
214 
215  // Check for an valid image vetices file.
216  lookup = kwl.find(prefix, VALID_VERTICES_FILE_KW);
217  if (lookup)
218  {
219  initVertices(lookup);
220  }
221 
222  // Starting resolution level.
223  lookup = kwl.find(prefix, START_RES_LEVEL_KW);
224  if (lookup)
225  {
227  }
228 
229  // Open overview flag.
230  lookup = kwl.find(prefix, OPEN_OVERVIEW_FLAG_KW);
231  if (lookup)
232  {
233  setOpenOverviewFlag( ossimString(lookup).toBool() );
234  }
235 
236  // The supplementary directory for finding the overview
237  lookup = kwl.find(prefix, SUPPLEMENTARY_DIRECTORY_KW);
238  if (lookup)
239  {
241  }
242 
243  if(getNumberOfInputs())
244  {
245  theInputObjectList.clear();
246  }
248 
249  // Read image id if present:
251 
252  lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
253  if (lookup)
254  {
255  thePixelType = (ossimPixelType) atoi(lookup);
256  }
257 
258  if(traceDebug())
259  {
261  << MODULE << " DEBUG: Leaving Ok ..."
262  << std::endl;
263  }
264  return true;
265 }
static const char * OVERVIEW_FILE_KW
void setOpenOverviewFlag(bool flag)
Sets theOpenOverviewFlag.
ossimRefPtr< ossimImageGeometry > theGeometry
ossimFilename theImageFile
Represents serializable keyword/value map.
bool addFile(const char *file)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Attempts to initialize a transform and a projection given the KWL.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const char * find(const char *key) const
std::vector< ossimDpt > theDecimationFactors
static const ossimErrorCode OSSIM_ERROR
ossim_uint32 toUInt32() const
static const char * IMAGE_ID_KW
ossimFilename theSupplementaryDirectory
ossimPixelType thePixelType
static const char * GEOM_FILE_KW
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossimPixelType
ConnectableObjectList theInputObjectList
Holds a list of input objects.
virtual ossimErrorCode getErrorStatus() const
static const char * PIXEL_TYPE_KW
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
bool theInputListIsFixedFlag
Indicates whether the theInputObjectList is fixed.
ossimFilename theOverviewFile
static const char * IMAGE_FILE_KW
static const char * FILENAME_KW
bool initVertices(const char *file)
Opens file and attempts to initialize the valid image vertices.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_uint32 theStartingResLevel
theStartingResLevel If set to something other than zero(default) this is indicative that the reader i...

◆ open() [1/4]

virtual bool ossimImageHandler::open ( )
pure virtual

Pure virtual open.

Derived classes must implement.

Returns
Returns true on success, false on error.
Note
This method relies on the data member ossimImageData::theImageFile being set. Callers should do a "setFilename" prior to calling this method or use the ossimImageHandler::open that takes a file name and an entry index.

Implemented in ossimH5ImageHandler, ossimTiffTileSource, ossimPngReader, ossimGpkgReader, ossimHdf5ImageHandler, ossimJpegTileSource, ossimKakaduJ2kReader, ossimKakaduJp2Reader, ossimMrSidReader, ossimGeoPdfReader, ossimOpjJp2Reader, ossimMG4LidarReader, ossimGeneralRasterTileSource, ossimHdfReader, ossimBitMaskTileSource, ossimCibCadrgTileSource, ossimRangeDomeTileSource, ossimNitfTileSource, ossimRpfCacheTileSource, ossimOgrGdalTileSource, ossimAdrgTileSource, ossimOgrVectorTileSource, ossimImageHandlerMtAdaptor, ossimGdalTileSource, ossimLasReader, ossimDtedTileSource, ossimImageCacheTileSource, ossimPointCloudImageHandler, ossimKmlSuperOverlayReader, ossimCcfTileSource, ossimKakaduJpipHandler, ossimTiledImageHandler, ossimUsgsDemTileSource, ossimImageCacheBase, ossimBandSeparateHandler, ossimVpfTileSource, ossimEnviTileSource, ossimLandsatTileSource, ossimQbTileFilesHandler, ossimSrtmTileSource, ossimVideoImageHandler, ossimQuickbirdTiffTileSource, and ossimQuickbirdNitfTileSource.

Referenced by ossimImageCacheTileSource::fillTile(), ossimDtedTileSource::loadState(), main(), ossimImageHandlerFactory::open(), ossimHdf5PluginHandlerFactory::open(), ossimplugins::ossimPluginReaderFactory::open(), ossimKakaduJpipInfo::open(), ossimImageHandlerMtAdaptor::open(), ossimImageHandlerRegistry::open(), open(), ossimGdalFactory::openOverview(), ossimOpjReaderFactory::openOverview(), ossimImageHandlerFactory::openOverview(), and ossimKakaduReaderFactory::openOverview().

◆ open() [2/4]

bool ossimImageHandler::open ( const ossimFilename imageFile,
ossim_uint32  entryIndex 
)
virtual

Opens the image file.

Parameters
imageFileFile to open.
entryIndex
Returns
true on success, false on error.

Definition at line 1173 of file ossimImageHandler.cpp.

References close(), isOpen(), open(), setCurrentEntry(), and setFilename().

1175 {
1176  if(isOpen())
1177  {
1178  close();
1179  }
1180  setFilename(imageFile);
1181 
1182  bool result = open();
1183 
1184  if(result)
1185  {
1186  return setCurrentEntry(entryIndex);
1187  }
1188 
1189  return result;
1190 }
virtual bool open()=0
Pure virtual open.
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
virtual void setFilename(const ossimFilename &filename)
Sets the filename.
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)

◆ open() [3/4]

bool ossimImageHandler::open ( const ossimFilename imageFile)
virtual

Reimplemented in ossimJpegTileSource, ossimTiffTileSource, ossimplugins::ossimTerraSarTiffReader, ossimplugins::ossimRadarSat2TiffReader, ossimERSTileSource, and ossimDoqqTileSource.

Definition at line 1161 of file ossimImageHandler.cpp.

References close(), isOpen(), open(), and setFilename().

1162 {
1163  if(isOpen())
1164  {
1165  close();
1166  }
1167 
1168  setFilename(imageFile);
1169 
1170  return open();
1171 }
virtual bool open()=0
Pure virtual open.
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
virtual void setFilename(const ossimFilename &filename)
Sets the filename.
virtual void close()
Deletes the overview and clears the valid image vertices.

◆ open() [4/4]

bool ossimImageHandler::open ( std::shared_ptr< ossim::ImageHandlerState >  state)
virtual

Definition at line 1192 of file ossimImageHandler.cpp.

References close(), isOpen(), open(), setFilename(), and setState().

1193 {
1194  bool result = false;
1195  if(isOpen())
1196  {
1197  close();
1198  }
1199  setFilename(state->getConnectionString());
1200  setState(state);
1201  result = open();
1202 
1203  return result;
1204 }
virtual bool open()=0
Pure virtual open.
void setState(std::shared_ptr< ossim::ImageHandlerState > state)
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
virtual void setFilename(const ossimFilename &filename)
Sets the filename.
virtual void close()
Deletes the overview and clears the valid image vertices.

◆ openOverview() [1/2]

bool ossimImageHandler::openOverview ( )
virtual

Searches for an overview.

Uses theImageFile as a key. If theImageFile = "foo.tif" it will look for "foo.ovr" first, then "foo_ovr.tif" next. Calls openOverview(const ossimFilename& overview_file)

Returns
true on success, false on error.
See also
openOverview(const ossimFilename& overview_file)

Definition at line 927 of file ossimImageHandler.cpp.

Referenced by ossimSingleImageChain::addImageHandler(), buildOverview(), and ossimImageHandlerFactory::openSrcRecord().

928 {
929  static const char MODULE[] = "ossimImageHandler::openOverview()";
930  if (traceDebug())
931  {
932  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
933  }
934 
935  bool result = false;
936 
937  closeOverview();
938 
939  if(m_state)
940  {
941  // check if we have an overview state
942  std::shared_ptr<ossim::ImageHandlerState> overviewState = m_state->getOverviewState();
943  if(overviewState)
944  {
945  // check to see if the overvies state was cached
946  // to mark has checked but no overview
947  if(overviewState->getConnectionString().empty())
948  {
949  return false;
950  }
951  ossim_uint32 overviewStartingResLevel = getNumberOfDecimationLevels();
953  if(theOverview)
954  {
955  result = true;
956  //---
957  // Set the owner in case the overview reader needs to get something
958  // from the it like min/max/null.
959  //---
960  theOverview->changeOwner(this);
961 
962  // Set the starting res level of the overview.
963  theOverview->setStartingResLevel(overviewStartingResLevel);
964 
965  // Capture the file name.
966  theOverviewFile = overviewState->getConnectionString();
967 
968  //---
969  // Some overview handlers cannot store what the null is. Like dted
970  // null is -32767 not default -32768 so this allows passing this to the
971  // overview reader provided it overrides setMin/Max/NullPixel value
972  // methods. (drb)
973  //---
974  const ossim_uint32 BANDS = getNumberOfOutputBands();
975  for (ossim_uint32 band = 0; band < BANDS; ++band)
976  {
980  }
981  if (traceDebug())
982  {
984  << "overview starting res level: " << overviewStartingResLevel
985  << "\noverview levels: "
987  << "\nlevels: " << getNumberOfDecimationLevels()
988  << endl;
989  }
990 
991  //---
992  // This is not really a container event; however, using for now.
993  //---
994  ossimContainerEvent event(this,
996  event.setObjectList(theOverview.get());
997  fireEvent(event);
998  return result;
999  }
1000  }
1001  }
1002  // 1) ESH 03/2009 -- Use the overview file set e.g. using a .spec file.
1003  ossimFilename overviewFilename = getOverviewFile();
1004 
1005  // ossimFilename::exists() currently does not work with s3 url's.
1006  if ( overviewFilename.empty() ) // || (overviewFilename.exists() == false) )
1007  {
1008  // 2) Generate the name from image name.
1009  overviewFilename = createDefaultOverviewFilename();
1010  }
1011 
1012  // ossimFilename::exists() currently does not work with s3 url's.
1013  if ( overviewFilename.size() )
1014  {
1015  result = openOverview( overviewFilename );
1016 
1017  if (traceDebug())
1018  {
1020  << (result?"Opened ":"Could not open ") << "overview: " << overviewFilename
1021  << "\n";
1022  }
1023  }
1024  if ( !result )
1025  {
1026  if (overviewFilename.empty() || (overviewFilename.exists() == false) )
1027  {
1028  // 3) For backward compatibility check if single entry and _e0.ovr
1029  overviewFilename = getFilenameWithThisExtension(ossimString(".ovr"), true);
1030 
1031  if (overviewFilename.empty() || (overviewFilename.exists() == false) )
1032  {
1033  //---
1034  // 4) For overviews built with gdal.
1035  // Examples:
1036  // Single entry: foo.tif.ovr
1037  // Multi-entry: foo.tif.x.ovr where "x" == one based entry number.
1038  //
1039  // Note: Take into account a supplementary dir if any.
1040  //---
1042  {
1043  overviewFilename = getFilename();
1044  }
1045  else
1046  {
1047  overviewFilename = theSupplementaryDirectory;
1048  overviewFilename = overviewFilename.dirCat( getFilename().file() );
1049 
1050  }
1051 
1052  if ( getNumberOfEntries() > 1 )
1053  {
1054  overviewFilename += ".";
1055  // Sample multi-entry data "one" based; hence, the + 1.
1056  overviewFilename += ossimString::toString( getCurrentEntry()+1 );
1057  }
1058  overviewFilename += ".ovr";
1059  }
1060  }
1061 
1062  if ( overviewFilename.exists() )
1063  {
1064  result = openOverview( overviewFilename );
1065 
1066  if (traceDebug())
1067  {
1069  << (result?"Opened ":"Could not open ") << "overview: " << overviewFilename
1070  << "\n";
1071  }
1072  }
1073  }
1074 
1075  if (traceDebug())
1076  {
1078  << MODULE << " exit result: " << (result?"true":"false") << "\n";
1079  }
1080 
1081  return result;
1082 }
virtual void setMaxPixelValue(ossim_uint32 band, const ossim_float64 &pix)
convenience method to set max pixel value.
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
static ossimString toString(bool aValue)
Numeric to string methods.
std::shared_ptr< ossim::ImageHandlerState > m_state
virtual ossimFilename createDefaultOverviewFilename() const
virtual void closeOverview()
If theOverview is initialized it will be deleted and set to NULL.
virtual void fireEvent(ossimEvent &event)
virtual bool openOverview()
Searches for an overview.
ossimFilename theSupplementaryDirectory
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
bool exists() const
virtual const ossimFilename & getFilename() const
Returns the filename.
std::string::size_type size() const
Definition: ossimString.h:405
#define OSSIM_EVENT_ADD_OBJECT_ID
Definition: ossimEventIds.h:27
unsigned int ossim_uint32
virtual void setMinPixelValue(ossim_uint32 band, const ossim_float64 &pix)
convenience method to set min pixel value.
virtual ossim_uint32 getCurrentEntry() const
virtual ossim_uint32 getNumberOfEntries() const
void setStartingResLevel(ossim_uint32 level)
ossimRefPtr< ossimImageHandler > theOverview
ossimFilename getOverviewFile() const
ossimFilename dirCat(const ossimFilename &file) const
bool empty() const
Definition: ossimString.h:411
ossimFilename theOverviewFile
static ossimImageHandlerRegistry * instance()
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual void setNullPixelValue(ossim_uint32 band, const ossim_float64 &pix)
convenience method to set null pixel value.
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ openOverview() [2/2]

bool ossimImageHandler::openOverview ( const ossimFilename overview_file)
virtual

Calls closeOverview(), then attempts to open the overview_file.

On success, theOverviewFile will be set and theOverview will be initialized. On failure, theOverviewFile will be cleared and theOverview deleted and set to NULL.

Parameters
overview_fileossimFilename representing overview file.
Returns
true on success, false on error.
See also
closeOverview()

Definition at line 845 of file ossimImageHandler.cpp.

846 {
847  bool result = false;
848  if (traceDebug())
849  {
851  << "ossimImageHandler::openOverview(overview_file): ...entered!";
852  }
853  closeOverview();
854 
855  if (overview_file != theImageFile) // Make sure we don't open ourselves.
856  {
857  //---
858  // Get the number of level before the call to opening the overview so
859  // the overview can be told what it's starting res level is.
860  //---
861  ossim_uint32 overviewStartingResLevel = getNumberOfDecimationLevels();
862 
863 
864  // Try to open:
866  if (theOverview.valid())
867  {
868  result = true;
869 
870  //---
871  // Set the owner in case the overview reader needs to get something
872  // from the it like min/max/null.
873  //---
874  theOverview->changeOwner(this);
875 
876  // Set the starting res level of the overview.
877  theOverview->setStartingResLevel(overviewStartingResLevel);
878 
879  // Capture the file name.
880  theOverviewFile = overview_file;
881 
882  //---
883  // Some overview handlers cannot store what the null is. Like dted
884  // null is -32767 not default -32768 so this allows passing this to the
885  // overview reader provided it overrides setMin/Max/NullPixel value
886  // methods. (drb)
887  //---
888  const ossim_uint32 BANDS = getNumberOfOutputBands();
889  for (ossim_uint32 band = 0; band < BANDS; ++band)
890  {
894  }
895  if(m_state)
896  {
897  m_state->setOverviewState(theOverview->getState());
898  }
899  if (traceDebug())
900  {
902  << "overview starting res level: " << overviewStartingResLevel
903  << "\noverview levels: "
905  << "\nlevels: " << getNumberOfDecimationLevels()
906  << endl;
907  }
908 
909  //---
910  // This is not really a container event; however, using for now.
911  //---
912  ossimContainerEvent event(this,
914  event.setObjectList(theOverview.get());
915  fireEvent(event);
916  }
917  }
918  if (traceDebug())
919  {
921  << "ossimImageHandler::openOverview(overview_file): ...leaving!";
922  }
923 
924  return result;
925 }
virtual ossimRefPtr< ossimImageHandler > openOverview(const ossimFilename &file) const
Open overview that takes a file name.
virtual void setMaxPixelValue(ossim_uint32 band, const ossim_float64 &pix)
convenience method to set max pixel value.
ossimFilename theImageFile
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
std::shared_ptr< ossim::ImageHandlerState > m_state
std::shared_ptr< ossim::ImageHandlerState > getState()
virtual void closeOverview()
If theOverview is initialized it will be deleted and set to NULL.
virtual void fireEvent(ossimEvent &event)
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
virtual void changeOwner(ossimObject *owner)
Permits changing the object&#39;s owner.
#define OSSIM_EVENT_ADD_OBJECT_ID
Definition: ossimEventIds.h:27
unsigned int ossim_uint32
virtual void setMinPixelValue(ossim_uint32 band, const ossim_float64 &pix)
convenience method to set min pixel value.
void setStartingResLevel(ossim_uint32 level)
ossimRefPtr< ossimImageHandler > theOverview
ossimFilename theOverviewFile
static ossimImageHandlerRegistry * instance()
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
virtual void setNullPixelValue(ossim_uint32 band, const ossim_float64 &pix)
convenience method to set null pixel value.
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ openValidVertices() [1/2]

bool ossimImageHandler::openValidVertices ( const ossimFilename vertices_file)
virtual

Opens the valid image vertices file and sets theValidImageVerticesFile variable.

Parameters
vertices_fileFile name containing valid vertices for image.
Returns
true on success, false on error.

Definition at line 1132 of file ossimImageHandler.cpp.

References initVertices().

Referenced by ATP::AtpGenerator::getValidVertices().

1133 {
1134  return initVertices(vertices_file);
1135 }
bool initVertices(const char *file)
Opens file and attempts to initialize the valid image vertices.

◆ openValidVertices() [2/2]

bool ossimImageHandler::openValidVertices ( )
virtual

Creates vertices file name based on image, then tries to open.

If theImageFile = "foo.tif" it will look for "foo_vertices.kwl".

Returns
true on success, false on error.

Definition at line 1137 of file ossimImageHandler.cpp.

References ossimFilename::dirCat(), ossimFilename::fileNoExtension(), getCurrentEntry(), getNumberOfEntries(), ossimFilename::path(), theImageFile, and ossimString::toString().

1138 {
1139  ossimFilename vertices_file;
1140  vertices_file = theImageFile.path();
1141  vertices_file = vertices_file.dirCat(theImageFile.fileNoExtension());
1142  if(getNumberOfEntries() > 1)
1143  {
1144  vertices_file += ossimString("_vertices") + "_e" + ossimString::toString(getCurrentEntry()) + ".kwl";
1145  }
1146  else
1147  {
1148  vertices_file += "_vertices.kwl";
1149  }
1150 
1151  if (traceDebug())
1152  {
1154  << "Looking for " << vertices_file
1155  << " vertices file..." << std::endl;
1156  }
1157 
1158  return openValidVertices(vertices_file);
1159 }
ossimFilename theImageFile
static ossimString toString(bool aValue)
Numeric to string methods.
virtual ossim_uint32 getCurrentEntry() const
virtual ossim_uint32 getNumberOfEntries() const
virtual bool openValidVertices()
Creates vertices file name based on image, then tries to open.
ossimFilename fileNoExtension() const
ossimFilename dirCat(const ossimFilename &file) const
ossimFilename path() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveImageGeometry() [1/2]

void ossimImageHandler::saveImageGeometry ( ) const
virtual

Saves the image geometry to a file that will be made based on the image file name.

Reimplemented from ossimImageSource.

Definition at line 814 of file ossimImageHandler.cpp.

References getFilenameWithThisExtension().

815 {
816  ossimFilename geometryFile = getFilenameWithThisExtension(ossimString(".geom"));
817  saveImageGeometry(geometryFile);
818 }
virtual void saveImageGeometry() const
Saves the image geometry to a file that will be made based on the image file name.
ossimFilename getFilenameWithThisExtension(const ossimString &ext, bool set_e0_prefix=false) const
Returns the image file with extension set using supplentary directory for dirname if set...

◆ saveImageGeometry() [2/2]

void ossimImageHandler::saveImageGeometry ( const ossimFilename geometry_file) const
virtual

Saves the image geometry to a file that will be made based on the image file name.

Reimplemented from ossimImageSource.

Definition at line 820 of file ossimImageHandler.cpp.

References ossimString::chars(), ossimImageGeometry::saveState(), theGeometry, ossimRefPtr< T >::valid(), and ossimKeywordlist::write().

821 {
822  if (theGeometry.valid())
823  {
824  ossimKeywordlist kwl;
825  theGeometry->saveState(kwl);
826  kwl.write(geometry_file.chars());
827  }
828 }
ossimRefPtr< ossimImageGeometry > theGeometry
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
const char * chars() const
For backward compatibility.
Definition: ossimString.h:77
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Saves the transform (if any) and projection (if any) states to the KWL.

◆ saveState()

bool ossimImageHandler::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageSource.

Reimplemented in ossimGeoPdfReader, ossimLasReader, ossimCibCadrgTileSource, ossimPointCloudImageHandler, ossimTiffTileSource, ossimRpfCacheTileSource, ossimNitfTileSource, ossimCcfTileSource, ossimOgrGdalTileSource, ossimAdrgTileSource, ossimDtedTileSource, ossimOgrVectorTileSource, ossimH5ImageHandler, ossimOpjJp2Reader, ossimPngReader, ossimGdalTileSource, ossimHdf5ImageHandler, ossimGpkgReader, ossimRangeDomeTileSource, ossimJpegTileSource, ossimUsgsDemTileSource, ossimKmlSuperOverlayReader, ossimVpfTileSource, ossimGeneralRasterTileSource, ossimImageCacheBase, ossimKakaduJpipHandler, ossimTiledImageHandler, ossimBandSeparateHandler, ossimplugins::ossimTerraSarTiffReader, ossimplugins::ossimRadarSat2TiffReader, ossimEnviTileSource, ossimImageHandlerMtAdaptor, ossimSrtmTileSource, and ossimQuickbirdNitfTileSource.

Definition at line 111 of file ossimImageHandler.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimKeywordNames::FILENAME_KW, ossimErrorStatusInterface::getErrorStatus(), ossimErrorCodes::OSSIM_ERROR, ossimNotify(), ossimNotifyLevel_WARN, ossimImageSource::saveState(), and theImageFile.

Referenced by ossimBandSeparateHandler::saveState(), ossimTiledImageHandler::saveState(), ossimKakaduJpipHandler::saveState(), ossimImageCacheBase::saveState(), ossimKmlSuperOverlayReader::saveState(), ossimJpegTileSource::saveState(), ossimRangeDomeTileSource::saveState(), ossimGpkgReader::saveState(), ossimHdf5ImageHandler::saveState(), ossimGdalTileSource::saveState(), ossimH5ImageHandler::saveState(), ossimOpjJp2Reader::saveState(), ossimOgrVectorTileSource::saveState(), ossimDtedTileSource::saveState(), ossimAdrgTileSource::saveState(), ossimOgrGdalTileSource::saveState(), ossimCcfTileSource::saveState(), ossimNitfTileSource::saveState(), ossimRpfCacheTileSource::saveState(), ossimTiffTileSource::saveState(), ossimPointCloudImageHandler::saveState(), ossimCibCadrgTileSource::saveState(), and ossimGeoPdfReader::saveState().

113 {
114  static const char MODULE[] = "ossimImageHandler::saveState";
115 
116  ossimImageSource::saveState(kwl, prefix);
118  {
120  << MODULE
121  << " ERROR detected in keyword list! State not saved."
122  << std::endl;
123  return false;
124  }
125 
127  kwl.add(prefix, HAS_LUT_KW, (theLut.valid()?"true":"false"), true);
128  kwl.add(prefix, ossimKeywordNames::IMAGE_ID_KW, theImageID, true);
130  kwl.add(prefix, SUPPLEMENTARY_DIRECTORY_KW, theSupplementaryDirectory.c_str(), true);
131  kwl.add(prefix, START_RES_LEVEL_KW, theStartingResLevel, true);
132  kwl.add(prefix, OPEN_OVERVIEW_FLAG_KW, (theOpenOverviewFlag?"1":"0"), true);
134 
135  return true;
136 }
static const char * OVERVIEW_FILE_KW
ossimFilename theImageFile
bool valid() const
Definition: ossimRefPtr.h:75
bool theOpenOverviewFlag
If true opening of overviews will be attempted.
static const ossimErrorCode OSSIM_ERROR
unsigned short ossim_uint16
static const char * IMAGE_ID_KW
ossimFilename theSupplementaryDirectory
ossimPixelType thePixelType
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimErrorCode getErrorStatus() const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
static const char * PIXEL_TYPE_KW
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
ossimFilename theOverviewFile
ossimRefPtr< ossimNBandLutDataObject > theLut
static const char * FILENAME_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_uint32 theStartingResLevel
theStartingResLevel If set to something other than zero(default) this is indicative that the reader i...

◆ setCurrentEntry()

bool ossimImageHandler::setCurrentEntry ( ossim_uint32  entryIdx)
virtual

◆ setFilename()

void ossimImageHandler::setFilename ( const ossimFilename filename)
virtual

Sets the filename.

Definition at line 1549 of file ossimImageHandler.cpp.

References theImageFile.

Referenced by ossimHdf5Tool::loadImageFiles(), and open().

1550 {
1551  theImageFile = filename;
1552 }
ossimFilename theImageFile

◆ setImageGeometry()

void ossimImageHandler::setImageGeometry ( ossimImageGeometry geom)
virtual

Sets the image geometry object.

Note
Callers should note that this will override any existing geometry.
This does not write the geometry to disk, to do so call one of the saveImageGeometry methods.

Definition at line 809 of file ossimImageHandler.cpp.

References theGeometry.

810 {
811  theGeometry = geom;
812 }
ossimRefPtr< ossimImageGeometry > theGeometry

◆ setImageID()

void ossimImageHandler::setImageID ( const ossimString id)
inline

Sets the image ID in case it is externally generated.

Definition at line 718 of file ossimImageHandler.h.

Referenced by ATP::AtpGenerator::constructChain().

718 { theImageID = id; }

◆ setMaxPixelValue()

void ossimImageHandler::setMaxPixelValue ( ossim_uint32  band,
const ossim_float64 pix 
)
virtual

convenience method to set max pixel value.

Added for overview readers so that the image handler that owns the overview reader can pass on it's max value.

Parameters
bandZero based band to set.
pixMax pixel value.

Reimplemented in ossimKakaduNitfReader.

Definition at line 1449 of file ossimImageHandler.cpp.

References ossimImageMetaData::setMaxPix(), and theMetaData.

Referenced by ossimKakaduNitfReader::setMaxPixelValue().

1451 {
1452  theMetaData.setMaxPix(band, pix);
1453 }
ossimImageMetaData theMetaData
void setMaxPix(ossim_uint32 band, double pix)

◆ setMinPixelValue()

void ossimImageHandler::setMinPixelValue ( ossim_uint32  band,
const ossim_float64 pix 
)
virtual

convenience method to set min pixel value.

Added for overview readers so that the image handler that owns the overview reader can pass on it's min value.

Parameters
bandZero based band to set.
pixMin pixel value.

Reimplemented in ossimKakaduNitfReader.

Definition at line 1443 of file ossimImageHandler.cpp.

References ossimImageMetaData::setMinPix(), and theMetaData.

Referenced by ossimKakaduNitfReader::setMinPixelValue().

1445 {
1446  theMetaData.setMinPix(band, pix);
1447 }
void setMinPix(ossim_uint32 band, double pix)
ossimImageMetaData theMetaData

◆ setNullPixelValue()

void ossimImageHandler::setNullPixelValue ( ossim_uint32  band,
const ossim_float64 pix 
)
virtual

convenience method to set null pixel value.

Added for overview readers so that the image handler that owns the overview reader can pass on it's max value.

Parameters
bandZero based band to set.
pixNull pixel value.

Reimplemented in ossimKakaduNitfReader.

Definition at line 1455 of file ossimImageHandler.cpp.

References ossimImageMetaData::setNullPix(), and theMetaData.

Referenced by ossimKakaduNitfReader::setNullPixelValue().

1457 {
1458  theMetaData.setNullPix(band, pix);
1459 }
ossimImageMetaData theMetaData
void setNullPix(ossim_uint32 band, double pix)

◆ setOpenOverviewFlag()

void ossimImageHandler::setOpenOverviewFlag ( bool  flag)

Sets theOpenOverviewFlag.

If true opening of overviews will be attempted on normal open. If false only the base image will be opened (shallow open). Defaulted to true in constructor.

Definition at line 1891 of file ossimImageHandler.cpp.

References theOpenOverviewFlag.

Referenced by ossimHdf5PluginHandlerFactory::open(), ossimplugins::ossimPluginReaderFactory::open(), ossimImageHandlerFactory::open(), ossimPngReaderFactory::open(), ossimKakaduReaderFactory::open(), ossimGdalFactory::openOverview(), ossimOpjReaderFactory::openOverview(), ossimImageHandlerFactory::openOverview(), and ossimKakaduReaderFactory::openOverview().

1892 {
1893  theOpenOverviewFlag = flag;
1894 
1895  // If false close overview if open??? (drb)
1896 }
bool theOpenOverviewFlag
If true opening of overviews will be attempted.

◆ setOutputBandList() [1/2]

bool ossimImageHandler::setOutputBandList ( const std::vector< ossim_uint32 > &  band_list)
virtual

If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled.

This method returns false. Derived classes that are band selectors should override.

Parameters
band_listRequested bands.
Returns
true on success, false on error.

Reimplemented in ossimGdalTileSource, ossimHdfReader, ossimGeneralRasterTileSource, and ossimTiffTileSource.

Definition at line 1278 of file ossimImageHandler.cpp.

Referenced by ossimOverviewBuilderBase::finalize(), ossimBandSelector::setOutputBandList(), ossimTiffTileSource::setOutputBandList(), ossimGeneralRasterTileSource::setOutputBandList(), setOutputBandList(), and setOutputToInputBandList().

1279 {
1280  return false;
1281 }

◆ setOutputBandList() [2/2]

bool ossimImageHandler::setOutputBandList ( const std::vector< ossim_uint32 > &  inBandList,
std::vector< ossim_uint32 > &  outBandList 
)
protectedvirtual

Convenience method to set output band list.

This performs range checking and calls theOverview->setOutputBandList on success.

Parameters
inBandListThe new band list.
outBandListBand list to initialize.
Returns
true on success, false on error.

Definition at line 1331 of file ossimImageHandler.cpp.

References ossimImageSource::getNumberOfInputBands(), ossimImageSource::getOutputBandList(), setOutputBandList(), theOverview, and ossimRefPtr< T >::valid().

1333 {
1334  bool result = false;
1335 
1336  const ossim_uint32 INPUT_BANDS = getNumberOfInputBands();
1337  const ossim_uint32 OUTPUT_BANDS = (ossim_uint32)inBandList.size();
1338 
1339  if ( INPUT_BANDS && OUTPUT_BANDS )
1340  {
1341  result = true;
1342  outBandList.resize( OUTPUT_BANDS );
1343  for ( ossim_uint32 band = 0; band < OUTPUT_BANDS; ++band )
1344  {
1345  if ( inBandList[band] < INPUT_BANDS )
1346  {
1347  outBandList[band] = inBandList[band];
1348  }
1349  else // Out of range...
1350  {
1351  result = false;
1352  break;
1353  }
1354  }
1355  if ( result && theOverview.valid() )
1356  {
1357  result = theOverview->setOutputBandList( inBandList );
1358  }
1359  }
1360 
1361  if ( result == false )
1362  {
1363  ossimImageSource::getOutputBandList( outBandList ); // Set to identity.
1364  }
1365 
1366  return result;
1367 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfInputBands() const =0
virtual bool setOutputBandList(const std::vector< ossim_uint32 > &band_list)
If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled...

◆ setOutputToInputBandList()

bool ossimImageHandler::setOutputToInputBandList ( )
virtual

If the image handler "isBandSeletor()" then the band selection of the output are set to input or identity.

Does nothing and returns false if not a band selector.

Returns
If band selector, returns the output of setOutputBandList; if not, returns false.

Definition at line 1289 of file ossimImageHandler.cpp.

References ossimImageSource::getOutputBandList(), isBandSelector(), and setOutputBandList().

Referenced by ossimOverviewBuilderBase::setInputSource().

1290 {
1291  bool result = false;
1292  if ( isBandSelector() )
1293  {
1294  std::vector<ossim_uint32> bandList;
1296  result = setOutputBandList( bandList );
1297  }
1298  return result;
1299 }
virtual void getOutputBandList(std::vector< ossim_uint32 > &bandList) const
Initializes bandList.
virtual bool isBandSelector() const
Indicates whether or not the image handler can control output band selection via the setOutputBandLis...
virtual bool setOutputBandList(const std::vector< ossim_uint32 > &band_list)
If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled...

◆ setProperty()

void ossimImageHandler::setProperty ( ossimRefPtr< ossimProperty property)
virtual

Reimplemented from ossimImageSource.

Reimplemented in ossimLasReader, ossimTiffTileSource, ossimGdalTileSource, ossimPointCloudImageHandler, ossimNitfTileSource, ossimH5ImageHandler, ossimOgrGdalTileSource, ossimHdf5ImageHandler, ossimPngReader, ossimGpkgReader, ossimRangeDomeTileSource, and ossimKakaduJpipHandler.

Definition at line 1582 of file ossimImageHandler.cpp.

References ossimKeywordNames::ENTRY_KW, ossimProperty::getName(), setCurrentEntry(), ossimRefPtr< T >::valid(), and ossimProperty::valueToString().

Referenced by ossimKakaduJpipHandler::setProperty(), ossimRangeDomeTileSource::setProperty(), ossimGpkgReader::setProperty(), ossimNitfTileSource::setProperty(), and ossimTiffTileSource::setProperty().

1583 {
1584  if ( property.valid() )
1585  {
1586  if(property->getName() == ossimKeywordNames::ENTRY_KW)
1587  {
1588  setCurrentEntry(property->valueToString().toUInt32());
1589  }
1590  else if ( property->getName() == OPEN_OVERVIEW_FLAG_KW )
1591  {
1592  setOpenOverviewFlag( property->valueToString().toBool() );
1593  }
1594  else
1595  {
1597  }
1598  }
1599 }
virtual void valueToString(ossimString &valueResult) const =0
void setOpenOverviewFlag(bool flag)
Sets theOpenOverviewFlag.
bool valid() const
Definition: ossimRefPtr.h:75
virtual void setProperty(ossimRefPtr< ossimProperty > property)
static const char * ENTRY_KW
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
const ossimString & getName() const

◆ setStartingResLevel()

void ossimImageHandler::setStartingResLevel ( ossim_uint32  level)

Definition at line 1881 of file ossimImageHandler.cpp.

References theStartingResLevel.

1882 {
1883  theStartingResLevel = level;
1884 }
ossim_uint32 theStartingResLevel
theStartingResLevel If set to something other than zero(default) this is indicative that the reader i...

◆ setState()

void ossimImageHandler::setState ( std::shared_ptr< ossim::ImageHandlerState >  state)
inline

Definition at line 742 of file ossimImageHandler.h.

Referenced by close(), and open().

742 {m_state = state;}
std::shared_ptr< ossim::ImageHandlerState > m_state

◆ setSupplementaryDirectory()

void ossimImageHandler::setSupplementaryDirectory ( const ossimFilename dir)
virtual

Sets the supplementary directory.

Definition at line 1559 of file ossimImageHandler.cpp.

References completeOpen(), ossimFilename::isDir(), ossimFilename::path(), theDecimationFactors, theOverview, theSupplementaryDirectory, and ossimRefPtr< T >::valid().

Referenced by ossimSingleImageChain::addImageHandler(), and ossimImageHandlerFactory::openSrcRecord().

1560 {
1561  if (dir.isDir())
1563  else
1565  // A change in supplementary directory presents an opportunity to find the OVR that could not be
1566  // opened previously, as well as other support data items:
1567  if (!theOverview.valid())
1568  {
1569  if (theDecimationFactors.size() > 0)
1570  {
1571  theDecimationFactors.clear();
1572  }
1573  completeOpen();
1574  }
1575 }
bool valid() const
Definition: ossimRefPtr.h:75
std::vector< ossimDpt > theDecimationFactors
bool isDir() const
ossimFilename theSupplementaryDirectory
virtual void completeOpen()
Will complete the opening process.
ossimRefPtr< ossimImageHandler > theOverview
ossimFilename path() const

◆ useEntryIndex()

bool ossimImageHandler::useEntryIndex ( ) const

Convenience method to determine if entry index should be used for support files, e.g.

file.his or file_e1.his.

Returns
true if file is open, && ( (entryList.size() > 1) || (entryList[0] != 0) ) false otherwise.
Note
This is just a hint. Put here as code was duplicated everywhere. Callers can do what they wish.

Definition at line 1481 of file ossimImageHandler.cpp.

References getEntryList(), and isOpen().

1482 {
1483  bool result = false;
1484  if ( isOpen() )
1485  {
1486  std::vector<ossim_uint32> entryList;
1487  getEntryList(entryList);
1488 
1489  if ( entryList.size() )
1490  {
1491  if ( (entryList.size() > 1) || (entryList[0] != 0) ) result = true;
1492  }
1493  }
1494  return result;
1495 }
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const

◆ writeValidImageVertices()

bool ossimImageHandler::writeValidImageVertices ( const std::vector< ossimIpt > &  vertices,
const ossimFilename file = ossimFilename("") 
)
virtual

Outputs vertices to file and updates the internal vertex array variable "theValidImageVertices".

Parameters
verticesArray of ossimIpts to write.
fileName of output file to write to. If file is empty, the output file will be the image file with no extension + _vertices.kwl. So if the image is "foo.tif" you'll get "foo_vertices.kwl".
Returns
true on success, false on error.

Definition at line 1085 of file ossimImageHandler.cpp.

References ossimKeywordlist::add(), ossimString::c_str(), ossimPolygon::checkOrdering(), createDefaultValidVerticesFilename(), ossimFilename::exists(), ossimPolygon::getOrdering(), OSSIM_COUNTERCLOCKWISE_ORDER, theValidImageVertices, ossimString::toString(), and ossimKeywordlist::write().

1086 {
1087  ossimFilename tempFile = file;
1088  if(tempFile == "")
1089  {
1091  }
1092  ossim_uint32 i = 0;
1093  ossimKeywordlist tempKwl;
1094  ossimPolygon poly(vertices);
1095 
1096  poly.checkOrdering();
1097 
1098  // Capture the vertices.
1099  theValidImageVertices = vertices;
1100 
1101  if(poly.getOrdering() == OSSIM_COUNTERCLOCKWISE_ORDER)
1102  {
1103  std::reverse(theValidImageVertices.begin(), theValidImageVertices.end());
1104  }
1105 
1106  if(theValidImageVertices.size())
1107  {
1108  for(i = 0; i < theValidImageVertices.size(); ++i)
1109  {
1110  ossimString prefix = ossimString("point") + ossimString::toString(i) + ".";
1111  tempKwl.add(prefix.c_str(),
1112  "x",
1113  theValidImageVertices[i].x,
1114  true);
1115  tempKwl.add(prefix.c_str(),
1116  "y",
1117  theValidImageVertices[i].y,
1118  true);
1119  }
1120 
1121  tempKwl.write(tempFile.c_str());
1122  }
1123 
1124  if ( tempFile.exists() )
1125  {
1126  return true;
1127  }
1128 
1129  return false; // Write of file failed.
1130 }
Represents serializable keyword/value map.
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool write(const char *file, const char *comment=0) const
Methods to dump the ossimKeywordlist to a file on disk.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossimFilename createDefaultValidVerticesFilename() const
bool exists() const
unsigned int ossim_uint32
vector< ossimIpt > theValidImageVertices
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

Member Data Documentation

◆ m_state

std::shared_ptr<ossim::ImageHandlerState> ossimImageHandler::m_state
protected

Definition at line 856 of file ossimImageHandler.h.

Referenced by initVertices(), and loadMetaData().

◆ theDecimationFactors

std::vector<ossimDpt> ossimImageHandler::theDecimationFactors
protected

◆ theGeometry

ossimRefPtr<ossimImageGeometry> ossimImageHandler::theGeometry
mutableprotected

Definition at line 838 of file ossimImageHandler.h.

Referenced by ossimRangeDomeTileSource::close(), close(), ossimMrSidReader::getDecimationFactor(), ossimMrSidReader::getDecimationFactors(), ossimViirsHandler::getImageGeometry(), ossimQuickbirdTiffTileSource::getImageGeometry(), ossimDoqqTileSource::getImageGeometry(), ossimQbTileFilesHandler::getImageGeometry(), ossimERSTileSource::getImageGeometry(), ossimVideoImageHandler::getImageGeometry(), ossimKakaduJpipHandler::getImageGeometry(), ossimRangeDomeTileSource::getImageGeometry(), ossimVpfTileSource::getImageGeometry(), ossimDtedTileSource::getImageGeometry(), ossimGdalTileSource::getImageGeometry(), ossimAdrgTileSource::getImageGeometry(), ossimGeneralRasterTileSource::getImageGeometry(), ossimUsgsDemTileSource::getImageGeometry(), ossimHdfReader::getImageGeometry(), ossimOpjJp2Reader::getImageGeometry(), ossimJpegTileSource::getImageGeometry(), ossimMG4LidarReader::getImageGeometry(), ossimPointCloudImageHandler::getImageGeometry(), ossimGeoPdfReader::getImageGeometry(), ossimMrSidReader::getImageGeometry(), ossimH5ImageHandler::getImageGeometry(), ossimLasReader::getImageGeometry(), ossimRpfCacheTileSource::getImageGeometry(), ossimKakaduJp2Reader::getImageGeometry(), ossimPngReader::getImageGeometry(), ossimGpkgReader::getImageGeometry(), ossimCibCadrgTileSource::getImageGeometry(), getImageGeometry(), ossimOgrGdalTileSource::getInternalImageGeometry(), ossimRangeDomeTileSource::getNumberOfLines(), ossimPointCloudImageHandler::getNumberOfLines(), ossimRangeDomeTileSource::getNumberOfSamples(), ossimPointCloudImageHandler::getNumberOfSamples(), ossimMrSidReader::getTile(), ossimPointCloudImageHandler::getTile(), ossimRangeDomeTileSource::getTile(), ossimPointCloudImageHandler::getValidImageVertices(), ossimRangeDomeTileSource::initialize(), saveImageGeometry(), ossimHdfReader::setCurrentEntry(), ossimH5ImageHandler::setCurrentEntry(), ossimGdalTileSource::setCurrentEntry(), ossimGeoPdfReader::setCurrentEntry(), ossimNitfTileSource::setCurrentEntry(), ossimGpkgReader::setCurrentEntry(), ossimRpfCacheTileSource::setCurrentEntry(), ossimCibCadrgTileSource::setCurrentEntry(), ossimPointCloudImageHandler::setGSD(), and setImageGeometry().

◆ theImageFile

ossimFilename ossimImageHandler::theImageFile
protected

Definition at line 832 of file ossimImageHandler.h.

Referenced by ossimQbTileFilesHandler::computeImageRects(), createDefaultValidVerticesFilename(), ossimBandSeparateHandler::getBandFileNames(), ossimMrSidReader::getExternalImageGeometry(), ossimGdalTileSource::getExternalImageGeometryFromXml(), getFilename(), ossimMrSidReader::getGeoProjection(), ossimGeneralRasterTileSource::getHdrInfo(), ossimQuickbirdTiffTileSource::getImageGeometry(), ossimQbTileFilesHandler::getImageGeometry(), ossimGeneralRasterTileSource::getImageGeometry(), ossimH5ImageHandler::getLatLonDatasets(), ossimCibCadrgTileSource::getPropertyNames(), ossimKmlSuperOverlayReader::getTopLevelKmlFileInfo(), ossimGeneralRasterTileSource::getXmlInfo(), if(), ossimKakaduJp2Reader::isJp2(), ossimOgrVectorTileSource::isOgrVectorDataSource(), ossimKmlSuperOverlayReader::isOpen(), ossimGeoPdfReader::isOpen(), ossimRpfCacheTileSource::isOpen(), ossimBitMaskTileSource::isSupportedExtension(), ossimHdfReader::isSupportedExtension(), ossimDtedTileSource::loadMetaData(), ossimDtedTileSource::loadState(), ossimVpfTileSource::open(), ossimKmlSuperOverlayReader::open(), ossimPointCloudImageHandler::open(), ossimTiffTileSource::open(), ossimOgrGdalTileSource::open(), ossimRangeDomeTileSource::open(), ossimBitMaskTileSource::open(), ossimJpegTileSource::open(), ossimPngReader::open(), openValidVertices(), ossimTiffTileSource::print(), ossimPngReader::restart(), saveState(), setFilename(), and ossimTiffTileSource::validateMinMaxNull().

◆ theImageID

ossimString ossimImageHandler::theImageID
protected

Definition at line 841 of file ossimImageHandler.h.

◆ theLut

ossimRefPtr<ossimNBandLutDataObject> ossimImageHandler::theLut
protected

◆ theMetaData

ossimImageMetaData ossimImageHandler::theMetaData
protected

◆ theOpenOverviewFlag

bool ossimImageHandler::theOpenOverviewFlag
protected

If true opening of overviews will be attempted.

If false only the base image will be opened (shallow open). Defaulted to true in constructor.

Definition at line 853 of file ossimImageHandler.h.

Referenced by getOpenOverviewFlag(), and setOpenOverviewFlag().

◆ theOverview

ossimRefPtr<ossimImageHandler> ossimImageHandler::theOverview
protected

Definition at line 835 of file ossimImageHandler.h.

Referenced by close(), closeOverview(), ossimRpfCacheTileSource::deleteAll(), ossimCibCadrgTileSource::deleteAll(), ossimNitfTileSource::destroy(), ossimKakaduJ2kReader::getDecimationFactor(), ossimGdalTileSource::getMaxSize(), ossimKakaduJpipHandler::getNumberOfDecimationLevels(), ossimKakaduNitfReader::getNumberOfDecimationLevels(), ossimOpjJp2Reader::getNumberOfDecimationLevels(), ossimGdalTileSource::getNumberOfDecimationLevels(), ossimMG4LidarReader::getNumberOfDecimationLevels(), ossimMrSidReader::getNumberOfDecimationLevels(), ossimKakaduJp2Reader::getNumberOfDecimationLevels(), ossimKakaduJ2kReader::getNumberOfDecimationLevels(), ossimTiffTileSource::getNumberOfDecimationLevels(), ossimGpkgReader::getNumberOfDecimationLevels(), getNumberOfDecimationLevels(), ossimKakaduJpipHandler::getNumberOfLines(), ossimUsgsDemTileSource::getNumberOfLines(), ossimJpegTileSource::getNumberOfLines(), ossimGdalTileSource::getNumberOfLines(), ossimGpkgReader::getNumberOfLines(), ossimHdf5ImageHandler::getNumberOfLines(), ossimDtedTileSource::getNumberOfLines(), ossimOpjJp2Reader::getNumberOfLines(), ossimPngReader::getNumberOfLines(), ossimH5ImageHandler::getNumberOfLines(), ossimAdrgTileSource::getNumberOfLines(), ossimKakaduNitfReader::getNumberOfLines(), ossimRpfCacheTileSource::getNumberOfLines(), ossimHdfReader::getNumberOfLines(), ossimNitfTileSource::getNumberOfLines(), ossimTiffTileSource::getNumberOfLines(), ossimCibCadrgTileSource::getNumberOfLines(), ossimMG4LidarReader::getNumberOfLines(), ossimGeoPdfReader::getNumberOfLines(), ossimMrSidReader::getNumberOfLines(), ossimKakaduJp2Reader::getNumberOfLines(), ossimKakaduJpipHandler::getNumberOfSamples(), ossimUsgsDemTileSource::getNumberOfSamples(), ossimJpegTileSource::getNumberOfSamples(), ossimGdalTileSource::getNumberOfSamples(), ossimGpkgReader::getNumberOfSamples(), ossimHdf5ImageHandler::getNumberOfSamples(), ossimDtedTileSource::getNumberOfSamples(), ossimOpjJp2Reader::getNumberOfSamples(), ossimH5ImageHandler::getNumberOfSamples(), ossimPngReader::getNumberOfSamples(), ossimAdrgTileSource::getNumberOfSamples(), ossimKakaduNitfReader::getNumberOfSamples(), ossimRpfCacheTileSource::getNumberOfSamples(), ossimNitfTileSource::getNumberOfSamples(), ossimHdfReader::getNumberOfSamples(), ossimTiffTileSource::getNumberOfSamples(), ossimCibCadrgTileSource::getNumberOfSamples(), ossimMG4LidarReader::getNumberOfSamples(), ossimGeoPdfReader::getNumberOfSamples(), ossimMrSidReader::getNumberOfSamples(), ossimKakaduJp2Reader::getNumberOfSamples(), getOverview(), ossimKakaduNitfReader::getOverviewTile(), ossimKakaduJ2kReader::getOverviewTile(), ossimKakaduJp2Reader::getOverviewTile(), getOverviewTile(), ossimGdalTileSource::getTile(), ossimBandSeparateHandler::getTile(), ossimMrSidReader::getTile(), ossimMG4LidarReader::getTile(), ossimTiledImageHandler::getTile(), ossimKakaduJpipHandler::getTileAtRes(), ossimTiffTileSource::isBandSelector(), ossimGeneralRasterTileSource::isBandSelector(), ossimJpegTileSource::isValidRLevel(), ossimRpfCacheTileSource::isValidRLevel(), ossimCibCadrgTileSource::isValidRLevel(), ossimTiffTileSource::print(), ossimHdfReader::setCurrentEntry(), ossimGdalTileSource::setCurrentEntry(), setOutputBandList(), setSupplementaryDirectory(), and ~ossimImageHandler().

◆ theOverviewFile

ossimFilename ossimImageHandler::theOverviewFile
protected

◆ thePixelType

ossimPixelType ossimImageHandler::thePixelType
mutableprotected

◆ theStartingResLevel

ossim_uint32 ossimImageHandler::theStartingResLevel
protected

◆ theSupplementaryDirectory

ossimFilename ossimImageHandler::theSupplementaryDirectory
protected

◆ theValidImageVertices

vector<ossimIpt> ossimImageHandler::theValidImageVertices
protected

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