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

#include <ossimGeneralRasterTileSource.h>

Inheritance diagram for ossimGeneralRasterTileSource:
ossimImageHandler ossimImageSource ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced ossimDoqqTileSource ossimEnviTileSource ossimERSTileSource ossimLandsatTileSource ossimSrtmTileSource

Public Member Functions

 ossimGeneralRasterTileSource ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &tile_rect, ossim_uint32 resLevel=0)
 Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab from the 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 getNumberOfLines (ossim_uint32 reduced_res_level=0) const
 Returns the number of lines in the image. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 reduced_res_level=0) const
 Returns the number of samples in the image. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the width of the output tile. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the height of the output tile. 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...
 
bool isValidRLevel (ossim_uint32 reduced_res_level) const
 Determines if the passed in reslution level is valid. More...
 
virtual void close ()
 Deletes the overview and clears the valid image vertices. More...
 
virtual bool isOpen () const
 Derived classes must implement this method to be concrete. More...
 
virtual bool open ()
 Pure virtual open. More...
 
virtual bool open (const ossimGeneralRasterInfo &info)
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Override base getXXXXPixValue methods since the null/min/max can be set to something different. 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 ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. 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 void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList to the zero based order of output bands. 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...
 
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 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 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 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 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 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 ~ossimGeneralRasterTileSource ()
 
virtual bool fillBuffer (const ossimIpt &origin, const ossimIpt &size)
 Methods return true on succes false on error. More...
 
virtual bool fillBIP (const ossimIpt &origin, const ossimIpt &size)
 
virtual bool fillBIL (const ossimIpt &origin, const ossimIpt &size)
 
virtual bool fillBSQ (const ossimIpt &origin, const ossimIpt &size)
 
virtual bool fillBsqMultiFile (const ossimIpt &origin, const ossimIpt &size)
 
virtual ossimKeywordlist getHdrInfo (ossimFilename hdrFile)
 
virtual ossimKeywordlist getXmlInfo (ossimFilename xmlFile)
 
bool initializeHandler ()
 
- 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

ossimRefPtr< ossimImageDatam_tile
 
ossim_uint8m_buffer
 
ossim_uint8m_lineBuffer
 
ossimInterleaveType m_bufferInterleave
 
std::vector< std::shared_ptr< ossim::istream > > m_fileStrList
 
ossimGeneralRasterInfo m_rasterInfo
 
ossimIrect m_bufferRect
 
bool m_swapBytesFlag
 
ossim_uint32 m_bufferSizeInPixels
 
std::vector< ossim_uint32m_outputBandList
 
- 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
 

Private Member Functions

void allocateTile ()
 Allocates m_tile. More...
 
void allocateBuffer (const ossimImageData *tile)
 Allocates m_buffer. More...
 

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

Definition at line 29 of file ossimGeneralRasterTileSource.h.

Constructor & Destructor Documentation

◆ ossimGeneralRasterTileSource()

ossimGeneralRasterTileSource::ossimGeneralRasterTileSource ( )

◆ ~ossimGeneralRasterTileSource()

virtual ossimGeneralRasterTileSource::~ossimGeneralRasterTileSource ( )
protectedvirtual

Member Function Documentation

◆ allocateBuffer()

void ossimGeneralRasterTileSource::allocateBuffer ( const ossimImageData tile)
private

Allocates m_buffer.

Definition at line 1578 of file ossimGeneralRasterTileSource.cpp.

References ossimImageMetaData::getBytesPerPixel(), ossimGeneralRasterInfo::getImageMetaData(), ossimImageMetaData::getNumberOfBands(), ossimImageData::getSize(), ossimImageData::getSizeInBytes(), ossimImageData::getWidth(), ossimGeneralRasterInfo::interleaveType(), m_buffer, m_bufferRect, m_bufferSizeInPixels, m_lineBuffer, m_rasterInfo, and OSSIM_BIP.

1579 {
1580  if( m_buffer )
1581  {
1582  delete [] m_buffer;
1583  m_buffer = 0;
1584  m_bufferSizeInPixels = 0; // Must zero out for check in getTile method.
1585  }
1586  if ( m_lineBuffer )
1587  {
1588  delete [] m_lineBuffer;
1589  m_lineBuffer = 0;
1590  }
1591 
1592  if ( tile )
1593  {
1594  // Store the size of the buffer in pixels for swapping bytes.
1595  m_bufferSizeInPixels = tile->getSize();
1596  if ( m_bufferSizeInPixels )
1597  {
1598  // Initialize buffer. This is bytes, not pixels.
1599  m_buffer = new ossim_uint8[ tile->getSizeInBytes() ];
1600 
1601  // Zero out the buffer rect.
1602  m_bufferRect = ossimIrect(0, 0, 0, 0);
1603  }
1604 
1606  {
1607  // Big enough to hold a whole line all bands.
1608  ossim_uint32 widthInBytes =
1611 
1612  m_lineBuffer = new ossim_uint8[ widthInBytes ];
1613  }
1614  }
1615 }
virtual ossim_uint32 getWidth() const
ossim_uint32 getBytesPerPixel() const
ossimInterleaveType interleaveType() const
Enumerated in InterleaveTypeLUT.
ossim_uint32 getNumberOfBands() const
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.
unsigned int ossim_uint32
virtual ossim_uint32 getSize() const
Returns the total number of pixels in a tile for all bands.
const ossimImageMetaData & getImageMetaData() const
unsigned char ossim_uint8

