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

#include <ossimImageCacheBase.h>

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

Classes

struct  ossimFrameEntryData
 Protected structure that is only used internally by this class. More...
 

Public Member Functions

 ossimImageCacheBase ()
 Default constructor. More...
 
virtual void close ()
 Closes this image handler and deletes any allocated data. More...
 
virtual bool open ()=0
 Pure virtual open. 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 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 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 double getMinPixelValue (ossim_uint32 band=0) const
 Retuns the min pixel value. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual void setMinPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set min pixel value. More...
 
virtual void setMaxPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set max pixel value. More...
 
virtual void setNullPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set null pixel value. More...
 
virtual ossim_uint32 getCurrentEntry () const
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
virtual void getEntryNames (std::vector< ossimString > &entryNames) const
 
bool useEntryIndex () const
 Convenience method to determine if entry index should be used for support files, e.g. More...
 
ossimFilename getOverviewFile () const
 
virtual bool setCurrentEntry (ossim_uint32 entryIdx)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
ossimFilename getFilenameWithThisExtension (const ossimString &ext, bool set_e0_prefix=false) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
void getFilenameWithThisExt (const ossimString &ext, ossimFilename &f) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
ossim_uint32 getStartingResLevel () const
 
void setStartingResLevel (ossim_uint32 level)
 
bool getOpenOverviewFlag () const
 
void setOpenOverviewFlag (bool flag)
 Sets theOpenOverviewFlag. More...
 
virtual void setSupplementaryDirectory (const ossimFilename &dir)
 Sets the supplementary directory. More...
 
virtual const ossimFilenamegetSupplementaryDirectory () const
 Returns the supplementary directory. More...
 
const ossimStringgetImageID () const
 Fetches the image ID. More...
 
void setImageID (const ossimString &id)
 Sets the image ID in case it is externally generated. More...
 
ossimPixelType getPixelType () const
 Returns the raster pixel alignment type. More...
 
virtual bool getRgbBandList (std::vector< ossim_uint32 > &bandList) const
 Convenience method to get the zero based rgb output band list. More...
 
template<class T >
std::shared_ptr< T > getStateAs ()
 
template<class T >
std::shared_ptr< const T > getStateAs () const
 
std::shared_ptr< ossim::ImageHandlerState > getState ()
 
std::shared_ptr< const ossim::ImageHandlerState > getState () const
 
void setState (std::shared_ptr< ossim::ImageHandlerState > state)
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual ossimScalarType getOutputScalarType () const
 This will be used to query the output pixel type of the tile source. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

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

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 21 of file ossimImageCacheBase.h.

Constructor & Destructor Documentation

◆ ossimImageCacheBase()

ossimImageCacheBase::ossimImageCacheBase ( )

Default constructor.

Initializes all internal attributes to a default state.

Definition at line 48 of file ossimImageCacheBase.cpp.

49  :
52  m_numberOfLines(0),
54  m_numberOfBands(0),
55  m_fileNames(),
56  m_tileSize(128, 128),
58  m_bBox_LL_Lon(0.0),
59  m_bBox_LL_Lat(0.0),
60  m_bBox_UR_Lon(0.0),
61  m_bBox_UR_Lat(0.0),
64  m_frame_width(0),
65  m_frame_height(0),
67 {
68  if (traceDebug())
69  {
71  << "ossimImageCacheBase::ossimImageCacheBase entered...\n";
72 #ifdef OSSIM_ID_ENABLED
74  << "OSSIM_ID: " << OSSIM_ID << "\n";
75 #endif
76  }
77 
79 
80 }
ossim_uint32 m_numberOfBands
This is the actual data returned from a getTile request.
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
ossimIrect m_actualImageRect
This holds the image bounds for the current entry.
ossimRpfFrame * m_workFrame
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
ossim_uint32 m_numOfFramesHorizontal
ossimIpt m_tileSize
The size of the output tile.
std::vector< ossimString > m_fileNames
The size of the input frames.
void makeNan()
Definition: ossimIrect.h:329
ossimImageHandler()
Constructor (default):
ossim_uint32 m_numOfFramesVertical
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimImageCacheBase()

ossimImageCacheBase::~ossimImageCacheBase ( )
protectedvirtual

Destructor.

Will return allocated memory back to the heap.

