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

#include <ossimHdfReader.h>

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

Public Member Functions

 ossimHdfReader ()
 default construtor More...
 
virtual ~ossimHdfReader ()
 virtural destructor More...
 
virtual ossimString getShortName () const
 Returns short name. More...
 
virtual ossimString getLongName () const
 Returns long name. More...
 
virtual ossimString getClassName () const
 Returns class name. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 Method to grab a tile(rectangle) from image. More...
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 Returns the number of bands in the image. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossim_uint32 getImageTileWidth () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossim_uint32 getImageTileHeight () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const
 Gets number of lines for res level. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const
 Gets the number of samples for res level. More...
 
virtual bool open ()
 Open method. More...
 
virtual bool isOpen () const
 Method to test for open file stream. More...
 
virtual void close ()
 Method to close current entry. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. 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 setCurrentEntry (ossim_uint32 entryIdx)
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
virtual ossim_uint32 getCurrentEntry () const
 
bool isSupportedExtension ()
 
std::vector< ossim_uint32getCurrentEntryList (ossim_uint32 entryId) const
 
ossimString getEntryString (ossim_uint32 entryId) const
 
ossimString getDriverName ()
 
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...
 
- 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 saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to 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 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 void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
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 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 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 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 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
 

Private Member Functions

bool isSDSDataset (ossimString fileName)
 

Private Attributes

ossimRefPtr< ossimGdalTileSourcem_gdalTileSource
 
std::vector< ossim_uint32m_entryFileList
 
ossim_uint32 m_numberOfBands
 
ossimScalarType m_scalarType
 
ossim_uint32 m_currentEntryRender
 
ossimRefPtr< ossimImageDatam_tile
 

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
 
- 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 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
 

Detailed Description

Definition at line 30 of file ossimHdfReader.h.

Constructor & Destructor Documentation

◆ ossimHdfReader()

ossimHdfReader::ossimHdfReader ( )

default construtor

Definition at line 36 of file ossimHdfReader.cpp.

40  m_numberOfBands(0),
43  m_tile(0)
44 {
45 }
ossimRefPtr< ossimImageData > m_tile
ossimScalarType m_scalarType
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
ossim_uint32 m_currentEntryRender
std::vector< ossim_uint32 > m_entryFileList
ossim_uint32 m_numberOfBands
ossimImageHandler()
Constructor (default):

◆ ~ossimHdfReader()

ossimHdfReader::~ossimHdfReader ( )
virtual

virtural destructor

Definition at line 47 of file ossimHdfReader.cpp.

References close(), and ossimImageHandler::close().

48 {
49  close();
51 }
virtual void close()
Method to close current entry.
virtual void close()
Deletes the overview and clears the valid image vertices.

Member Function Documentation

◆ close()

void ossimHdfReader::close ( )
virtual

Method to close current entry.

Reimplemented from ossimImageHandler.

Definition at line 210 of file ossimHdfReader.cpp.

References m_entryFileList, m_gdalTileSource, m_tile, and ossimRefPtr< T >::valid().

Referenced by ~ossimHdfReader().

211 {
212  m_tile = 0;
213 
214  if (m_gdalTileSource.valid())
215  {
216  m_gdalTileSource = 0;
217  }
218  m_entryFileList.clear();
219 }
ossimRefPtr< ossimImageData > m_tile
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
std::vector< ossim_uint32 > m_entryFileList

◆ getClassName()

ossimString ossimHdfReader::getClassName ( ) const
virtual

Returns class name.

Returns
"ossimHdfReader"

Reimplemented from ossimObject.

Definition at line 63 of file ossimHdfReader.cpp.

64 {
65  return ossimString("ossimHdfReader");
66 }

◆ getCurrentEntry()

virtual ossim_uint32 ossimHdfReader::getCurrentEntry ( ) const
inlinevirtual
Returns
The current entry number.

Reimplemented from ossimImageHandler.

Definition at line 177 of file ossimHdfReader.h.

177 { return m_currentEntryRender; }
ossim_uint32 m_currentEntryRender

◆ getCurrentEntryList()

std::vector<ossim_uint32> ossimHdfReader::getCurrentEntryList ( ossim_uint32  entryId) const

◆ getDriverName()

ossimString ossimHdfReader::getDriverName ( )

Definition at line 418 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getDriver(), m_gdalTileSource, and ossimRefPtr< T >::valid().