◆ allocateTile()

void ossimGeneralRasterTileSource::allocateTile ( )
private

Allocates m_tile.

Definition at line 1546 of file ossimGeneralRasterTileSource.cpp.

References ossimImageDataFactory::create(), ossimGeneralRasterInfo::getImageMetaData(), ossimImageMetaData::getMaxPix(), ossimImageMetaData::getMinPix(), ossimImageMetaData::getNullPix(), ossimImageMetaData::getScalarType(), ossimImageData::initialize(), ossimImageDataFactory::instance(), m_outputBandList, m_rasterInfo, m_tile, ossimGeneralRasterInfo::numberOfBands(), ossimImageData::setMaxPix(), ossimImageData::setMinPix(), ossimImageData::setNullPix(), and ossimRefPtr< T >::valid().

1547 {
1548  m_tile = 0;
1549  ossim_uint32 bands = 0;
1550  if ( m_outputBandList.empty() )
1551  {
1552  bands = m_rasterInfo.numberOfBands();
1553  }
1554  else
1555  {
1556  bands = (ossim_uint32)m_outputBandList.size();
1557  }
1558 
1559  if ( bands )
1560  {
1562  this, m_rasterInfo.getImageMetaData().getScalarType(), bands );
1563 
1564  if ( m_tile.valid() )
1565  {
1566  // These values can be overridden by loadState...
1567  for(ossim_uint32 band = 0; band < bands; ++ band)
1568  {
1572  }
1573  m_tile->initialize(); // This does a makeBlank().
1574  }
1575  }
1576 }
double getMinPix(ossim_uint32 band) const
bool valid() const
Definition: ossimRefPtr.h:75
ossimScalarType getScalarType() const
std::vector< ossim_uint32 > m_outputBandList
double getMaxPix(ossim_uint32 band) const
double getNullPix(ossim_uint32 band) const
virtual void initialize()
Initialize the data buffer.
virtual void setNullPix(ossim_float64 null_pix)
static ossimImageDataFactory * instance()
unsigned int ossim_uint32
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimRefPtr< ossimImageData > m_tile
virtual void setMaxPix(ossim_float64 max_pix)
const ossimImageMetaData & getImageMetaData() const
virtual void setMinPix(ossim_float64 min_pix)
ossim_int32 numberOfBands() const
Number of bands.

◆ close()

void ossimGeneralRasterTileSource::close ( )
virtual

Deletes the overview and clears the valid image vertices.

Derived classes should implement.

Reimplemented from ossimImageHandler.

Definition at line 1003 of file ossimGeneralRasterTileSource.cpp.

References ossimImageHandler::close(), m_buffer, m_bufferSizeInPixels, m_fileStrList, m_lineBuffer, and m_tile.

1004 {
1005  ossimImageHandler::close(); // base class
1006 
1007  m_tile = 0; // Not a leak, ref ptr.
1008 
1009  if ( m_buffer )
1010  {
1011  delete [] m_buffer;
1012  m_buffer = 0;
1013  m_bufferSizeInPixels = 0; // Must zero out for check in getTile method.
1014  }
1015 
1016  if ( m_lineBuffer )
1017  {
1018  delete [] m_lineBuffer;
1019  m_lineBuffer = 0;
1020  }
1021 
1022  std::vector< shared_ptr<ossim::istream> >::iterator is = m_fileStrList.begin();
1023  while (is != m_fileStrList.end())
1024  {
1025  (*is) = 0;
1026 
1027  ++is;
1028  }
1029  m_fileStrList.clear();
1030 }
std::vector< std::shared_ptr< ossim::istream > > m_fileStrList
virtual void close()
Deletes the overview and clears the valid image vertices.
ossimRefPtr< ossimImageData > m_tile

◆ fillBIL()

virtual bool ossimGeneralRasterTileSource::fillBIL ( const ossimIpt origin,
const ossimIpt size 
)
protectedvirtual

◆ fillBIP()

virtual bool ossimGeneralRasterTileSource::fillBIP ( const ossimIpt origin,
const ossimIpt size 
)
protectedvirtual

◆ fillBSQ()

virtual bool ossimGeneralRasterTileSource::fillBSQ ( const ossimIpt origin,
const ossimIpt size 
)
protectedvirtual

◆ fillBsqMultiFile()

virtual bool ossimGeneralRasterTileSource::fillBsqMultiFile ( const ossimIpt origin,
const ossimIpt size 
)
protectedvirtual

◆ fillBuffer()

