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

#include <ossimImageCacheTileSource.h>

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

Public Member Functions

 ossimImageCacheTileSource ()
 Default constructor. More...
 
virtual ossimString getShortName () const
 This method is defined in the base class ossimObject. More...
 
virtual ossimString getLongName () const
 This method is defined in the base class ossimObject. More...
 
virtual void close ()
 Closes this image handler and deletes any allocated data. More...
 
virtual bool open ()
 Pure virtual open. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 Returns a pointer to an ossimImageDataObject given a rectangluar region of interest. More...
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimScalarType getOutputScalarType () const
 This method allows you to query the scalar type of the output data. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 This method allows you to query the number of input bands. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 This method allows one to query the number of output bands. 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...
 
- Public Member Functions inherited from ossimImageCacheBase
 ossimImageCacheBase ()
 Default constructor. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 reduced_res_level=0) const
 Satisfies pure virtual requirement from ImageHandler class. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 reduced_res_level=0) const
 Satisfies pure virtual requirement from ImageHandler class. More...
 
virtual ossimIrect getImageRectangle (ossim_uint32 reduced_res_level=0) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to load the state of an object from a keyword list. 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...
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
bool isValidRLevel (ossim_uint32 reduced_res_level) const
 
bool isOpen () const
 Determines if its open if there eists a table of contents object. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 
Populates the geometry object with image geometry information. 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 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 isBandSelector () const
 Indicates whether or not the image handler can control output band selection via the setOutputBandList method. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &band_list)
 If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled. More...
 
virtual bool setOutputToInputBandList ()
 If the image handler "isBandSeletor()" then the band selection of the output are set to input or identity. More...
 
virtual bool isIdentityBandList (const std::vector< ossim_uint32 > &bandList) const
 Convenience method to see if band list is identity. More...
 
virtual bool isImageTiled () const
 Indicates whether or not the image is tiled internally. More...
 
virtual bool hasMetaData () const
 
virtual ossimRefPtr< ossimNBandLutDataObjectgetLut () const
 
virtual bool hasLut () const
 
virtual void loadMetaData ()
 There is an external file with an omd extension. More...
 
virtual 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 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 getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. 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 ~ossimImageCacheTileSource ()
 Destructor. More...
 
void fillTile (const ossimIrect &tileRect, const vector< ossimFrameEntryData > &framesInvolved, ossimImageData *tile)
 
bool buildFrameEntryArray (ossimFilename imageFile)
 
- Protected Member Functions inherited from ossimImageCacheBase
virtual ~ossimImageCacheBase ()
 Destructor. More...
 
void setActualImageRect ()
 Will shift the rect and clamp it so not to go outside the -180 to 180 degree range. More...
 
void checkLongitude (ossim_float64 &leftLon, const ossim_float64 &rightLon) const
 Method to test for 180.0 <–> 180.00 and set leftLon to -180 if both left and right are 180.0 degrees. More...
 
vector< ossimFrameEntryDatagetIntersectingEntries (const ossimIrect &rect)
 It is important to note that each frame is organized into an easting northing type orientation. More...
 
void deleteAll ()
 
bool buildFrameEntryArray (ossimFilename imageFile, ossim_uint32 frameWidth, ossim_uint32 frameHeight)
 
virtual void establishDecimationFactors ()
 Virtual method determines the decimation factors at each resolution level. More...
 
- Protected Member Functions inherited from ossimImageHandler
virtual ossimRefPtr< ossimImageGeometrygetExternalImageGeometry () const
 Returns the image geometry object associated with this tile source or NULL if non defined. More...
 
virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () const
 
virtual bool getOverviewTile (ossim_uint32 resLevel, ossimImageData *result)
 Method to get an overview tile. More...
 
bool initVertices (const char *file)
 Opens file and attempts to initialize the valid image vertices. More...
 
virtual void completeOpen ()
 Will complete the opening process. More...
 
void initImageParameters (ossimImageGeometry *geom) const
 Convenience method to set things needed in the image geometry from the image handler. More...
 
virtual 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
 This is the actual data returned from a getTile request. More...
 
ossimRefPtr< ossimImageHandlerm_imageHandler
 
double m_minPixelValue
 
double m_maxPixelValue
 
double m_nullPixelValue
 
- Protected Attributes inherited from ossimImageCacheBase
ossimIrect m_actualImageRect
 This holds the image bounds for the current entry. More...
 
ossim_uint32 m_numberOfLines
 This will be computed based on the frames organized within the directory. More...
 