Definition at line 82 of file ossimImageCacheBase.cpp.

83 {
84  if(m_workFrame)
85  {
86  delete m_workFrame;
87  m_workFrame = 0;
88  }
89  close();
90 }
ossimRpfFrame * m_workFrame
virtual void close()
Closes this image handler and deletes any allocated data.

Member Function Documentation

◆ buildFrameEntryArray()

bool ossimImageCacheBase::buildFrameEntryArray ( ossimFilename  imageFile,
ossim_uint32  frameWidth,
ossim_uint32  frameHeight 
)
protected

Definition at line 112 of file ossimImageCacheBase.cpp.

115 {
116  static const char MODULE[] = "ossimImageCacheBase::buildFrameEntryArray";
117  if ( traceDebug() )
118  {
119  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
120  }
121 
122  // use to check if tiles have overlap pixels
123  ossim_float64 avgLat = 0.0;
124  ossim_float64 avgLon = 0.0;
125 
126  m_frame_width = frameWidth;
127  m_frame_height = frameHeight;
128 
129  std::ifstream in((imageFile).c_str() );
130 
131  std::string line;
132  ossim_uint32 index = 0; // used throughout
133  while( in.good() )
134  {
135  // Read in a line.
136  std::getline(in, line);
137 
138  ossimString tmpStr = ossimString(line);
139  if (!tmpStr.empty())
140  {
141  if (index == 0)
142  {
143  std::vector<ossimString> box_lat_lon;
144  tmpStr.split(box_lat_lon, "|");
145 
146  if (box_lat_lon.size() > 2)
147  {
148  std::vector<ossimString> ll;
149  std::vector<ossimString> ur;
150 
151  box_lat_lon[0].split(ll, ",");
152  box_lat_lon[1].split(ur, ",");
153  ossimString bandStr = box_lat_lon[2];
154 
155  m_bBox_LL_Lon = ll[0].toFloat64();
156  m_bBox_LL_Lat = ll[1].toFloat64();
157  m_bBox_UR_Lon = ur[0].toFloat64();
158  m_bBox_UR_Lat = ur[1].toFloat64();
159 
161 
162  m_numberOfBands = ossimString(bandStr).toInt32();
163  }
164  else
165  {
166  return false;
167  }
168  }
169  else if (index == 1)
170  {
171  m_fileNames.push_back(tmpStr);
172  std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
173  if (frame_lat_lon.size() > 2)
174  {
175  ossimString ll_lon_lat = frame_lat_lon[1];
176  ossimString ur_lon_lat = frame_lat_lon[2];
177  ossim_float64 ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
178  ossim_float64 ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
179  ossim_float64 ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
180  ossim_float64 ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
181 
182  checkLongitude(ll_lon, ur_lon);
183 
184  ossim_float64 bBox_lat_diff = std::fabs(m_bBox_UR_Lat - m_bBox_LL_Lat);
185  ossim_float64 bBox_lon_diff = std::fabs(m_bBox_UR_Lon - m_bBox_LL_Lon);
186 
187  ossim_float64 lat_diff = std::fabs(ur_lat - ll_lat);
188  ossim_float64 lon_diff = std::fabs(ur_lon - ll_lon);
189 
190  m_numOfFramesVertical = static_cast<ossim_uint32>(bBox_lat_diff/lat_diff + 0.5);
191  m_numOfFramesHorizontal = static_cast<ossim_uint32>(bBox_lon_diff/lon_diff + 0.5);
192 
193  avgLon = std::fabs(bBox_lon_diff/m_numOfFramesHorizontal);
194  avgLat = std::fabs(bBox_lat_diff/m_numOfFramesVertical);
195 
198 
199  if ( traceDebug() )
200  {
202  << "\nscene height in degrees: " << bBox_lat_diff
203  << "\nscene width in degrees: " << bBox_lon_diff
204  << "\nframe height in degrees: " << lat_diff
205  << "\nframe width in degrees: " << lon_diff
206  << "\nframes vertical: " << m_numOfFramesVertical
207  << "\nframes horizontal: " << m_numOfFramesHorizontal
208  << "\nlines: " << m_numberOfLines
209  << "\nsamples: " << m_numberOfSamples << "\n";
210  }
211  }
212  else
213  {
214  return false;
215  }
216  }
217  else
218  {
219  m_fileNames.push_back(tmpStr);
220  }
221 
222  } // matches: if (!tmpStr.empty())
223 
224  ++index;
225 
226  } // matches: while( in.good() )
227  in.close();
228 
230  for(index = 0; index < m_frameEntryArray.size(); ++index)
231  {
233  }
234 
235  for(index = 0; index < m_fileNames.size(); ++index)
236  {
237  ossimString tmpStr = m_fileNames[index];
238  std::vector<ossimString> frameInfos = tmpStr.split("|");
239  if (frameInfos.size() > 1)
240  {
241  ossimString fileName = frameInfos[0];
242  ossimString ll_lon_lat = frameInfos[1];
243  ossimString ur_lon_lat = frameInfos[2];
244  double ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
245  double ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
246  double ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
247  double ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
248 
249  checkLongitude(ll_lon, ur_lon);
250 
251  ossim_float64 tmpColPostion = std::fabs(ll_lon - m_bBox_LL_Lon);
252  ossim_float64 tmpFrameLon = std::fabs(ur_lon - ll_lon);
253 
254  if (std::fabs(tmpFrameLon - avgLon) > 0.002)
255  {
256  ossimNotify(ossimNotifyLevel_WARN) << fileName << " has overlap pixels with other image." << std::endl;
257  return false;
258  }
259 
260  ossim_float64 tmpRowPostion = std::fabs(m_bBox_UR_Lat - ur_lat);
261  ossim_float64 tmpFrameLat = std::fabs(ur_lat - ll_lat);
262 
263  if (std::fabs(tmpFrameLat - avgLat) > 0.002)
264  {
265  ossimNotify(ossimNotifyLevel_WARN) << fileName << " has overlap pixels with other image." << std::endl;
266  return false;
267  }
268 
269  ossim_uint32 colNum = static_cast<ossim_uint32>(tmpColPostion/tmpFrameLon + 0.5);
270  ossim_uint32 rowNum = static_cast<ossim_uint32>(tmpRowPostion/tmpFrameLat + 0.5);
271 
272  if (colNum >= m_numOfFramesHorizontal)
273  {
274  colNum = m_numOfFramesHorizontal-1; // Clamp to last column.
275  }
276 
277  if (rowNum >= m_numOfFramesVertical)
278  {
279  rowNum = m_numOfFramesVertical-1; // Clamp to last row.
280  }
281 
282  ossimRpfFrameEntry tempEntry;
283  tempEntry.setEntry(ossimFilename(""), fileName);
284  m_frameEntryArray[rowNum][colNum] = tempEntry;
285  }
286  else
287  {
288  return false;
289  }
290  }
291 
292  return true;
293 }
ossim_uint32 m_numberOfBands
This is the actual data returned from a getTile request.
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
std::istream & getline(std::istream &is, ossimString &str, char delim)
Definition: ossimString.h:916
ossim_int32 toInt32() const
double ossim_float64
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
ossim_uint32 m_numOfFramesHorizontal
unsigned int ossim_uint32
void setEntry(const ossimFilename &rootDirectory, const ossimFilename &pathToFrameFileFromRoot)
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...
std::vector< ossimString > m_fileNames
The size of the input frames.
bool empty() const
Definition: ossimString.h:411
ossim_uint32 m_numOfFramesVertical
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ checkLongitude()