virtual bool ossimGeneralRasterTileSource::fillBuffer ( const ossimIpt origin,
const ossimIpt size 
)
protectedvirtual

Methods return true on succes false on error.

◆ getHdrInfo()

ossimKeywordlist ossimGeneralRasterTileSource::getHdrInfo ( ossimFilename  hdrFile)
protectedvirtual

Definition at line 1071 of file ossimGeneralRasterTileSource.cpp.

References ossimKeywordlist::add(), ossimKeywordlist::addFile(), ossim::byteOrder(), ossimString::c_str(), ossimKeywordlist::change_delimiter(), ossimKeywordlist::downcaseKeywords(), ossimKeywordlist::find(), ossimKeywordNames::INTERLEAVE_TYPE_KW, ossimKeywordNames::NULL_VALUE_KW, ossimKeywordNames::NUMBER_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimKeywordNames::SCALAR_TYPE_KW, size, ossimImageHandler::theImageFile, ossimString::toFloat32(), ossimString::toInt(), ossimString::toString(), and ossimString::toUInt32().

1072 {
1073  ossimKeywordlist kwl;
1074  char delimeter = ' ';
1075  kwl.change_delimiter(delimeter);
1076  kwl.addFile(hdrFile);
1077  kwl.downcaseKeywords();
1078 
1079  ossimKeywordlist geoKwl;
1080  ossim_uint32 lines = 0;
1081  ossim_uint32 samples = 0;
1082  ossim_float32 noData = -9999;
1083  ossimString scalarType = "ossim_uint8";
1084  ossim_int32 numBands = 1;
1085  // ossim_int32 skipBytes = 0;
1086  ossim_int32 numBits = -1;
1087  ossimString chPixelType = "N"; // not defined
1088  ossimString interleaveType = "BIL";
1090  bool noDataFound = false;
1091 
1092  const char* lookup = kwl.find("ncols");
1093  if (lookup)
1094  {
1095  samples = ossimString(lookup).toUInt32();
1096  geoKwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
1097  }
1098 
1099  lookup = kwl.find("nrows");
1100  if (lookup)
1101  {
1102  lines = ossimString(lookup).toUInt32();
1103  geoKwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
1104  }
1105 
1106  // lookup = kwl.find("skipbytes");
1107  // if (lookup)
1108  // {
1109  // skipBytes = ossimString(lookup).toInt();
1110  // }
1111 
1112  lookup = kwl.find("nbands");
1113  if (lookup)
1114  {
1115  numBands = ossimString(lookup).toInt();
1116  }
1117 
1118  lookup = kwl.find("nodata");
1119  if (lookup)
1120  {
1121  noData = ossimString(lookup).toFloat32();
1122  noDataFound = true;
1123  }
1124  lookup = kwl.find("nodata_value");
1125  if (lookup)
1126  {
1127  noData = ossimString(lookup).toFloat32();
1128  noDataFound = true;
1129  }
1130 
1131  lookup = kwl.find("nbits");
1132  if (lookup)
1133  {
1134  numBits = ossimString(lookup).toInt();
1135  }
1136 
1137  lookup = kwl.find("pixeltype");
1138  if (lookup)
1139  {
1140  chPixelType = ossimString(lookup);
1141  }
1142 
1143  lookup = kwl.find("layout");
1144  if (lookup)
1145  {
1146  interleaveType = ossimString(lookup);
1147  }
1148 
1149  lookup = kwl.find("byteorder");
1150  if (lookup)
1151  {
1152  byteOrder = ossimString(lookup);
1153  }
1154 
1155  if (numBits == -1)
1156  {
1157  FILE* fp;
1158  ossim_int64 size = 0;
1159  fp = fopen(theImageFile.c_str(), "r");
1160  if (fp != 0)
1161  {
1162  fseek(fp, 0, SEEK_END);
1163  size = ftell(fp);
1164  }
1165  fclose(fp);
1166 
1167  if (lines > 0 && samples > 0)
1168  {
1169  ossim_int32 numBytes = size/samples/lines/numBands;
1170  if( numBytes > 0 && numBytes != 3 )
1171  {
1172  numBits = numBytes*8;
1173 
1174  if( numBytes == 4 )
1175  {
1176  chPixelType = "F";
1177  }
1178  }
1179  }
1180  }
1181 
1182  if( numBits == 16 )
1183  {
1184  if (chPixelType == "S")
1185  {
1186  scalarType = "ossim_sint16";
1187  }
1188  else
1189  {
1190  scalarType = "ossim_uint16"; // default
1191  }
1192  }
1193  else if( numBits == 32 )
1194  {
1195  if( chPixelType == "S")
1196  {
1197  scalarType = "ossim_sint32";
1198  }
1199  else if( chPixelType == "F")
1200  {
1201  scalarType = "ossim_float32";
1202  }
1203  else
1204  {
1205  scalarType = "ossim_uint32"; // default
1206  }
1207  }
1208  else if( numBits == 8 )
1209  {
1210  scalarType = "ossim_uint8";
1211  numBits = 8;
1212  }
1213  else if( numBits < 8 && numBits >= 1 )
1214  {
1215  scalarType = "ossim_uint8";
1216  }
1217  else if(numBits == -1)
1218  {
1219  if( chPixelType == "F")
1220  {
1221  scalarType = "ossim_float32";
1222  numBits = 32;
1223  }
1224  else
1225  {
1226  scalarType = "ossim_uint8";
1227  numBits = 8;
1228  }
1229  }
1230 
1231  if (noDataFound)
1232  {
1233  for (ossim_int32 i = 0; i < numBands; i++)
1234  {
1235  ossimString prefix = "band" + ossimString::toString(i+1) + ": ";
1236  geoKwl.add(prefix, ossimKeywordNames::NULL_VALUE_KW, noData);
1237  }
1238  }
1239 
1240  geoKwl.add(ossimKeywordNames::NUMBER_BANDS_KW, numBands);
1241  geoKwl.add(ossimKeywordNames::SCALAR_TYPE_KW, scalarType);
1242  geoKwl.add(ossimKeywordNames::INTERLEAVE_TYPE_KW, interleaveType);
1243 
1244  return geoKwl;
1245 }
ossimFilename theImageFile
Represents serializable keyword/value map.
bool addFile(const char *file)
const char * find(const char *key) const
float ossim_float32
ossimKeywordlist & downcaseKeywords()
static const char * NULL_VALUE_KW
static ossimString toString(bool aValue)
Numeric to string methods.
static const char * NUMBER_LINES_KW
void change_delimiter(char del)
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossim_uint32 toUInt32() const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
yy_size_t size
unsigned int ossim_uint32
ossim_float32 toFloat32() const
static const char * NUMBER_BANDS_KW
static const char * INTERLEAVE_TYPE_KW
long long ossim_int64
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
static const char * SCALAR_TYPE_KW
static const char * NUMBER_SAMPLES_KW
int toInt() const
int ossim_int32

