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

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

#include <ossimBandSeparateHandler.h>

Inheritance diagram for ossimBandSeparateHandler:
ossimImageHandler ossimImageSource ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimBandSeparateHandler ()
 Constructor (default): More...
 
virtual ~ossimBandSeparateHandler ()
 Destructor: More...
 
virtual bool open ()
 Opens multiple band-files based on info in metadata file. More...
 
virtual void close ()
 Closes all band-files and clears input handler list. More...
 
virtual bool isOpen () const
 Derived classes must implement this method to be concrete. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const
 
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 ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel)
 Fills the requested tile by pulling pixels from multiple file tiles as needed. More...
 
virtual ossimScalarType getOutputScalarType () const
 Returns scalar type of first band (should be the same for all bands) More...
 
virtual bool canConnectMyOutputTo (ossim_int32 index, const ossimConnectableObject *obj)
 Overrides base connection method to connect output of merge source. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the geometry of the first band: More...
 
virtual ossim_uint32 getImageTileWidth () const
 These images are not tiled. More...
 
virtual ossim_uint32 getImageTileHeight () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
- Public Member Functions inherited from ossimImageHandler
 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 (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 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 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 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 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 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 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 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 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 void getBandFileNames (vector< ossimFilename > &file_names)
 Fetches the list of band file names from the header file. More...
 
- Protected Member Functions inherited from ossimImageHandler
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

vector< ossimRefPtr< ossimImageHandler > > m_bandFiles
 
ossimRefPtr< ossimBandMergeSourcem_mergeSource
 
- Protected Attributes inherited from ossimImageHandler
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
 

Additional Inherited Members

- Public Types inherited from ossimImageHandler
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
 

Detailed Description

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

Definition at line 27 of file ossimBandSeparateHandler.h.

Constructor & Destructor Documentation

◆ ossimBandSeparateHandler()

ossimBandSeparateHandler::ossimBandSeparateHandler ( )

Constructor (default):

Definition at line 32 of file ossimBandSeparateHandler.cpp.

33 { }

◆ ~ossimBandSeparateHandler()

ossimBandSeparateHandler::~ossimBandSeparateHandler ( )
virtual

Destructor:

Definition at line 38 of file ossimBandSeparateHandler.cpp.

References close().

39 {
40  close();
41 }
virtual void close()
Closes all band-files and clears input handler list.

Member Function Documentation

◆ canConnectMyOutputTo()

bool ossimBandSeparateHandler::canConnectMyOutputTo ( ossim_int32  index,
const ossimConnectableObject obj 
)
virtual

Overrides base connection method to connect output of merge source.

Definition at line 204 of file ossimBandSeparateHandler.cpp.

References ossimConnectableObject::canConnectMyOutputTo(), m_mergeSource, and ossimRefPtr< T >::valid().

206 {
207  if (!m_mergeSource.valid())
208  return false;
209 
210  return m_mergeSource->canConnectMyOutputTo(index, obj);
211 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimBandMergeSource > m_mergeSource
virtual bool canConnectMyOutputTo(ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
default implementation is to allow anyone to connect to us.

◆ close()

void ossimBandSeparateHandler::close ( )
virtual

Closes all band-files and clears input handler list.

Deletes the overview and clears the valid image vertices.

Derived classes should implement.

Reimplemented from ossimImageHandler.

Definition at line 87 of file ossimBandSeparateHandler.cpp.

References m_bandFiles, and m_mergeSource.

Referenced by open(), and ~ossimBandSeparateHandler().

88 {
89  vector<ossimRefPtr<ossimImageHandler> >::iterator iter = m_bandFiles.begin();
90  while (iter != m_bandFiles.end())
91  {
92  (*iter)->close();
93  *iter = 0;
94  ++iter;
95  }
96  m_bandFiles.clear();
97  m_mergeSource = 0;
98 }
ossimRefPtr< ossimBandMergeSource > m_mergeSource
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles

◆ getBandFileNames()

void ossimBandSeparateHandler::getBandFileNames ( vector< ossimFilename > &  file_names)
protectedvirtual

Fetches the list of band file names from the header file.

The header file name is contained in ossimImageHandler::theImageFile. NOTE TO PROGRAMMER: This class is presently tailored to the Ikonos metadata file specifying the individual band files. If other "metadata" formats are to be supported, then this class should be derived from. This method would therefore be pure virtual in this base-class and only this method would need to be implemented in the derived classes.

Definition at line 221 of file ossimBandSeparateHandler.cpp.

References ossimString::after(), ossimString::chars(), ossimString::contains(), ossimFilename::ext(), ossimNotify(), ossimNotifyLevel_WARN, ossimFilename::path(), ossimString::push_back(), ossimFilename::setPath(), ossimString::split(), and ossimImageHandler::theImageFile.

Referenced by open().

222 {
223  file_names.clear();
224 
225  // Ikonos expects metadata file with text extension:
226  if (theImageFile.ext() != "txt")
227  return;
228 
229  // Attempt to open the metadata file:
230  ifstream is (theImageFile.chars());
231  if (is.fail())
232  {
233  ossimNotify(ossimNotifyLevel_WARN)<<"ossimBandSeparateHandler::open() -- "
234  "Cannot open text file at <"<<theImageFile<<">. Image not opened."<<endl;
235  return;
236  }
237 
238  vector<ossimString> fname_list;
239  const ossimString separator (" ");
240  char line_buf[4096];
241  while (!is.eof())
242  {
243  is.getline(line_buf, 4096);
244  ossimString line_str (line_buf);
245 
246  // Look for mention of multiple band files. It must indicate "separate files". This comes
247  // before the list of band files:
248  if (line_str.contains("Multispectral Files:"))
249  {
250  if (!line_str.contains("Separate Files"))
251  return;
252  }
253 
254  // Look for list of band files:
255  if (line_str.contains("Tile File Name:"))
256  {
257  ossimString file_list_str = line_str.after(":");
258  file_list_str.split(fname_list, separator, true);
259  break;
260  }
261  }
262  is.close();
263 
264  // Set the path of individual band files to match metadata file path:
265  ossimFilename pathName (theImageFile.path());
266  for (size_t i=0; i<fname_list.size(); ++i)
267  {
268  ossimFilename fname (fname_list[i]);
269  fname.setPath(pathName);
270  file_names.push_back(fname);
271  }
272 }
ossimFilename theImageFile
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
const char * chars() const
For backward compatibility.
Definition: ossimString.h:77
ossimString ext() const
ossimString after(const ossimString &str, std::string::size_type pos=0) const
METHOD: after(str, pos) Returns string immediately after the token str.
ossimFilename path() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimBandSeparateHandler::getImageGeometry ( )
virtual

Returns the geometry of the first band:

Returns the geometry of the first band.

Reimplemented from ossimImageHandler.

Definition at line 277 of file ossimBandSeparateHandler.cpp.

References m_bandFiles.

278 {
279  if ((m_bandFiles.size() == 0) || (!m_bandFiles[0].valid()))
280  return 0;
281 
282  return m_bandFiles[0]->getImageGeometry();
283 }
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles

◆ getImageTileHeight()

virtual ossim_uint32 ossimBandSeparateHandler::getImageTileHeight ( ) const
inlinevirtual

Returns the tile width of the image or 0 if the image is not tiled.

Note: this is not the same as the ossimImageSource::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk.

Implements ossimImageHandler.

Definition at line 80 of file ossimBandSeparateHandler.h.

80 { return 0; }

◆ getImageTileWidth()

virtual ossim_uint32 ossimBandSeparateHandler::getImageTileWidth ( ) const
inlinevirtual

These images are not tiled.

Implements ossimImageHandler.

Definition at line 79 of file ossimBandSeparateHandler.h.

79 { return 0; }

◆ getNumberOfInputBands()

ossim_uint32 ossimBandSeparateHandler::getNumberOfInputBands ( ) const
virtual

Returns the number of bands available from the input.

Implements ossimImageSource.

Definition at line 184 of file ossimBandSeparateHandler.cpp.

References m_bandFiles.

185 {
186  return (ossim_uint32) m_bandFiles.size();
187 }
unsigned int ossim_uint32
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles

◆ getNumberOfLines()

ossim_uint32 ossimBandSeparateHandler::getNumberOfLines ( ossim_uint32  resLevel = 0) const
virtual
Parameters
resLevelReduced resolution level to return lines of. Default = 0
Returns
The number of lines for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 135 of file ossimBandSeparateHandler.cpp.

References m_bandFiles.

136 {
137  if ((m_bandFiles.size() == 0))
138  return 0;
139 
140  // Using simple decimation by powers of 2:
141  ossim_uint32 numlines = m_bandFiles[0]->getNumberOfLines() >> resLevel;
142  return numlines;
143 }
unsigned int ossim_uint32
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles

◆ getNumberOfSamples()

ossim_uint32 ossimBandSeparateHandler::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
virtual
Parameters
resLevelReduced resolution level to return samples of. Default = 0
Returns
The number of samples for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 150 of file ossimBandSeparateHandler.cpp.

References m_bandFiles.

151 {
152  if ((m_bandFiles.size() == 0))
153  return 0;
154 
155  // Using simple decimation by powers of 2:
156  ossim_uint32 numsamps = m_bandFiles[0]->getNumberOfSamples() >> resLevel;
157  return numsamps;
158 }
unsigned int ossim_uint32
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles

◆ getOutputScalarType()

ossimScalarType ossimBandSeparateHandler::getOutputScalarType ( ) const
virtual

Returns scalar type of first band (should be the same for all bands)

Returns scalar type of first tile (should be the same for all tiles)

Reimplemented from ossimImageSource.

Definition at line 192 of file ossimBandSeparateHandler.cpp.

References m_bandFiles, and OSSIM_SCALAR_UNKNOWN.

193 {
194  if ((m_bandFiles.size() == 0) || (!m_bandFiles[0].valid()))
195  return OSSIM_SCALAR_UNKNOWN;
196 
197  return m_bandFiles[0]->getOutputScalarType();
198 }
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles

◆ getTile()

ossimRefPtr< ossimImageData > ossimBandSeparateHandler::getTile ( const ossimIrect rect,
ossim_uint32  resLevel 
)
virtual

Fills the requested tile by pulling pixels from multiple file tiles as needed.

Reimplemented from ossimImageSource.

Definition at line 115 of file ossimBandSeparateHandler.cpp.

References ossimBandMergeSource::getTile(), ossimImageSource::getTile(), m_bandFiles, m_mergeSource, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

117 {
118  // First verify that there are band-files available:
119  if ((m_bandFiles.size() == 0) || !m_mergeSource.valid())
121 
122  // Check if res level represents data in the overview:
123  if (theOverview.valid() && (resLevel > 0))
124  return theOverview->getTile(tile_rect, resLevel);
125 
126  // Just pass getTile call on to contained bandMergeSource:
127  return m_mergeSource->getTile(tile_rect, resLevel);
128 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > theOverview
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
This will merge all the bands from the input source list into one contiguous ossimImageData object...
ossimRefPtr< ossimBandMergeSource > m_mergeSource
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ isOpen()

bool ossimBandSeparateHandler::isOpen ( ) const
virtual

Derived classes must implement this method to be concrete.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 104 of file ossimBandSeparateHandler.cpp.

References m_bandFiles.

Referenced by open().

105 {
106  if (m_bandFiles.size() > 0)
107  return true;
108 
109  return false;
110 }
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles

◆ loadState()

bool ossimBandSeparateHandler::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 ossimImageHandler.

Definition at line 173 of file ossimBandSeparateHandler.cpp.

References ossimImageHandler::loadState(), and open().

174 {
175  if (!ossimImageHandler::loadState(kwl, prefix))
176  return false;
177 
178  return open();
179 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual bool open()
Opens multiple band-files based on info in metadata file.

◆ open()

bool ossimBandSeparateHandler::open ( )
virtual

Opens multiple band-files based on info in metadata file.

Returns
Returns true on success, false on error.

Implements ossimImageHandler.

Definition at line 46 of file ossimBandSeparateHandler.cpp.

References close(), ossimImageHandler::completeOpen(), ossimConnectableObject::connectMyInputTo(), ossimRefPtr< T >::get(), getBandFileNames(), ossimImageHandlerRegistry::instance(), isOpen(), m_bandFiles, m_mergeSource, ossimImageHandlerRegistry::open(), ossimNotify(), ossimNotifyLevel_WARN, and ossimRefPtr< T >::valid().

Referenced by loadState().

47 {
48  if (isOpen())
49  close();
50 
51  // Fetch the list of band filenames:
52  vector<ossimFilename> file_names;
53  getBandFileNames(file_names);
54 
55  // There should be a list of filenames populated:
56  if (file_names.size() == 0)
57  return false;
58 
61  for (ossim_uint32 band=0; band<file_names.size(); ++band)
62  {
63  // Open input band file:
64  handler = ossimImageHandlerRegistry::instance()->open(file_names[band], true, false);
65  if (!handler.valid())
66  {
67  ossimNotify(ossimNotifyLevel_WARN)<<"ossimBandSeparateHandler::open() -- "
68  "Expected to find band file at <"<<file_names[band]<<"> but could not open file."
69  " Image not opened."<<endl;
70  close();
71  return false;
72  }
73 
74  // Add this band file to the merge source:
75  m_bandFiles.push_back(handler);
76  m_mergeSource->connectMyInputTo(band, handler.get());
77  }
78 
79  completeOpen();
80  return true;
81 }
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
unsigned int ossim_uint32
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 completeOpen()
Will complete the opening process.
ossimRefPtr< ossimBandMergeSource > m_mergeSource
virtual void getBandFileNames(vector< ossimFilename > &file_names)
Fetches the list of band file names from the header file.
vector< ossimRefPtr< ossimImageHandler > > m_bandFiles
static ossimImageHandlerRegistry * instance()
virtual void close()
Closes all band-files and clears input handler list.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveState()

bool ossimBandSeparateHandler::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 ossimImageHandler.

Definition at line 164 of file ossimBandSeparateHandler.cpp.

References ossimImageHandler::saveState().

165 {
166  return ossimImageHandler::saveState(kwl, prefix);
167 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

Member Data Documentation

◆ m_bandFiles

vector<ossimRefPtr<ossimImageHandler> > ossimBandSeparateHandler::m_bandFiles
protected

◆ m_mergeSource

ossimRefPtr<ossimBandMergeSource> ossimBandSeparateHandler::m_mergeSource
protected

Definition at line 92 of file ossimBandSeparateHandler.h.

Referenced by canConnectMyOutputTo(), close(), getTile(), and open().


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