ossim_uint32 m_numberOfSamples
 This will be computed based on the frames organized within the directory. More...
 
ossim_uint32 m_numberOfBands
 This is the actual data returned from a getTile request. More...
 
std::vector< ossimStringm_fileNames
 The size of the input frames. More...
 
ossimIpt m_tileSize
 The size of the output tile. More...
 
ossimRpfFramem_workFrame
 
ossim_float64 m_bBox_LL_Lon
 
ossim_float64 m_bBox_LL_Lat
 
ossim_float64 m_bBox_UR_Lon
 
ossim_float64 m_bBox_UR_Lat
 
ossim_uint32 m_numOfFramesVertical
 
ossim_uint32 m_numOfFramesHorizontal
 
ossim_uint32 m_frame_width
 
ossim_uint32 m_frame_height
 
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
 
- Protected Attributes inherited from ossimImageHandler
ossimFilename theImageFile
 
ossimFilename theOverviewFile
 
ossimFilename theSupplementaryDirectory
 
ossimRefPtr< ossimImageHandlertheOverview
 
vector< ossimIpttheValidImageVertices
 
ossimImageMetaData theMetaData
 
ossimRefPtr< ossimImageGeometrytheGeometry
 
ossimRefPtr< ossimNBandLutDataObjecttheLut
 
std::vector< ossimDpttheDecimationFactors
 
ossimString theImageID
 
ossim_uint32 theStartingResLevel
 theStartingResLevel If set to something other than zero(default) this is indicative that the reader is an overview. More...
 
bool theOpenOverviewFlag
 If true opening of overviews will be attempted. More...
 
ossimPixelType thePixelType
 
std::shared_ptr< ossim::ImageHandlerState > m_state
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Additional Inherited Members

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

Detailed Description

Definition at line 18 of file ossimImageCacheTileSource.h.

Constructor & Destructor Documentation

◆ ossimImageCacheTileSource()

ossimImageCacheTileSource::ossimImageCacheTileSource ( )

Default constructor.

Initializes all internal attributes to a default state.

Definition at line 44 of file ossimImageCacheTileSource.cpp.