◆ getImageGeometry()

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

Reimplemented in ossimLandsatTileSource, ossimEnviTileSource, ossimERSTileSource, ossimSrtmTileSource, and ossimDoqqTileSource.

Definition at line 1336 of file ossimGeneralRasterTileSource.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::DATUM_KW, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, ossimKeywordlist::downcaseKeywords(), ossimFilename::exists(), ossimFilename::ext(), ossimImageGeometryRegistry::extendGeometry(), ossimKeywordlist::find(), ossimRefPtr< T >::get(), ossimImageHandler::getExternalImageGeometry(), ossimFgdcXmlDoc::getGridCoordSysProjection(), ossimFgdcXmlDoc::getProjection(), ossimImageGeometry::getProjection(), ossimImageHandler::initImageParameters(), ossimImageGeometryRegistry::instance(), ossimMapProjectionFactory::instance(), ossimDatumFactory::instance(), ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimFgdcXmlDoc::open(), ossimKeywordNames::ORIGIN_LATITUDE_KW, ossimFilename::setExtension(), ossimImageGeometry::setProjection(), ossimImageHandler::theGeometry, ossimImageHandler::theImageFile, ossimKeywordNames::TIE_POINT_LAT_KW, ossimKeywordNames::TIE_POINT_LON_KW, ossimString::toFloat32(), ossimString::toUInt32(), ossimKeywordNames::TYPE_KW, and ossimRefPtr< T >::valid().