419 {
420  ossimString result = "";
421  if (m_gdalTileSource.valid())
422  {
423  GDALDriverH driver = m_gdalTileSource->getDriver();
424  if (driver)
425  {
426  result = GDALGetDriverShortName(driver);
427  }
428  }
429  return result;
430 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource

◆ getEntryList()

void ossimHdfReader::getEntryList ( std::vector< ossim_uint32 > &  entryList) const
virtual
Parameters
entryListThis is the list to initialize with entry indexes.
Note
This implementation returns puts one entry "0" in the list.

Reimplemented from ossimImageHandler.

Definition at line 395 of file ossimHdfReader.cpp.

References m_entryFileList.

396 {
397  entryList.clear();
398  for (ossim_uint32 i = 0; i < m_entryFileList.size(); i++)
399  {
400  entryList.push_back(m_entryFileList[i]);
401  }
402 }
unsigned int ossim_uint32
std::vector< ossim_uint32 > m_entryFileList

◆ getEntryString()

ossimString ossimHdfReader::getEntryString ( ossim_uint32  entryId) const

Definition at line 404 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getEntryNames(), m_gdalTileSource, and ossimRefPtr< T >::valid().

405 {
406  if (m_gdalTileSource.valid())
407  {
408  std::vector<ossimString> entryStringList;
409  m_gdalTileSource->getEntryNames(entryStringList);
410  if (entryId < entryStringList.size())
411  {
412  return entryStringList[entryId];
413  }
414  }
415  return "";
416 }
virtual void getEntryNames(std::vector< ossimString > &entryStringList) const
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimHdfReader::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 ossimImageHandler.

Definition at line 353 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getImageGeometry(), m_gdalTileSource, ossimImageHandler::theGeometry, and ossimRefPtr< T >::valid().

354 {
355  if ( !theGeometry )
356  {
357  // Check the internal geometry first to avoid a factory call.
358  if ( m_gdalTileSource.valid() )
359  {
361  }
362  }
363  return theGeometry;
364 }
ossimRefPtr< ossimImageGeometry > theGeometry
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource

◆ getImageTileHeight()

ossim_uint32 ossimHdfReader::getImageTileHeight ( ) const
virtual

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

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

Implements ossimImageHandler.

Definition at line 334 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getImageTileHeight(), m_gdalTileSource, and ossimRefPtr< T >::valid().

335 {
336  ossim_uint32 result = 128;
337  if (m_gdalTileSource.valid())
338  {
340  }
341  return result;
342 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
unsigned int ossim_uint32
virtual ossim_uint32 getImageTileHeight() const
Returns the tile width of the image or 0 if the image is not tiled.

◆ getImageTileWidth()

ossim_uint32 ossimHdfReader::getImageTileWidth ( ) const
virtual

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 324 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getImageTileWidth(), m_gdalTileSource, and ossimRefPtr< T >::valid().

325 {
326  ossim_uint32 result = 128;
327  if (m_gdalTileSource.valid())
328  {
330  }
331  return result;
332 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
unsigned int ossim_uint32

◆ getLongName()

ossimString ossimHdfReader::getLongName ( ) const
virtual

Returns long name.

Returns
"ossim hdf reader"

Reimplemented from ossimObject.

Definition at line 58 of file ossimHdfReader.cpp.

59 {
60  return ossimString("ossim hdf reader");
61 }

◆ getNumberOfEntries()

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

Reimplemented from ossimImageHandler.

Definition at line 390 of file ossimHdfReader.cpp.

References m_entryFileList.

391 {
392  return m_entryFileList.size();
393 }
std::vector< ossim_uint32 > m_entryFileList

◆ getNumberOfInputBands()

ossim_uint32 ossimHdfReader::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageSource.

Definition at line 314 of file ossimHdfReader.cpp.

References m_numberOfBands.

315 {
316  return m_numberOfBands;
317 }
ossim_uint32 m_numberOfBands

◆ getNumberOfLines()

ossim_uint32 ossimHdfReader::getNumberOfLines ( ossim_uint32  resLevel = 0) const
virtual

Gets number of lines for res level.

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 68 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getNumberOfLines(), ossimImageHandler::getNumberOfSamples(), m_gdalTileSource, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

70 {
71  ossim_uint32 result = 0;
72  if (resLevel == 0)
73  {
74  if (m_gdalTileSource.valid())
75  {
76  result = m_gdalTileSource->getNumberOfLines(resLevel);
77  }
78  }
79  else if (theOverview.valid())
80  {
81  result = theOverview->getNumberOfSamples(resLevel);
82  }
83  return result;
84 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Returns the number of bands in the image.
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getNumberOfOutputBands()

ossim_uint32 ossimHdfReader::getNumberOfOutputBands ( ) const
virtual

Returns the number of bands in a tile returned from this TileSource.

Note: we are supporting sources that can have multiple data objects. If you want to know the scalar type of an object you can pass in the

Reimplemented from ossimImageSource.

Definition at line 319 of file ossimHdfReader.cpp.

References m_numberOfBands.

Referenced by getTile().

320 {
321  return m_numberOfBands;
322 }
ossim_uint32 m_numberOfBands

◆ getNumberOfSamples()

ossim_uint32 ossimHdfReader::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
virtual

Gets the number of samples for res level.

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 86 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getNumberOfSamples(), ossimImageHandler::getNumberOfSamples(), m_gdalTileSource, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

88 {
89  ossim_uint32 result = 0;
90  if (resLevel == 0)
91  {
92  if (m_gdalTileSource.valid())
93  {
94  result = m_gdalTileSource->getNumberOfSamples(resLevel);
95  }
96  }
97  else if (theOverview.valid())
98  {
99  result = theOverview->getNumberOfSamples(resLevel);
100  }
101  return result;
102 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Returns the number of bands available from an image.
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getOutputScalarType()

ossimScalarType ossimHdfReader::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 344 of file ossimHdfReader.cpp.

References ossimGdalTileSource::getOutputScalarType(), m_gdalTileSource, m_scalarType, and ossimRefPtr< T >::valid().

345 {
346  if (m_gdalTileSource.valid())
347  {
349  }
350  return m_scalarType;
351 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimScalarType m_scalarType
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.

◆ getShortName()

ossimString ossimHdfReader::getShortName ( ) const
virtual

Returns short name.

Returns
"ossim_hdf_reader"

Reimplemented from ossimObject.

Definition at line 53 of file ossimHdfReader.cpp.

54 {
55  return ossimString("ossim_hdf_reader");
56 }

◆ getTile() [1/2]

ossimRefPtr< ossimImageData > ossimHdfReader::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual

Method to grab a tile(rectangle) from image.

Parameters
rectThe zero based rectangle to grab.
resLevelThe reduced resolution level to grab from.
Returns
The ref pointer with the image data pointer.

Reimplemented from ossimImageSource.

Definition at line 221 of file ossimHdfReader.cpp.

References ossimRefPtr< T >::get(), ossimDataObject::getDataObjectStatus(), m_tile, ossimImageData::makeBlank(), OSSIM_NULL, ossimImageData::setImageRectangle(), and ossimRefPtr< T >::valid().

223 {
224  if (m_tile.valid())
225  {
226  // Image rectangle must be set prior to calling getTile.
227  m_tile->setImageRectangle(tile_rect);
228 
229  if ( getTile( m_tile.get(), resLevel ) == false )
230  {
232  {
233  m_tile->makeBlank();
234  }
235  }
236  }
237 
238  return m_tile;
239 }
virtual void setImageRectangle(const ossimIrect &rect)
ossimRefPtr< ossimImageData > m_tile
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual void makeBlank()
Initializes data to null pixel values.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Method to grab a tile(rectangle) from image.

◆ getTile() [2/2]

bool ossimHdfReader::getTile ( ossimImageData result,
ossim_uint32  resLevel = 0 
)
virtual

Method to get a tile.

Parameters
resultThe tile to stuff. Note The requested rectangle in full image space and bands should be set in the result tile prior to passing. This is the default implementation that is not thread-friendly as it uses the object's tile then simply copies its buffer to the provided tile. Eventually, all image sources should override this method.
Returns
true on success false on error. If return is false, result is undefined so caller should handle appropriately with makeBlank or whatever.
Note
Derived classes should override this method to most efficiently stuff result.

Reimplemented from ossimImageSource.

Definition at line 241 of file ossimHdfReader.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), ossimImageData::getBuf(), ossimImageData::getImageRectangle(), ossimImageHandler::getImageRectangle(), ossimImageData::getNumberOfBands(), getNumberOfOutputBands(), ossimImageHandler::getOverviewTile(), ossimGdalTileSource::getTile(), isOpen(), ossimSource::isSourceEnabled(), ossimImageHandler::isValidRLevel(), ossimImageData::loadTile(), m_gdalTileSource, ossimImageData::makeBlank(), OSSIM_BSQ, ossimReferenced::ref(), status, ossimReferenced::unref(), ossimRefPtr< T >::valid(), and ossimImageData::validate().

243 {
244  bool status = false;
245 
246  //---
247  // Not open, this tile source bypassed, or invalid res level,
248  // return a blank tile.
249  //---
250  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
251  result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
252  {
253  result->ref(); // Increment ref count.
254 
255  //---
256  // Check for overview tile. Some overviews can contain r0 so always
257  // call even if resLevel is 0. Method returns true on success, false
258  // on error.
259  //---
260  status = getOverviewTile(resLevel, result);
261 
262  if (!status) // Did not get an overview tile.
263  {
264  status = true;
265 
266  ossimIrect tile_rect = result->getImageRectangle();
267 
268  if (getImageRectangle().intersects(tile_rect))
269  {
270  // Make a clip rect.
271  ossimIrect clipRect = tile_rect.clipToRect(getImageRectangle());
272 
273  if (tile_rect.completely_within(clipRect) == false)
274  {
275  // Not filling whole tile so blank it out first.
276  result->makeBlank();
277  }
278 
279  if (m_gdalTileSource.valid())
280  {
281  ossimRefPtr<ossimImageData> imageData =
282  m_gdalTileSource->getTile(tile_rect, resLevel);
283  result->loadTile(imageData->getBuf(), tile_rect, clipRect, OSSIM_BSQ);
284  }
285 
286  }
287  else // No intersection...
288  {
289  result->makeBlank();
290  }
291  }
292  result->validate();
293 
294  result->unref(); // Decrement ref count.
295  }
296 
297  return status;
298 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
void ref() const
increment the reference count by one, indicating that this object has another pointer which is refere...
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
virtual ossimDataObjectStatus validate() const
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
virtual ossimIrect getImageRectangle() const
virtual ossimIrect getImageRectangle(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tileRect, ossim_uint32 resLevel=0)
Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab fr...
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
void unref() const
decrement the reference count by one, indicating that a pointer to this object is referencing it...
return status
virtual void makeBlank()
Initializes data to null pixel values.
virtual const void * getBuf() const
virtual bool isOpen() const
Method to test for open file stream.

◆ isOpen()

bool ossimHdfReader::isOpen ( ) const
virtual

Method to test for open file stream.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 205 of file ossimHdfReader.cpp.

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

Referenced by getTile().

206 {
207  return m_gdalTileSource.get();
208 }
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource

◆ isSDSDataset()

bool ossimHdfReader::isSDSDataset ( ossimString  fileName)
private

Definition at line 191 of file ossimHdfReader.cpp.

References ossimString::contains(), and ossimString::split().

192 {
193  std::vector<ossimString> fileList = fileName.split(":");
194  if (fileList.size() > 0)
195  {
196  ossimString subName = fileList[0];
197  if (subName.contains("_SDS"))
198  {
199  return true;
200  }
201  }
202  return false;
203 }
bool contains(char aChar) const
Definition: ossimString.h:58
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.

◆ isSupportedExtension()

bool ossimHdfReader::isSupportedExtension ( )

Definition at line 300 of file ossimHdfReader.cpp.

References ossimString::downcase(), ossimFilename::ext(), and ossimImageHandler::theImageFile.

301 {
302  ossimString ext = theImageFile.ext();
303  ext.downcase();
304 
305  if ( ext == "hdf" || ext == "h4" || ext == "hdf4" ||
306  ext == "he4" || ext == "hdf5" || ext == "he5" || ext == "h5" ||
307  ext == "l1r")
308  {
309  return true;
310  }
311  return false;
312 }
ossimFilename theImageFile
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ loadState()

bool ossimHdfReader::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 366 of file ossimHdfReader.cpp.

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

367 {
368  bool result = false;
369  if ( ossimImageHandler::loadState(kwl, prefix) )
370  {
371  result = open();
372  }
373  return result;
374 }
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()
Open method.

◆ open()

bool ossimHdfReader::open ( )
virtual

Open method.

Returns
true on success, false on error.

Implements ossimImageHandler.

Definition at line 104 of file ossimHdfReader.cpp.

Referenced by loadState(), setCurrentEntry(), and setOutputBandList().

105 {
106  static const char MODULE[] = "ossimHdfReader::open";
107 
108  if (traceDebug())
109  {
111  << MODULE << " entered...\n"
112  << "image: " << theImageFile << "\n";
113  }
114 
115  bool result = false;
116 
117  if (!isSupportedExtension())
118  {
119  return false;
120  }
121 
122  if (m_entryFileList.size() == 0)
123  {
124  if(isOpen())
125  {
126  close();
127  }
128 
131 
132  if ( m_gdalTileSource->open() == false )
133  {
134  m_gdalTileSource = 0;
135  return false;
136  }
137 
138  std::vector<ossimString> entryStringList;
139  if (m_gdalTileSource )
140  {
141  m_gdalTileSource->getEntryNames(entryStringList);
142  }
143 
144  // bool isSwathImage = false;
145  if (entryStringList.size() > 0)
146  {
147  for (ossim_uint32 i = 0; i < entryStringList.size(); i++)
148  {
149  m_entryFileList.push_back(i);
150  }
151  }
152  else
153  {
154  result = false;
155  }
156  }
157 
158  //set entry id for the gdal tile source
160  {
161 
164 
166  m_tile->initialize();
167 
168  completeOpen();
169  result = true;
170  }
171  else
172  {
173  result = false;
174  }
175 
176  if (result == false)
177  {
178  close();
179  }
180 
181  if (traceDebug())
182  {
184  << MODULE << " exit status = " << (result?"true":"false\n")
185  << std::endl;
186  }
187 
188  return result;
189 }
virtual void getEntryNames(std::vector< ossimString > &entryStringList) const
ossimFilename theImageFile
ossimRefPtr< ossimImageData > m_tile
virtual void initialize()
Initialize the data buffer.
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource
static ossimImageDataFactory * instance()
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.
virtual void setFilename(const ossimFilename &filename)
Sets the filename.
unsigned int ossim_uint32
bool isSupportedExtension()
virtual void close()
Method to close current entry.
ossim_uint32 m_currentEntryRender
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
virtual void completeOpen()
Will complete the opening process.
std::vector< ossim_uint32 > m_entryFileList
ossim_uint32 m_numberOfBands
virtual bool isOpen() const
Method to test for open file stream.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ setCurrentEntry()

bool ossimHdfReader::setCurrentEntry ( ossim_uint32  entryIdx)
virtual
Parameters
entryIdxEntry number to select.
Note
The implementation does nothing. Derived classes that handle multiple images should override.
Returns
true if it was able to set the current entry and false otherwise.

Reimplemented from ossimImageHandler.

Definition at line 376 of file ossimHdfReader.cpp.

References ossimString::clear(), m_currentEntryRender, open(), ossimImageHandler::theDecimationFactors, ossimImageHandler::theGeometry, ossimImageHandler::theOverview, and ossimImageHandler::theOverviewFile.

377 {
378  if (m_currentEntryRender == entryIdx)
379  {
380  return true; // Nothing to do...
381  }
382  theDecimationFactors.clear();
383  theGeometry = 0;
384  theOverview = 0;
386  m_currentEntryRender = entryIdx;
387  return open();
388 }
void clear()
Erases the entire container.
Definition: ossimString.h:432
ossimRefPtr< ossimImageGeometry > theGeometry
std::vector< ossimDpt > theDecimationFactors
virtual bool open()
Open method.
ossim_uint32 m_currentEntryRender
ossimRefPtr< ossimImageHandler > theOverview
ossimFilename theOverviewFile

◆ setOutputBandList()

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

Definition at line 432 of file ossimHdfReader.cpp.

References m_gdalTileSource, open(), and ossimGdalTileSource::setOutputBandList().

433 {
434  if (outputBandList.size() && m_gdalTileSource )
435  {
436  m_gdalTileSource->setOutputBandList(outputBandList);
437  open();
438  return true;
439  }
440  return false;
441 }
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...
virtual bool open()
Open method.
ossimRefPtr< ossimGdalTileSource > m_gdalTileSource

Member Data Documentation

◆ m_currentEntryRender

ossim_uint32 ossimHdfReader::m_currentEntryRender
private

Definition at line 197 of file ossimHdfReader.h.

Referenced by setCurrentEntry().

◆ m_entryFileList

std::vector<ossim_uint32> ossimHdfReader::m_entryFileList
mutableprivate

Definition at line 194 of file ossimHdfReader.h.

Referenced by close(), getEntryList(), and getNumberOfEntries().

◆ m_gdalTileSource

ossimRefPtr<ossimGdalTileSource> ossimHdfReader::m_gdalTileSource
private

◆ m_numberOfBands

ossim_uint32 ossimHdfReader::m_numberOfBands
private

Definition at line 195 of file ossimHdfReader.h.

Referenced by getNumberOfInputBands(), and getNumberOfOutputBands().

◆ m_scalarType

ossimScalarType ossimHdfReader::m_scalarType
private

Definition at line 196 of file ossimHdfReader.h.

Referenced by getOutputScalarType().

◆ m_tile

ossimRefPtr<ossimImageData> ossimHdfReader::m_tile
private

Definition at line 198 of file ossimHdfReader.h.

Referenced by close(), and getTile().


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