45  :
47  m_tile(0),
48  m_imageHandler(0),
52 {
53 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossimRefPtr< ossimImageHandler > m_imageHandler
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.
ossimImageCacheBase()
Default constructor.

◆ ~ossimImageCacheTileSource()

ossimImageCacheTileSource::~ossimImageCacheTileSource ( )
protectedvirtual

Destructor.

Will return allocated memory back to the heap.

Definition at line 55 of file ossimImageCacheTileSource.cpp.

56 {
57  if(m_imageHandler.valid())
58  {
59  m_imageHandler = 0;
60  }
61  close();
62 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_imageHandler
virtual void close()
Closes this image handler and deletes any allocated data.

Member Function Documentation

◆ buildFrameEntryArray()

bool ossimImageCacheTileSource::buildFrameEntryArray ( ossimFilename  imageFile)
protected

Definition at line 127 of file ossimImageCacheTileSource.cpp.

128 {
129  static const char MODULE[] = "ossimImageCacheTileSource::buildFrameEntryArray";
130  if ( traceDebug() )
131  {
132  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
133  }
134 
135  std::ifstream in((imageFile).c_str() );
136  std::string line;
137  ossim_uint32 index = 0; // used throughout
138  ossim_uint32 frameWidth = 0;
139  ossim_uint32 frameHeight = 0;
140  while( in.good() )
141  {
142  // Read in a line.
143  std::getline(in, line);
144  ossimString tmpStr = ossimString(line);
145  if (index == 0)
146  {
147  std::vector<ossimString> box_lat_lon;
148  tmpStr.split(box_lat_lon, "|");
149  if (box_lat_lon.size() == 4)
150  {
151  std::vector<ossimString> pixelInfos = box_lat_lon[3].split(",");
152  if (pixelInfos.size() == 3)
153  {
154  m_minPixelValue = ossimString::toFloat64(pixelInfos[0]);
155  m_maxPixelValue = ossimString::toFloat64(pixelInfos[1]);
156  m_nullPixelValue = ossimString::toFloat64(pixelInfos[2]);
157  }
158  }
159  }
160  else if (index == 1)
161  {
162  std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
163  ossimFilename firstFile = frame_lat_lon[0];
165  {
167  if (m_imageHandler.valid())
168  {
169  frameWidth = m_imageHandler->getBoundingRect().width();
170  frameHeight = m_imageHandler->getBoundingRect().height();
171  break;
172  }
173  }
174  else
175  {
176  return false;
177  }
178  }
179  ++index;
180  }
181  in.close();
182 
183  return ossimImageCacheBase::buildFrameEntryArray(imageFile, frameWidth, frameHeight);
184 }
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
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.
static const ossimErrorCode OSSIM_ERROR
std::istream & getline(std::istream &is, ossimString &str, char delim)
Definition: ossimString.h:916
ossimRefPtr< ossimImageHandler > m_imageHandler
ossimRpfFrame * m_workFrame
unsigned int ossim_uint32
ossim_float64 toFloat64() const
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimErrorCode parseFile(const ossimFilename &filename, bool minimalParse=false)
bool buildFrameEntryArray(ossimFilename imageFile, ossim_uint32 frameWidth, ossim_uint32 frameHeight)
static ossimImageHandlerRegistry * instance()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ close()

void ossimImageCacheTileSource::close ( )
virtual

Closes this image handler and deletes any allocated data.

Reimplemented from ossimImageCacheBase.

Definition at line 75 of file ossimImageCacheTileSource.cpp.

76 {
77  deleteAll();
78 }

◆ fillTile()

void ossimImageCacheTileSource::fillTile ( const ossimIrect tileRect,
const vector< ossimFrameEntryData > &  framesInvolved,
ossimImageData tile 
)
protected
Parameters
tileRectRegion to fill.
framesInvolvedAll intersecting frames used to render the region.

Definition at line 262 of file ossimImageCacheTileSource.cpp.

References ossimIrect::clipToRect(), ossimImageData::dup(), ossimImageData::getBuf(), ossimIrect::height(), ossimImageHandlerRegistry::instance(), ossimImageData::loadTile(), ossimImageData::makeBlank(), ossimImageHandlerRegistry::open(), ossimImageHandler::open(), OSSIM_BSQ, ossimFilterResampler::resample(), ossimImageData::setImageRectangle(), ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

266 {
267  ossim_uint32 idx = 0;
268  for(idx = 0; idx < framesInvolved.size(); ++idx)
269  {
270  if (m_imageHandler.valid())
271  {
272  if (m_imageHandler->getFilename() != framesInvolved[idx].theFrameEntry.getFullPath())
273  {
274  m_imageHandler = 0;
275  m_imageHandler = ossimImageHandlerRegistry::instance()->open(framesInvolved[idx].theFrameEntry.getFullPath());
276  }
277  }
278  else
279  {
280  m_imageHandler = ossimImageHandlerRegistry::instance()->open(framesInvolved[idx].theFrameEntry.getFullPath());
281  }
282 
283  if (m_imageHandler.valid())
284  {
285  if (m_imageHandler->isOpen() == false)
286  {
287  m_imageHandler->open(framesInvolved[idx].theFrameEntry.getFullPath());
288  }
289 
290  ossimIrect frameRect(framesInvolved[idx].thePixelCol,
291  framesInvolved[idx].thePixelRow,
292  framesInvolved[idx].thePixelCol + m_frame_width - 1,
293  framesInvolved[idx].thePixelRow + m_frame_height - 1);
294 
295  ossimIrect clipRect = tileRect.clipToRect(frameRect);
296 
297  ossimIpt tempDelta(clipRect.ul().x - framesInvolved[idx].thePixelCol,
298  clipRect.ul().y - framesInvolved[idx].thePixelRow);
299 
300  ossimIrect offsetRect(tempDelta.x,
301  tempDelta.y,
302  tempDelta.x + clipRect.width()-1,
303  tempDelta.y + clipRect.height()-1);
304 
305  //if the current image size is different from the default size, resample the image data
308  {
309 
310  //calculate the ratio
311  ossim_float64 widthRatio = static_cast<ossim_float64>(m_imageHandler->getBoundingRect().width())/static_cast<ossim_float64>(m_frame_width);
312  ossim_float64 heightRatio = static_cast<ossim_float64>(m_imageHandler->getBoundingRect().height())/static_cast<ossim_float64>(m_frame_height);
313 
314  //initialize the rect bounding for getting image data from image handler
315  ossimDpt ul(offsetRect.ul().x*widthRatio, offsetRect.ul().y*heightRatio);
316  ossimDpt lr(offsetRect.lr().x*widthRatio, offsetRect.lr().y*heightRatio);
317 
318  //---
319  // Floor, ceil to avoid rect size of zero from ul, lr, delta being only fractional
320  // resulting in size of 0 if cast to an int or passed to ossim<int>::round().
321  //---
322  ossimIrect actualOffsetRect(static_cast<ossim_int32>(std::floor(ul.x)),
323  static_cast<ossim_int32>(std::floor(ul.y)),
324  static_cast<ossim_int32>(std::ceil(lr.x)),
325  static_cast<ossim_int32>(std::ceil(lr.y)));
326 
327  //get accurate rect in case the actual rect is larger than the rect of image
328  actualOffsetRect = actualOffsetRect.clipToRect(m_imageHandler->getBoundingRect());
329 
330  ossimRefPtr<ossimImageData> imageData = m_imageHandler->getTile(actualOffsetRect);
331  if (imageData.valid())
332  {
333  ossimFilterResampler* resampler = new ossimFilterResampler();
334 
335  double denominatorY = 1.0;
336  double denominatorX = 1.0;
337  if(clipRect.height() > 2) // Cannot be zero.
338  {
339  denominatorY = clipRect.height()-1.0;
340  }
341  if(clipRect.width() > 2) // Cannot be zero.
342  {
343  denominatorX = clipRect.width()-1.0;
344  }
345 
346  //create a tile and set the rect size
347  ossimRefPtr<ossimImageData> tmpTile = (ossimImageData*)imageData->dup();
348  tmpTile->setImageRectangle(offsetRect);
349  tmpTile->makeBlank();
350 
351  ossimDpt deltaUl(((actualOffsetRect.ll().x - actualOffsetRect.ul().x)/denominatorX),
352  ((actualOffsetRect.ll().y - actualOffsetRect.ul().y)/denominatorY));
353  ossimDpt deltaUr(((actualOffsetRect.lr().x - actualOffsetRect.ur().x)/denominatorX),
354  ((actualOffsetRect.lr().y - actualOffsetRect.ur().y)/denominatorY));
355  ossimDpt length(offsetRect.width(),offsetRect.height());
356 
357  //resample the image data
358  resampler->resample(imageData,
359  tmpTile,
360  actualOffsetRect.ul(),
361  actualOffsetRect.ur(),
362  deltaUl,
363  deltaUr,
364  length);
365 
366  tile->loadTile(tmpTile->getBuf(), clipRect, OSSIM_BSQ);
367 
368  tmpTile = 0;
369  delete resampler;
370  resampler = 0;
371  }
372  }
373  else
374  {
375  ossimRefPtr<ossimImageData> imageData = m_imageHandler->getTile(offsetRect);
376  if (imageData.valid())
377  {
378  tile->loadTile(imageData->getBuf(), clipRect, OSSIM_BSQ);
379  }
380  }
381  }
382  }
383 }
virtual bool open()=0
Pure virtual open.
virtual void setImageRectangle(const ossimIrect &rect)
virtual ossimImageHandler * open(const ossimFilename &fileName, bool trySuffixFirst=true, bool openOverview=true) const
open that takes a filename.
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
ossimRefPtr< ossimImageHandler > m_imageHandler
virtual ossimObject * dup() const
virtual bool isOpen() const =0
Derived classes must implement this method to be concrete.
double ossim_float64
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual const ossimFilename & getFilename() const
Returns the filename.
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
virtual void makeBlank()
Initializes data to null pixel values.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
virtual void resample(const ossimRefPtr< ossimImageData > &input, ossimRefPtr< ossimImageData > &output, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &deltaUl, const ossimDpt &deltaUr, const ossimDpt &length)
static ossimImageHandlerRegistry * instance()
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
ossim_int32 x
Definition: ossimIpt.h:141
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ getLongName()

ossimString ossimImageCacheTileSource::getLongName ( ) const
virtual

This method is defined in the base class ossimObject.

This class overrides the default implementation to return its own long name.

Returns
The long name for this class as an ossimString.

Reimplemented from ossimObject.

Definition at line 69 of file ossimImageCacheTileSource.cpp.

70 {
71  return ossimString("ImageCache reader");
72 }

◆ getMaxPixelValue()

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

Returns the max pixel of the band.

Reimplemented from ossimImageHandler.

Definition at line 403 of file ossimImageCacheTileSource.cpp.

References ossimImageHandler::getMaxPixelValue(), and ossim::isnan().

404 {
406  {
408  }
409  return m_maxPixelValue;
410 }
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ getMinPixelValue()

double ossimImageCacheTileSource::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.

Definition at line 394 of file ossimImageCacheTileSource.cpp.

References ossimImageHandler::getMinPixelValue(), and ossim::isnan().

395 {
397  {
399  }
400  return m_minPixelValue;
401 }
virtual double getMinPixelValue(ossim_uint32 band=0) const
Retuns the min pixel value.
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ getNullPixelValue()

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

Each band has a null pixel associated with it.

The null pixel represents an invalid value.

Reimplemented from ossimImageHandler.

Definition at line 412 of file ossimImageCacheTileSource.cpp.

References ossimImageHandler::getNullPixelValue(), and ossim::isnan().

413 {
415  {
417  }
418  return m_nullPixelValue;
419 }
virtual double getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ getNumberOfInputBands()

ossim_uint32 ossimImageCacheTileSource::getNumberOfInputBands ( ) const
virtual

This method allows you to query the number of input bands.

If an image is band selectable this will allow one to select the bands you wish to read in. This indicates that the number of input bands might not match the number of output bands.

Returns
number of input bands.

Reimplemented from ossimImageCacheBase.

Definition at line 421 of file ossimImageCacheTileSource.cpp.

422 {
423  if (m_imageHandler.valid())
424  {
426  }
427  return m_numberOfBands;
428 }
ossim_uint32 m_numberOfBands
This is the actual data returned from a getTile request.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_imageHandler
virtual ossim_uint32 getNumberOfInputBands() const =0

◆ getNumberOfOutputBands()

ossim_uint32 ossimImageCacheTileSource::getNumberOfOutputBands ( ) const
virtual

This method allows one to query the number of output bands.

This might not be the same as the n umber of input bands.

See also
getNumberOfInputBands().
Returns
number of output bands.

Reimplemented from ossimImageCacheBase.

Definition at line 430 of file ossimImageCacheTileSource.cpp.

431 {
432  if (m_imageHandler.valid())
433  {
435  }
436  return m_numberOfBands;
437 }
ossim_uint32 m_numberOfBands
This is the actual data returned from a getTile request.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_imageHandler
virtual ossim_uint32 getNumberOfInputBands() const =0

◆ getOutputScalarType()

ossimScalarType ossimImageCacheTileSource::getOutputScalarType ( ) const
virtual

This method allows you to query the scalar type of the output data.

This is simply the data type, i.e. whether its OSSIM_FLOAT, OSSIM_DOUBLE, OSSIM_UCHAR, ... etc. This means that if there are bands of different scalar types from a single image then they must be casted to the highest precision type.

See also
ossimConstants.h for all ossimScalarType.
Returns
The output scalar type.

Reimplemented from ossimImageSource.

Definition at line 385 of file ossimImageCacheTileSource.cpp.

References OSSIM_UCHAR.

386 {
387  if (m_imageHandler.valid())
388  {
390  }
391  return OSSIM_UCHAR;
392 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > m_imageHandler
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
8 bit unsigned iteger

◆ getShortName()

ossimString ossimImageCacheTileSource::getShortName ( ) const
virtual

This method is defined in the base class ossimObject.

This class overrides the default implementation to return its own short name.

Returns
The short name for this class as an ossimString.

Reimplemented from ossimObject.

Definition at line 64 of file ossimImageCacheTileSource.cpp.

65 {
66  return ossimString("ImageCache");
67 }

◆ getTile() [1/2]

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

Returns a pointer to an ossimImageDataObject given a rectangluar region of interest.

Parameters
rectThe region of interest to return.
resLevelFrom which resolution set are we querying (default is 0 full res).
Returns
The ossimImageData object to the caller.

Reimplemented from ossimImageSource.

Definition at line 186 of file ossimImageCacheTileSource.cpp.

References OSSIM_NULL, and ossimImageData::setImageRectangle().

188 {
189  if (m_tile.valid())
190  {
191  // Image rectangle must be set prior to calling getTile.
192  m_tile->setImageRectangle(rect);
193 
194  if ( getTile( m_tile.get(), resLevel ) == false )
195  {
197  {
198  m_tile->makeBlank();
199  }
200  }
201  }
202 
203  return m_tile;
204 }
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Returns a pointer to an ossimImageDataObject given a rectangluar region of interest.
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual void makeBlank()
Initializes data to null pixel values.
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.

◆ getTile() [2/2]

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

Definition at line 206 of file ossimImageCacheTileSource.cpp.

References ossimImageData::getImageRectangle(), ossimImageData::getNumberOfBands(), ossimIrect::intersects(), ossimImageData::makeBlank(), status, and ossimImageData::validate().

208 {
209  bool status = false;
210 
211  //---
212  // Not open, this tile source bypassed, or invalid res level,
213  // return a blank tile.
214  //---
215  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
216  result && (result->getNumberOfBands() == getNumberOfOutputBands()))
217  {
218  if ( resLevel > 0 )
219  {
220  status = getOverviewTile(resLevel, result);
221  }
222 
223  if (!status) // Did not get an overview tile.
224  {
225  status = true;
226 
227  ossimIrect rect = result->getImageRectangle();
228 
229  ossimIrect imageRect = getImageRectangle();
230 
231  if ( rect.intersects(imageRect) )
232  {
233  //---
234  // Start with a blank tile in case there is not total coverage
235  // for rect.
236  //---
237  result->makeBlank();
238 
239  vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
240  if(frames.size() > 0)
241  {
242  //---
243  // Now lets render each frame. Note we will have to find
244  // subframes
245  // that intersect the rectangle of interest for each frame.
246  //---
247  fillTile(rect, frames, result);
248 
249  // Revalidate tile status.
250  result->validate();
251  }
252  }
253  else
254  {
255  result->makeBlank();
256  }
257  }
258  }
259  return status;
260 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
void fillTile(const ossimIrect &tileRect, const vector< ossimFrameEntryData > &framesInvolved, ossimImageData *tile)
virtual ossim_uint32 getNumberOfBands() const
bool isValidRLevel(ossim_uint32 reduced_res_level) const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
vector< ossimFrameEntryData > getIntersectingEntries(const ossimIrect &rect)
It is important to note that each frame is organized into an easting northing type orientation...
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
virtual ossimDataObjectStatus validate() const
virtual ossimIrect getImageRectangle() const
virtual ossim_uint32 getNumberOfOutputBands() const
This method allows one to query the number of output bands.
bool isOpen() const
Determines if its open if there eists a table of contents object.
return status
virtual void makeBlank()
Initializes data to null pixel values.

◆ open()

bool ossimImageCacheTileSource::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 ossimImageCacheBase.

Definition at line 80 of file ossimImageCacheTileSource.cpp.

81 {
82  if(traceDebug())
83  {
84  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageCacheTileSource::open(): Entered....." << std::endl;
85  }
86 
87  ossimFilename imageFile = theImageFile;
88  bool result = true;
89 
90  if(isOpen() == false)
91  {
92  close();
93  result = false;
94  }
95 
96  if(result)
97  {
98  if (m_fileNames.size() == 0 && m_frameEntryArray.size() == 0)
99  {
100  if (buildFrameEntryArray(imageFile) == false)
101  {
102  return false;
103  }
104  }
105 
106  //---
107  // Adjust image rect so not to go over the -180 to 180 and -90 to 90
108  // bounds.
109  //---
111 
112  // Set the base class image file name.
113  theImageFile = imageFile;
115  m_tile->initialize();
116  completeOpen();
117  }
118 
119  if(traceDebug())
120  {
121  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageCacheTileSource::open(): Leaving at line" << __LINE__ << std::endl;
122  }
123 
124  return result;
125 }
bool buildFrameEntryArray(ossimFilename imageFile)
ossimFilename theImageFile
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
void setActualImageRect()
Will shift the rect and clamp it so not to go outside the -180 to 180 degree range.
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
bool isOpen() const
Determines if its open if there eists a table of contents object.
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.
virtual void completeOpen()
Will complete the opening process.
std::vector< ossimString > m_fileNames
The size of the input frames.
virtual void close()
Closes this image handler and deletes any allocated data.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Data Documentation

◆ m_imageHandler

ossimRefPtr<ossimImageHandler> ossimImageCacheTileSource::m_imageHandler
protected

Definition at line 146 of file ossimImageCacheTileSource.h.

◆ m_maxPixelValue

double ossimImageCacheTileSource::m_maxPixelValue
protected

Definition at line 148 of file ossimImageCacheTileSource.h.

◆ m_minPixelValue

double ossimImageCacheTileSource::m_minPixelValue
protected

Definition at line 147 of file ossimImageCacheTileSource.h.

◆ m_nullPixelValue

double ossimImageCacheTileSource::m_nullPixelValue
protected

Definition at line 149 of file ossimImageCacheTileSource.h.

◆ m_tile

ossimRefPtr<ossimImageData> ossimImageCacheTileSource::m_tile
protected

This is the actual data returned from a getTile request.

Definition at line 144 of file ossimImageCacheTileSource.h.


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