1337 {
1338  if ( !theGeometry.valid() )
1339  {
1340  // Check for external geom:
1342 
1343  if ( !theGeometry.valid() )
1344  {
1346 
1347  ossimString ext = theImageFile.ext();
1348  ossimFilename hdrFile = theImageFile;
1349  ossimFilename xmlFile = theImageFile;
1350  hdrFile = hdrFile.setExtension("hdr");
1351  xmlFile = xmlFile.setExtension("xml");
1352  if (hdrFile.exists())
1353  {
1354  ossimKeywordlist geoKwl;
1355  ossimKeywordlist kwl(hdrFile, ' ');
1356  kwl.downcaseKeywords();
1357 
1358  ossim_uint32 lines = 0;
1359  ossim_uint32 samples = 0;
1360  ossim_float32 ll_lon = 0.0;
1361  ossim_float32 ll_lat = 0.0;
1362  ossim_float32 xCellSize = 1.0;
1363  ossim_float32 yCellSize = 1.0;
1364 
1365  const char* lookup = kwl.find("ncols");
1366  if (lookup)
1367  {
1368  samples = ossimString(lookup).toUInt32();
1369  geoKwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
1370  }
1371 
1372  lookup = kwl.find("nrows");
1373  if (lookup)
1374  {
1375  lines = ossimString(lookup).toUInt32();
1376  geoKwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
1377  }
1378 
1379  lookup = kwl.find("cellsize");
1380  if (lookup)
1381  {
1382  xCellSize = ossimString(lookup).toFloat32();
1383  yCellSize = xCellSize;
1386  }
1387 
1388  lookup = kwl.find("xdim");
1389  if (lookup)
1390  {
1391  xCellSize = ossimString(lookup).toFloat32();
1393  }
1394 
1395  lookup = kwl.find("ydim");
1396  if (lookup)
1397  {
1398  yCellSize = ossimString(lookup).toFloat32();
1400  }
1401 
1402  lookup = kwl.find("xllcenter");
1403  if (lookup)
1404  {
1405  ossim_float32 centerX = ossimString(lookup).toFloat32();
1406  ll_lon = centerX + xCellSize * 0.5;
1407  geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
1408  }
1409 
1410  lookup = kwl.find("yllcenter");
1411  if (lookup)
1412  {
1413  ossim_float32 centerY = ossimString(lookup).toFloat32();
1414  ll_lat = (centerY + (lines - 1) * yCellSize) + yCellSize * 0.5;
1415  geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
1416  }
1417 
1418  lookup = kwl.find("xllcorner");
1419  if (lookup)
1420  {
1421  ll_lon = ossimString(lookup).toFloat32();
1422  geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
1423  }
1424 
1425  lookup = kwl.find("yllcorner");
1426  if (lookup)
1427  {
1428  ossim_uint32 centerY = ossimString(lookup).toFloat32();
1429  ll_lat = centerY + lines * yCellSize;
1430  geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
1431  }
1432 
1433  lookup = kwl.find("ulxmap");
1434  if (lookup)
1435  {
1436  ll_lon = ossimString(lookup).toFloat32();
1437  geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
1438  }
1439 
1440  lookup = kwl.find("ulymap");
1441  if (lookup)
1442  {
1443  ossim_uint32 centerY = ossimString(lookup).toFloat32();
1444  ll_lat = centerY + lines * yCellSize;
1445  geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
1446  }
1447 
1448  kwl.add(ossimKeywordNames::ORIGIN_LATITUDE_KW, ll_lat);
1449 
1450  geoKwl.add(ossimKeywordNames::TYPE_KW, "ossimEquDistCylProjection");
1451 
1453  code());
1454 
1456  createProjection(geoKwl);
1457 
1458  if ( proj.valid() )
1459  {
1460  theGeometry->setProjection(proj.get());
1461  }
1462  }
1463  else if (xmlFile.exists())
1464  {
1465  ossimFgdcXmlDoc file;
1466  if ( file.open(xmlFile) )
1467  {
1469  if ( !proj.valid() )
1470  {
1471  proj = file.getGridCoordSysProjection();
1472  }
1473  if ( proj.valid() )
1474  {
1475  theGeometry->setProjection(proj.get());
1476  }
1477  }
1478 
1479  } // xml file exist...
1480 
1481  } // Matches second if ( !theGeometry.valid() )
1482 
1483  //---
1484  // WARNING:
1485  // Must have theGeometry at this point or the next call to
1486  // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
1487  // as it does a recursive call back to ossimImageHandler::getImageGeometry().
1488  //---
1489 
1490  // Check for set projection.
1491  if ( !theGeometry->getProjection() )
1492  {
1493  // Try factories for projection.
1495  }
1496 
1497  // Set image things the geometry object should know about.
1499 
1500  } // Matches first if ( !theGeometry.valid() )
1501 
1502  return theGeometry;
1503 }
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
static const char * DECIMAL_DEGREES_PER_PIXEL_LAT
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
static const char * DATUM_KW
ossimFilename theImageFile
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
float ossim_float32
static ossimMapProjectionFactory * instance()
ossimRefPtr< ossimProjection > getGridCoordSysProjection()
Gets projection from Grid Coordinate system node.
static const char * NUMBER_LINES_KW
static const char * TIE_POINT_LON_KW
ossim_uint32 toUInt32() const
static const char * TYPE_KW
virtual bool extendGeometry(ossimImageHandler *handler) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
bool exists() const
unsigned int ossim_uint32
Class for FGDC XML doc parsing.
static ossimDatumFactory * instance()
static const char * DECIMAL_DEGREES_PER_PIXEL_LON
ossim_float32 toFloat32() const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
static const char * ORIGIN_LATITUDE_KW
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
ossimRefPtr< ossimProjection > getProjection()
Gets projection from document.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
ossimString ext() const
bool open(const ossimFilename &xmlFileName)
Open method.
static const char * TIE_POINT_LAT_KW
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
static const char * NUMBER_SAMPLES_KW

◆ getImageTileHeight()

ossim_uint32 ossimGeneralRasterTileSource::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::getTileWidth which returns the output tile width which can be different than the internal image tile width on disk. Note: This handler will always return 0 for this method.

Implements ossimImageHandler.

Definition at line 1037 of file ossimGeneralRasterTileSource.cpp.

1038 {
1039  return 0;
1040 }

◆ getImageTileWidth()

ossim_uint32 ossimGeneralRasterTileSource::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. Note: This handler will always return 0 for this method.

Implements ossimImageHandler.

Definition at line 1032 of file ossimGeneralRasterTileSource.cpp.