void ossimImageCacheBase::checkLongitude ( ossim_float64 leftLon,
const ossim_float64 rightLon 
) const
protected

Method to test for 180.0 <–> 180.00 and set leftLon to -180 if both left and right are 180.0 degrees.

Parameters
leftLonLeft hand side longitude of scene. This is the value that will be flipped to -180 if test is true.
rightLonRight hand side of scene.

Definition at line 295 of file ossimImageCacheBase.cpp.

References ossim::almostEqual().

297 {
298  //---
299  // Test for scene coordinates being 180 to 180 and adjust leftLon to -180
300  // if so.
301  //
302  // NOTE:
303  // Setting tolerance to 1/7200 about 15 meters.
304  // Not sure if this is too loose or not. (drb)
305  //---
306  const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
307 
308  if ( ossim::almostEqual(leftLon, 180.0, TOLERANCE) )
309  {
310  if ( ossim::almostEqual(rightLon, 180.0, TOLERANCE) )
311  {
312  leftLon = -180.0;
313  }
314  }
315 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53
double ossim_float64

◆ close()

void ossimImageCacheBase::close ( )
virtual

Closes this image handler and deletes any allocated data.

Reimplemented from ossimImageHandler.

Reimplemented in ossimImageCacheTileSource.

Definition at line 92 of file ossimImageCacheBase.cpp.

93 {
94  deleteAll();
95 }

◆ deleteAll()

void ossimImageCacheBase::deleteAll ( )
protected

Definition at line 437 of file ossimImageCacheBase.cpp.

438 {
439  theOverview = 0;
440 }
ossimRefPtr< ossimImageHandler > theOverview

◆ establishDecimationFactors()

void ossimImageCacheBase::establishDecimationFactors ( )
protectedvirtual

Virtual method determines the decimation factors at each resolution level.

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

Reimplemented from ossimImageHandler.

Definition at line 501 of file ossimImageCacheBase.cpp.

References ossimImageHandler::establishDecimationFactors().

502 {
503  theDecimationFactors.clear();
504 
505  // Just needed to set the first R level here, the base class can do the rest:
507 }
std::vector< ossimDpt > theDecimationFactors
virtual void establishDecimationFactors()
Virtual method determines the decimation factors at each resolution level.

◆ getEntryList()

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

Reimplemented from ossimImageHandler.

Definition at line 380 of file ossimImageCacheBase.cpp.

381 {
382  entryList.push_back(0);
383 }

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimImageCacheBase::getImageGeometry ( )
virtual


Populates the geometry object with image geometry information.

This method is used to relay projection/model information to users. Returns true if geometry info is present, false if not. Keywords supported by this class are:

*  datum:    // datum code>   // Datum code
*  ul_lat:   // upper left latitude
*  ul_lon:   // upper left longitude
*  ll_lat:   // lower left latitude
*  ll_lon:   // lower left longitude
*  lr_lat:   // lower right latitude
*  lr_lon:   // lower right longitude
*  ur_lat:   // upper right latitude
*  ur_lon:   // upper right longitude
*  number_input_bands:     
*  number_output_bands:    
*  number_lines:           
*  number_samples:
*  decimal_degrees_per_pixel_lat:  // specifies the spacing per pixel along Y direction
*  decimal_degrees_per_pixel_lon:  // specifies the spacing per pixel along X direction
*  origin_latitude:                // specifies the origin or center of the projector for the latitude
*  central_meridian:               // specifies the origin or center of the projector for the longitude
*  tie_point_lat:     // tie point lat.  Represents the latitude of the upper left center of pixel
*  tie_point_lon:     // tie point lon.  Represents the longitude of the upper left center of pixel
*  zone:              // zone read from the CIB/CADRG boundary info
*  type:              // class name of the object for factory driven reconstruction
*  map_scale:         // Map scale of the image
*  
See also
ossimImageSource for further code example on using the geometry.

Reimplemented from ossimImageHandler.

Definition at line 509 of file ossimImageCacheBase.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::CENTRAL_MERIDIAN_KW, ossimKeywordNames::DATUM_KW, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, ossimDpt::lat, ossimGpt::latd(), ossimKeywordNames::LL_LAT_KW, ossimKeywordNames::LL_LON_KW, ossimImageGeometry::loadState(), ossimDpt::lon, ossimGpt::lond(), ossimKeywordNames::LR_LAT_KW, ossimKeywordNames::LR_LON_KW, ossimKeywordNames::NUMBER_INPUT_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimKeywordNames::ORIGIN_LATITUDE_KW, ossimKeywordNames::TIE_POINT_LAT_KW, ossimKeywordNames::TIE_POINT_LON_KW, ossimKeywordNames::TIE_POINT_XY_KW, ossimDpt::toString(), ossimKeywordNames::TYPE_KW, ossimKeywordNames::UL_LAT_KW, ossimKeywordNames::UL_LON_KW, ossimKeywordNames::UR_LAT_KW, and ossimKeywordNames::UR_LON_KW.

510 {
511  if (theGeometry.valid()) return theGeometry;
512 
513  // datum
514  // WGS 84
515  ossimKeywordlist kwl;
516  const char* prefix = 0; // legacy
517  kwl.add(prefix,
519  "WGE",
520  true);
521 
526 
527  double latInterval = fabs(ul.latd() - lr.latd())/ getNumberOfLines();
528  double lonInterval = fabs(ul.lond() - ur.lond())/ getNumberOfSamples();
529 
530  kwl.add(prefix,
532  ul.latd(),//-(latInterval/2.0),
533  true);
534 
535  kwl.add(prefix,
537  ul.lond(),//+(lonInterval/2.0),
538  true);
539 
540  kwl.add(prefix,
542  ll.latd(),//+(latInterval/2.0),
543  true);
544 
545  kwl.add(prefix,
547  ll.lond(),//+(lonInterval/2.0),
548  true);
549 
550  kwl.add(prefix,
552  lr.latd(),//+(latInterval/2.0),
553  true);
554 
555  kwl.add(prefix,
557  lr.lond(),//-(lonInterval/2.0),
558  true);
559 
560  kwl.add(prefix,
562  ur.latd(),//-(latInterval/2.0),
563  true);
564 
565  kwl.add(prefix,
567  ur.lond(),//-(latInterval/2.0),
568  true);
569 
570  kwl.add(prefix,
573  true);
574 
575  kwl.add(prefix,
578  true);
579 
580  kwl.add(prefix,
583  true);
584 
585  kwl.add(prefix,
588  true);
589 
590 
591  //---
592  // Make a projection to get the easting / northing of the tie point and
593  // the scale in meters. This will only be used by the CIB.
594  //---
595  kwl.add(prefix,
597  "WGE",
598  true);
599 
600  ossimGpt origin((ul.latd()+lr.latd())*.5,
601  (ul.lond()+lr.lond())*.5,
602  0.0);
603 
604  double deltaLatPerPixel = latInterval;
605  double deltaLonPerPixel = lonInterval;
606 
607  ossimDpt tie;
608 
609  tie.lat = ul.latd() - deltaLatPerPixel/2.0;
610  tie.lon = ul.lond() + deltaLonPerPixel/2.0;
611 
612  kwl.add(prefix,
614  tie.toString(),
615  true);
616 
617  kwl.add(prefix,
619  deltaLatPerPixel,
620  true);
621 
622  kwl.add(prefix,
624  deltaLonPerPixel,
625  true);
626 
627  kwl.add(prefix,
629  origin.latd(),
630  true);
631 
632  kwl.add(prefix,
634  origin.lond(),
635  true);
636 
637  kwl.add(prefix,
639  ul.latd()-(deltaLatPerPixel/2.0),
640  true);
641 
642  kwl.add(prefix,
644  ul.lond()+(deltaLonPerPixel/2.0),
645  true);
646 
647  kwl.add(prefix,
649  "ossimEquDistCylProjection",
650  true);
651 
652  // Capture this for next time.
654  theGeometry->loadState(kwl, prefix);
655 
656  // Set image things the geometry object should know about.
658 
659  return theGeometry;
660 }
virtual ossim_uint32 getNumberOfInputBands() const
This method allows you to query the number of input bands.
ossimRefPtr< ossimImageGeometry > theGeometry
static const char * DECIMAL_DEGREES_PER_PIXEL_LAT
static const char * DATUM_KW
static const char * CENTRAL_MERIDIAN_KW
Represents serializable keyword/value map.
static const char * UL_LAT_KW
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Attempts to initialize a transform and a projection given the KWL.
static const char * NUMBER_LINES_KW
static const char * TIE_POINT_LON_KW
static const char * NUMBER_INPUT_BANDS_KW
static const char * LR_LON_KW
virtual ossim_uint32 getNumberOfOutputBands() const
This method allows one to query the number of output bands.
static const char * TYPE_KW
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * LR_LAT_KW
double lat
Definition: ossimDpt.h:165
static const char * TIE_POINT_XY_KW
static const char * LL_LON_KW
static const char * NUMBER_OUTPUT_BANDS_KW
static const char * DECIMAL_DEGREES_PER_PIXEL_LON
static const char * LL_LAT_KW
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
double lon
Definition: ossimDpt.h:164
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.
static const char * ORIGIN_LATITUDE_KW
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160
static const char * UL_LON_KW
static const char * UR_LAT_KW
static const char * UR_LON_KW
static const char * TIE_POINT_LAT_KW
static const char * NUMBER_SAMPLES_KW

◆ getImageRectangle()

ossimIrect ossimImageCacheBase::getImageRectangle ( ossim_uint32  reduced_res_level = 0) const
virtual
Parameters
reduced_res_levelWhich res level to get the bounds for. 0 represents the default and is the full resolution.
Returns
A rectangle representing the bounds for the passed in resolution level.

Reimplemented from ossimImageHandler.

Definition at line 360 of file ossimImageCacheBase.cpp.

361 {
362  return ossimIrect(0, // upper left x
363  0, // upper left y
364  getNumberOfSamples(reduced_res_level) - 1, // lower right x
365  getNumberOfLines(reduced_res_level) - 1); // lower right y
366 }
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.

◆ getImageTileHeight()

ossim_uint32 ossimImageCacheBase::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.

Implements ossimImageHandler.

Definition at line 496 of file ossimImageCacheBase.cpp.

497 {
498  return 256;
499 }

◆ getImageTileWidth()

ossim_uint32 ossimImageCacheBase::getImageTileWidth ( ) const
virtual

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

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

Implements ossimImageHandler.

Definition at line 491 of file ossimImageCacheBase.cpp.

492 {
493  return 256;
494 }

◆ getIntersectingEntries()

vector< ossimImageCacheBase::ossimFrameEntryData > ossimImageCacheBase::getIntersectingEntries ( const ossimIrect rect)
protected

It is important to note that each frame is organized into an easting northing type orientation.

This means that a frame at 0,0 is at the lower left corner. Each frame's pixel data is has 0,0 at the upper left.

It will take the curent region to render and then find all entries that intersect that region.

Parameters
rectthe current region to render.
Returns
The list of entry data objects found for this rect.

Definition at line 401 of file ossimImageCacheBase.cpp.

References ossimIrect::clipToRect(), ossimRpfFrameEntry::exists(), ossimIrect::intersects(), ossimIrect::lr(), ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

402 {
403  vector<ossimFrameEntryData> result;
404 
405  // make sure we have the Toc entry to render
406  if(!isOpen()) return result;
407 
408  ossimIrect imageRect = getImageRectangle();
409  if(rect.intersects(imageRect))
410  {
411  ossimIrect clipRect = rect.clipToRect(imageRect);
412  ossimIrect frameRect(clipRect.ul().x/m_frame_width,
413  clipRect.ul().y/m_frame_height,
414  clipRect.lr().x/m_frame_width,
415  clipRect.lr().y/m_frame_height);
416 
417  for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
418  {
419  for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
420  {
421  ossimRpfFrameEntry tempEntry = m_frameEntryArray[row][col];
422  if(tempEntry.exists())
423  {
424  result.push_back(ossimFrameEntryData(row,
425  col,
426  row*m_frame_height,
427  col*m_frame_width,
428  tempEntry));
429  }
430  }
431  }
432  }
433 
434  return result;
435 }
const ossimIpt & ul() const
Definition: ossimIrect.h:274
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
bool isOpen() const
Determines if its open if there eists a table of contents object.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
int ossim_int32

◆ getNumberOfInputBands()

ossim_uint32 ossimImageCacheBase::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.

Implements ossimImageSource.

Reimplemented in ossimImageCacheTileSource.

Definition at line 317 of file ossimImageCacheBase.cpp.

318 {
319  return m_numberOfBands;
320 }
ossim_uint32 m_numberOfBands
This is the actual data returned from a getTile request.

◆ getNumberOfLines()

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

Satisfies pure virtual requirement from ImageHandler class.

Parameters
reduced_res_levelThe reduced res level to query number of lines from.
Returns
The number of lines in the image.

Implements ossimImageHandler.

Definition at line 327 of file ossimImageCacheBase.cpp.

328 {
329  if (reduced_res_level == 0)
330  {
331  return m_numberOfLines;
332  }
333  else if (theOverview.valid())
334  {
335  return theOverview->getNumberOfLines(reduced_res_level);
336  }
337 
338  return 0;
339 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossimRefPtr< ossimImageHandler > theOverview
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.

◆ getNumberOfOutputBands()

ossim_uint32 ossimImageCacheBase::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 ossimImageSource.

Reimplemented in ossimImageCacheTileSource.

Definition at line 322 of file ossimImageCacheBase.cpp.

323 {
324  return m_numberOfBands;
325 }
ossim_uint32 m_numberOfBands
This is the actual data returned from a getTile request.

◆ getNumberOfSamples()

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

Satisfies pure virtual requirement from ImageHandler class.

Parameters
reduced_res_levelThe reduced res level to query number of samples from.
Returns
The number of samples in the image.

Implements ossimImageHandler.

Definition at line 341 of file ossimImageCacheBase.cpp.

342 {
343  if (reduced_res_level == 0)
344  {
345  return m_numberOfSamples;
346  }
347  else if (theOverview.valid())
348  {
349  return theOverview->getNumberOfSamples(reduced_res_level);
350  }
351 
352  return 0;
353 }
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.

◆ getTileHeight()

ossim_uint32 ossimImageCacheBase::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 375 of file ossimImageCacheBase.cpp.

376 {
377  return m_tileSize.y;
378 }
ossimIpt m_tileSize
The size of the output tile.
ossim_int32 y
Definition: ossimIpt.h:142

◆ getTileWidth()

ossim_uint32 ossimImageCacheBase::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 370 of file ossimImageCacheBase.cpp.

371 {
372  return m_tileSize.x;
373 }
ossimIpt m_tileSize
The size of the output tile.
ossim_int32 x
Definition: ossimIpt.h:141

◆ isOpen()

bool ossimImageCacheBase::isOpen ( ) const
virtual

Determines if its open if there eists a table of contents object.

Returns
True if the handler is open and flase otherwise.

Implements ossimImageHandler.

Definition at line 97 of file ossimImageCacheBase.cpp.

References ossimString::downcase().

98 {
99  //return (theTableOfContents!=0);
101 
102  if(ext == "rpf")
103  {
104  return true;
105  }
106  else
107  {
108  return false;
109  }
110 }
ossimFilename theImageFile
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ isValidRLevel()

bool ossimImageCacheBase::isValidRLevel ( ossim_uint32  reduced_res_level) const
virtual
Parameters
reduced_res_levelpassed in resolution level.
Returns
True if the reduced_res_level is within an acceptable range and false otherwise.

Reimplemented from ossimImageHandler.

Definition at line 385 of file ossimImageCacheBase.cpp.

386 {
387  if (reduced_res_level == 0)
388  {
389  return true;
390  }
391  else if (theOverview.valid())
392  {
393  return theOverview->isValidRLevel(reduced_res_level);
394  }
395  else
396  {
397  return false;
398  }
399 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
ossimRefPtr< ossimImageHandler > theOverview

◆ loadState()

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

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

Loading with a prefix.

cibCadrgHandler->laodState(kwl, "handler1.");

Loading without a prefix.

cibCadrgHandler->laodState(kwl);

Since all objects are factory created you can go through the registry and pass the keyword list in.

Parameters
kwlKeywordlist that holds the state information for this object.
prefixprefix value prepended to all keywords to uniquely locate the state attributes for this object.

Reimplemented from ossimImageHandler.

Definition at line 450 of file ossimImageCacheBase.cpp.

452 {
453  const char* MODULE = "ossimImageCacheBase::loadState";
454 
455  if(traceDebug())
456  {
457  CLOG << "Entering..." << endl;
458  }
459  bool result = ossimImageHandler::loadState(kwl, prefix);
460 
461  if(!result)
462  {
463  if(traceDebug())
464  {
465  CLOG << "Leaving..." << endl;
466  }
467  return false;
468  }
469  const char* lookup = 0;
470  lookup = kwl.find(ossimString(prefix), "entry");
471  ossim_int32 entry = ossimString(lookup).toInt32();
472 
473  // if an entry is specified then
474  // call the open with an entry number
475  if(lookup)
476  {
477  if(traceDebug())
478  {
479  CLOG << "Leaving..." << endl;
480  }
482  setCurrentEntry(entry);
483  return result;
484  }
485 
487 
488  return result;
489 }
virtual bool open()=0
Pure virtual open.
#define CLOG
Definition: ossimTrace.h:23
ossimFilename theImageFile
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossim_int32 toInt32() const
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
int ossim_int32

◆ open()

virtual bool ossimImageCacheBase::open ( )
pure virtual

Pure virtual open.

Derived classes must implement.

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

Implements ossimImageHandler.

Implemented in ossimImageCacheTileSource.

◆ saveState()

bool ossimImageCacheBase::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual
Parameters
kwlKeywordlist to save the state of the object to.
prefixprefix to prepend to the keywords. This will help uniquely identify each keyword if multiple objects are saved to the same list.
Returns
True if successfully saved the state of the object and false otherwise.

Reimplemented from ossimImageHandler.

Definition at line 442 of file ossimImageCacheBase.cpp.

References ossimImageHandler::saveState().

444 {
445  bool result = ossimImageHandler::saveState(kwl, prefix);
446 
447  return result;
448 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setActualImageRect()

void ossimImageCacheBase::setActualImageRect ( )
protected

Will shift the rect and clamp it so not to go outside the -180 to 180 degree range.

Definition at line 355 of file ossimImageCacheBase.cpp.

356 {
358 }
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
ossimIrect m_actualImageRect
This holds the image bounds for the current entry.
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.

Member Data Documentation

◆ m_actualImageRect

ossimIrect ossimImageCacheBase::m_actualImageRect
protected

This holds the image bounds for the current entry.

Definition at line 288 of file ossimImageCacheBase.h.

◆ m_bBox_LL_Lat

ossim_float64 ossimImageCacheBase::m_bBox_LL_Lat
protected

Definition at line 324 of file ossimImageCacheBase.h.

◆ m_bBox_LL_Lon

ossim_float64 ossimImageCacheBase::m_bBox_LL_Lon
protected

Definition at line 323 of file ossimImageCacheBase.h.

◆ m_bBox_UR_Lat

ossim_float64 ossimImageCacheBase::m_bBox_UR_Lat
protected

Definition at line 326 of file ossimImageCacheBase.h.

◆ m_bBox_UR_Lon

ossim_float64 ossimImageCacheBase::m_bBox_UR_Lon
protected

Definition at line 325 of file ossimImageCacheBase.h.

◆ m_fileNames

std::vector<ossimString> ossimImageCacheBase::m_fileNames
protected

The size of the input frames.

Definition at line 312 of file ossimImageCacheBase.h.

◆ m_frame_height

ossim_uint32 ossimImageCacheBase::m_frame_height
protected

Definition at line 330 of file ossimImageCacheBase.h.

◆ m_frame_width

ossim_uint32 ossimImageCacheBase::m_frame_width
protected

Definition at line 329 of file ossimImageCacheBase.h.

◆ m_frameEntryArray

std::vector< std::vector<ossimRpfFrameEntry> > ossimImageCacheBase::m_frameEntryArray
protected

Definition at line 332 of file ossimImageCacheBase.h.

◆ m_numberOfBands

ossim_uint32 ossimImageCacheBase::m_numberOfBands
protected

This is the actual data returned from a getTile request.

Definition at line 307 of file ossimImageCacheBase.h.

◆ m_numberOfLines

ossim_uint32 ossimImageCacheBase::m_numberOfLines
protected

This will be computed based on the frames organized within the directory.

The CibCadrg have fixed size frames of 1536x1536 and we must count how many there are.

Definition at line 295 of file ossimImageCacheBase.h.

◆ m_numberOfSamples

ossim_uint32 ossimImageCacheBase::m_numberOfSamples
protected

This will be computed based on the frames organized within the directory.

The CibCadrg have fixed size frames of 1536x1536 and we must count how many there are.

Definition at line 302 of file ossimImageCacheBase.h.

◆ m_numOfFramesHorizontal

ossim_uint32 ossimImageCacheBase::m_numOfFramesHorizontal
protected

Definition at line 328 of file ossimImageCacheBase.h.

◆ m_numOfFramesVertical

ossim_uint32 ossimImageCacheBase::m_numOfFramesVertical
protected

Definition at line 327 of file ossimImageCacheBase.h.

◆ m_tileSize

ossimIpt ossimImageCacheBase::m_tileSize
protected

The size of the output tile.

Definition at line 317 of file ossimImageCacheBase.h.

◆ m_workFrame

ossimRpfFrame* ossimImageCacheBase::m_workFrame
mutableprotected

Definition at line 319 of file ossimImageCacheBase.h.


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