1033 {
1034  return 0;
1035 }

◆ getLongName()

ossimString ossimGeneralRasterTileSource::getLongName ( ) const
virtual

Reimplemented from ossimObject.

Reimplemented in ossimEnviTileSource, ossimLandsatTileSource, ossimERSTileSource, ossimSrtmTileSource, and ossimDoqqTileSource.

Definition at line 1047 of file ossimGeneralRasterTileSource.cpp.

1048 {
1049  return ossimString("general raster reader");
1050 }

◆ getMaxPixelValue()

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

Returns the max pixel of the band.

Reimplemented from ossimImageHandler.

Reimplemented in ossimLandsatTileSource.

◆ getMinPixelValue()

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

Retuns the min pixel value.

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

Reimplemented from ossimImageHandler.

Reimplemented in ossimLandsatTileSource.

◆ getNullPixelValue()

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

Override base getXXXXPixValue methods since the null/min/max can be set to something different.

Currently returns the same value for all bands.

Reimplemented from ossimImageHandler.

Reimplemented in ossimLandsatTileSource.

◆ getNumberOfInputBands()

ossim_uint32 ossimGeneralRasterTileSource::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageSource.

Definition at line 1052 of file ossimGeneralRasterTileSource.cpp.

References ossimGeneralRasterInfo::getImageMetaData(), ossimImageMetaData::getNumberOfBands(), and m_rasterInfo.

1053 {
1055 }
ossim_uint32 getNumberOfBands() const
const ossimImageMetaData & getImageMetaData() const

◆ getNumberOfLines()

virtual ossim_uint32 ossimGeneralRasterTileSource::getNumberOfLines ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the number of lines in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageHandler.

◆ getNumberOfOutputBands()

ossim_uint32 ossimGeneralRasterTileSource::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 1057 of file ossimGeneralRasterTileSource.cpp.

References ossimGeneralRasterInfo::getImageMetaData(), ossimImageMetaData::getNumberOfBands(), isBandSelector(), m_outputBandList, and m_rasterInfo.

1058 {
1059  ossim_uint32 result = 0;
1060  if ( isBandSelector() && m_outputBandList.size() )
1061  {
1062  result = (ossim_uint32)m_outputBandList.size();
1063  }
1064  else
1065  {
1067  }
1068  return result;
1069 }
std::vector< ossim_uint32 > m_outputBandList
virtual bool isBandSelector() const
Indicates whether or not the image handler can control output band selection via the setOutputBandLis...
ossim_uint32 getNumberOfBands() const
unsigned int ossim_uint32
const ossimImageMetaData & getImageMetaData() const

◆ getNumberOfSamples()

virtual ossim_uint32 ossimGeneralRasterTileSource::getNumberOfSamples ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the number of samples in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageHandler.

◆ getOutputBandList()

void ossimGeneralRasterTileSource::getOutputBandList ( std::vector< ossim_uint32 > &  bandList) const
virtual

Initializes bandList to the zero based order of output bands.

Reimplemented from ossimImageSource.

Definition at line 1541 of file ossimGeneralRasterTileSource.cpp.

References m_outputBandList.

1542 {
1543  bandList = m_outputBandList;
1544 }
std::vector< ossim_uint32 > m_outputBandList

◆ getOutputScalarType()

virtual ossimScalarType ossimGeneralRasterTileSource::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Reimplemented in ossimLandsatTileSource.

◆ getShortName()

ossimString ossimGeneralRasterTileSource::getShortName ( ) const
virtual

Reimplemented from ossimObject.

Reimplemented in ossimERSTileSource, ossimLandsatTileSource, ossimEnviTileSource, ossimSrtmTileSource, and ossimDoqqTileSource.

Definition at line 1042 of file ossimGeneralRasterTileSource.cpp.

1043 {
1044  return ossimString("ossim_raster");
1045 }

◆ getTile() [1/2]

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

Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab from the image.

Satisfies pure virtual from TileSource class.

Reimplemented from ossimImageSource.

◆ getTile() [2/2]

virtual bool ossimGeneralRasterTileSource::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. It will be an error if: result.getNumberOfBands() != this->getNumberOfOutputBands()
Returns
true on success false on error. If return is false, result is undefined so caller should handle appropriately with makeBlank or whatever.

Reimplemented from ossimImageSource.

◆ getTileHeight()

virtual ossim_uint32 ossimGeneralRasterTileSource::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

◆ getTileWidth()

virtual ossim_uint32 ossimGeneralRasterTileSource::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

◆ getXmlInfo()

ossimKeywordlist ossimGeneralRasterTileSource::getXmlInfo ( ossimFilename  xmlFile)
protectedvirtual

Definition at line 1247 of file ossimGeneralRasterTileSource.cpp.

References ossimKeywordlist::add(), ossimString::contains(), ossimFilename::fileSize(), ossimFgdcXmlDoc::getImageSize(), ossimFgdcXmlDoc::getNumberOfBands(), ossimFgdcXmlDoc::getPath(), ossimKeywordNames::INTERLEAVE_TYPE_KW, ossimKeywordNames::NUMBER_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimFgdcXmlDoc::open(), ossimKeywordNames::SCALAR_TYPE_KW, size, and ossimImageHandler::theImageFile.

1248 {
1249  ossimKeywordlist kwl;
1250  ossimFgdcXmlDoc file;
1251  if (file.open(xmlFile))
1252  {
1253 
1254  ossimString scalarType = "ossim_uint8";
1255  ossim_int32 numBits = -1;
1256  ossimString interleaveType = "BIL";
1257 
1258  ossimIpt size;
1259  ossim_int32 samples = 0;
1260  ossim_int32 lines = 0;
1261  if (file.getImageSize(size))
1262  {
1263  samples = size.x;
1264  lines = size.y;
1265  }
1266  if (samples > 0)
1267  {
1269  }
1270  if (lines > 0)
1271  {
1273  }
1274 
1275  ossim_int32 bands = file.getNumberOfBands();
1276  if (bands > 0)
1277  {
1279  }
1280  else
1281  {
1282  if (samples > 0 && lines > 0)//if there is no bands info but samples and lines info, default number of bands to 1
1283  {
1284  bands = 1;
1286  }
1287  }
1288 
1289  ossimString eainfo;
1290  file.getPath("/metadata/eainfo/detailed/enttyp/enttypd", eainfo);
1291 
1292  if (numBits == -1)
1293  {
1294  if ( (lines > 0) && (samples > 0) && (bands > 0) )
1295  {
1297  ossim_int32 numBytes = size/samples/lines/bands;
1298  if( numBytes > 0 && numBytes != 3 )
1299  {
1300  numBits = numBytes*8;
1301  }
1302  }
1303  }
1304 
1305  if( numBits == 16 )
1306  {
1307  scalarType = "ossim_uint16"; // default
1308  }
1309  else if( numBits == 32 )
1310  {
1311  if(eainfo.contains("float"))
1312  {
1313  scalarType = "ossim_float32";
1314  }
1315  else
1316  {
1317  scalarType = "ossim_uint32"; // default
1318  }
1319  }
1320  else if( numBits == 8 )
1321  {
1322  scalarType = "ossim_uint8";
1323  numBits = 8;
1324  }
1325  else if( numBits < 8 && numBits >= 1 )
1326  {
1327  scalarType = "ossim_uint8";
1328  }
1329 
1330  kwl.add(ossimKeywordNames::SCALAR_TYPE_KW, scalarType);
1331  kwl.add(ossimKeywordNames::INTERLEAVE_TYPE_KW, interleaveType);
1332  }
1333  return kwl;
1334 }
ossimFilename theImageFile
Represents serializable keyword/value map.
ossim_int64 fileSize() const
ossim_uint32 getNumberOfBands()
Get Bands.
bool contains(char aChar) const
Definition: ossimString.h:58
bool getPath(const ossimString &path, ossimString &s) const
Gets path from doc and initializes string.
static const char * NUMBER_LINES_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
yy_size_t size
Class for FGDC XML doc parsing.
bool getImageSize(ossimIpt &size) const
static const char * NUMBER_BANDS_KW
static const char * INTERLEAVE_TYPE_KW
long long ossim_int64
static const char * SCALAR_TYPE_KW
bool open(const ossimFilename &xmlFileName)
Open method.
static const char * NUMBER_SAMPLES_KW
int ossim_int32

◆ initializeHandler()

bool ossimGeneralRasterTileSource::initializeHandler ( )
protected

◆ isBandSelector()

bool ossimGeneralRasterTileSource::isBandSelector ( ) const
virtual

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

Overrides: ossimImageHandler::isBandSelector

Returns
true

Reimplemented from ossimImageHandler.

Definition at line 1505 of file ossimGeneralRasterTileSource.cpp.

References ossimGeneralRasterInfo::interleaveType(), ossimImageHandler::isBandSelector(), m_rasterInfo, OSSIM_BIL, OSSIM_BIP, OSSIM_BSQ_MULTI_FILE, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getNumberOfOutputBands(), and setOutputBandList().

1506 {
1507  bool result = false;
1511  {
1512  result = true;
1513  }
1514 
1515  if ( result && theOverview.valid() )
1516  {
1517  result = theOverview->isBandSelector();
1518  }
1519  return result;
1520 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimInterleaveType interleaveType() const
Enumerated in InterleaveTypeLUT.
virtual bool isBandSelector() const
Indicates whether or not the image handler can control output band selection via the setOutputBandLis...
ossimRefPtr< ossimImageHandler > theOverview

◆ isOpen()

bool ossimGeneralRasterTileSource::isOpen ( ) const
virtual

Derived classes must implement this method to be concrete.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 990 of file ossimGeneralRasterTileSource.cpp.

References m_fileStrList.

991 {
992  bool result = false;
993  if (m_fileStrList.size() > 0)
994  {
995  if( m_fileStrList[0] )
996  {
997  result = !(m_fileStrList[0]->fail());
998  }
999  }
1000  return result;
1001 }
std::vector< std::shared_ptr< ossim::istream > > m_fileStrList

◆ isValidRLevel()

bool ossimGeneralRasterTileSource::isValidRLevel ( ossim_uint32  resLevel) const
virtual

Determines if the passed in reslution level is valid.

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

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

Reimplemented from ossimImageHandler.

◆ loadState()

virtual bool ossimGeneralRasterTileSource::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.

Reimplemented in ossimEnviTileSource, ossimLandsatTileSource, ossimSrtmTileSource, ossimERSTileSource, and ossimDoqqTileSource.

Referenced by ossimERSTileSource::loadState().

◆ open() [1/2]

virtual bool ossimGeneralRasterTileSource::open ( )
virtual

Pure virtual open.

Derived classes must implement.

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

Implements ossimImageHandler.

Reimplemented in ossimEnviTileSource, ossimLandsatTileSource, and ossimSrtmTileSource.

Referenced by ossimDoqqTileSource::loadState(), ossimERSTileSource::loadState(), ossimDoqqTileSource::open(), and ossimERSTileSource::open().

◆ open() [2/2]

virtual bool ossimGeneralRasterTileSource::open ( const ossimGeneralRasterInfo info)
virtual

Reimplemented in ossimDoqqTileSource.

◆ saveState()

virtual bool ossimGeneralRasterTileSource::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.

Reimplemented in ossimEnviTileSource, and ossimSrtmTileSource.

◆ setOutputBandList()

bool ossimGeneralRasterTileSource::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.

Overrides: ossimImageHandler::setOutputBandList

Returns
true on success, false on error.

Reimplemented from ossimImageHandler.

Definition at line 1522 of file ossimGeneralRasterTileSource.cpp.

References ossimImageData::getNumberOfBands(), isBandSelector(), m_outputBandList, m_tile, ossimImageHandler::setOutputBandList(), and ossimRefPtr< T >::valid().

1523 {
1524  bool result = false;
1525  if ( isBandSelector() )
1526  {
1527  // Making a copy as passed in list could be our m_outputBandList.
1528  std::vector<ossim_uint32> inputList = band_list;
1530  if ( result && m_tile.valid() )
1531  {
1532  if ( m_tile->getNumberOfBands() != m_outputBandList.size() )
1533  {
1534  m_tile = 0; // Force a reinitialize on next getTile.
1535  }
1536  }
1537  }
1538  return result;
1539 }
virtual ossim_uint32 getNumberOfBands() const
bool valid() const
Definition: ossimRefPtr.h:75
std::vector< ossim_uint32 > m_outputBandList
virtual bool isBandSelector() const
Indicates whether or not the image handler can control output band selection via the setOutputBandLis...
ossimRefPtr< ossimImageData > m_tile
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...

Member Data Documentation

◆ m_buffer

ossim_uint8* ossimGeneralRasterTileSource::m_buffer
protected

Definition at line 189 of file ossimGeneralRasterTileSource.h.

Referenced by allocateBuffer(), and close().

◆ m_bufferInterleave

ossimInterleaveType ossimGeneralRasterTileSource::m_bufferInterleave
protected

Definition at line 191 of file ossimGeneralRasterTileSource.h.

Referenced by if().

◆ m_bufferRect

ossimIrect ossimGeneralRasterTileSource::m_bufferRect
protected

Definition at line 195 of file ossimGeneralRasterTileSource.h.

Referenced by allocateBuffer().

◆ m_bufferSizeInPixels

ossim_uint32 ossimGeneralRasterTileSource::m_bufferSizeInPixels
protected

Definition at line 197 of file ossimGeneralRasterTileSource.h.

Referenced by allocateBuffer(), and close().

◆ m_fileStrList

std::vector< std::shared_ptr<ossim::istream> > ossimGeneralRasterTileSource::m_fileStrList
protected

Definition at line 192 of file ossimGeneralRasterTileSource.h.

Referenced by close(), for(), and isOpen().

◆ m_lineBuffer

ossim_uint8* ossimGeneralRasterTileSource::m_lineBuffer
protected

Definition at line 190 of file ossimGeneralRasterTileSource.h.

Referenced by allocateBuffer(), and close().

◆ m_outputBandList

std::vector<ossim_uint32> ossimGeneralRasterTileSource::m_outputBandList
protected

◆ m_rasterInfo

ossimGeneralRasterInfo ossimGeneralRasterTileSource::m_rasterInfo
protected

◆ m_swapBytesFlag

bool ossimGeneralRasterTileSource::m_swapBytesFlag
protected

Definition at line 196 of file ossimGeneralRasterTileSource.h.

Referenced by if().

◆ m_tile

ossimRefPtr<ossimImageData> ossimGeneralRasterTileSource::m_tile
protected

Definition at line 188 of file ossimGeneralRasterTileSource.h.

Referenced by allocateTile(), close(), and setOutputBandList().


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