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

#include <ossimRpfCacheTileSource.h>

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

Classes

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

Public Types

enum  ossimRpfCacheProductType { OSSIM_PRODUCT_TYPE_UNKNOWN = 0, OSSIM_PRODUCT_TYPE_CIB = 1, OSSIM_PRODUCT_TYPE_CADRG = 2 }
 Basic enumeration. More...
 
- 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
 

Public Member Functions

 ossimRpfCacheTileSource ()
 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 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 ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 
Populates the geometry object with image geometry information. 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 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 bool setCurrentEntry (ossim_uint32 entryIdx)
 
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...
 
bool isCib () const
 
bool isCadrg () const
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 Gets a property for matching name. 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 void setProperty (ossimRefPtr< ossimProperty > property)
 
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
 

Static Public Attributes

static const ossim_uint32 CIBCADRG_FRAME_WIDTH = 1536
 CONSTANT representing the width of a Frame. More...
 
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT = 1536
 CONSTANT representing the height of a Frame. More...
 

Protected Member Functions

virtual ~ossimRpfCacheTileSource ()
 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...
 
virtual bool setEntryToRender (ossim_uint32 index)
 Sets the entry to render. More...
 
vector< ossimFrameEntryDatagetIntersectingEntries (const ossimIrect &rect)
 It is important to note that each frame is organized into an easting northing type orientation. More...
 
void fillTile (const ossimIrect &tileRect, const vector< ossimFrameEntryData > &framesInvolved, ossimImageData *tile)
 This is a wrapper for the fill cib and fill cadrg. More...
 
void fillSubTileCib (const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
 Will uncompress the CIB file using a VQ decompression algorithm. More...
 
void fillSubTileCadrg (const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
 Will uncompress the CADRG file using a VQ decompression algorithm. More...
 
void allocateForProduct ()
 Will allocate an internal buffer for the given product. More...
 
void deleteAll ()
 
void populateLut ()
 
bool buildFrameEntryArray (ossimFilename imageFile)
 
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...
 
unsigned char * m_compressedBuffer
 This is for storage of a single compressed buffer. More...
 
unsigned char * m_uncompressedBuffer
 This is used as a buffer to uncompress the data to. 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...
 
ossimRefPtr< ossimImageDatam_tile
 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...
 
ossimRpfCacheProductType m_productType
 Holds the enumeration specifying the product type. 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
 
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
 

Detailed Description

Definition at line 22 of file ossimRpfCacheTileSource.h.

Member Enumeration Documentation

◆ ossimRpfCacheProductType

Basic enumeration.

This should be either a CIB or a CADRG product type.

Enumerator
OSSIM_PRODUCT_TYPE_UNKNOWN 
OSSIM_PRODUCT_TYPE_CIB 
OSSIM_PRODUCT_TYPE_CADRG 

Definition at line 31 of file ossimRpfCacheTileSource.h.

Constructor & Destructor Documentation

◆ ossimRpfCacheTileSource()

ossimRpfCacheTileSource::ossimRpfCacheTileSource ( )

Default constructor.

Initializes all internal attributes to a default state.

Definition at line 51 of file ossimRpfCacheTileSource.cpp.

52  :
54 
55  // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
56  // convert to bytes
57  m_compressedBuffer(new ossim_uint8[(64*64*12)/8]),
58 
59  // whether CIB or CADRG we will alocate the buffer
60  // to the larger of the 2 (CADRG is 3 bands)
61  m_uncompressedBuffer(new ossim_uint8[256*256*3]),
62 
63  m_numberOfLines(0),
65  m_tile(0),
66  m_fileNames(),
67  m_tileSize(128, 128),
70  m_bBox_LL_Lon(0.0),
71  m_bBox_LL_Lat(0.0),
72  m_bBox_UR_Lon(0.0),
73  m_bBox_UR_Lat(0.0),
77 {
78  if (traceDebug())
79  {
81  << "ossimRpfCacheTileSource::ossimRpfCacheTileSource entered...\n";
82 #ifdef OSSIM_ID_ENABLED
84  << "OSSIM_ID: " << OSSIM_ID << "\n";
85 #endif
86  }
87 
89 
90 }
std::vector< ossimString > m_fileNames
The size of the input frames.
ossimIrect m_actualImageRect
This holds the image bounds for the current entry.
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
unsigned char * m_compressedBuffer
This is for storage of a single compressed buffer.
ossimIpt m_tileSize
The size of the output tile.
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
unsigned char * m_uncompressedBuffer
This is used as a buffer to uncompress the data to.
void makeNan()
Definition: ossimIrect.h:329
ossimImageHandler()
Constructor (default):
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.

◆ ~ossimRpfCacheTileSource()

ossimRpfCacheTileSource::~ossimRpfCacheTileSource ( )
protectedvirtual

Destructor.

Will return allocated memory back to the heap.

Definition at line 92 of file ossimRpfCacheTileSource.cpp.

References close(), m_compressedBuffer, m_uncompressedBuffer, and m_workFrame.

93 {
95  {
96  delete [] m_compressedBuffer;
98  }
100  {
101  delete [] m_uncompressedBuffer;
103  }
104  if(m_workFrame)
105  {
106  delete m_workFrame;
107  m_workFrame = 0;
108  }
109  close();
110 }
unsigned char * m_compressedBuffer
This is for storage of a single compressed buffer.
unsigned char * m_uncompressedBuffer
This is used as a buffer to uncompress the data to.
virtual void close()
Closes this image handler and deletes any allocated data.

Member Function Documentation

◆ allocateForProduct()

void ossimRpfCacheTileSource::allocateForProduct ( )
protected

Will allocate an internal buffer for the given product.

If the product is a CIB then it is a single band OSSIM_UCHAR buffer and if its a CADRG it is a 3 band OSSIM_UCHAR buffer.

Definition at line 1111 of file ossimRpfCacheTileSource.cpp.

References ossimImageDataFactory::create(), ossimImageData::initialize(), ossimImageDataFactory::instance(), m_compressedBuffer, m_productType, m_tile, m_uncompressedBuffer, OSSIM_PRODUCT_TYPE_CIB, and OSSIM_PRODUCT_TYPE_UNKNOWN.

1112 {
1114  {
1115  return;
1116  }
1118  {
1119  delete [] m_uncompressedBuffer;
1121  }
1122  if(m_compressedBuffer)
1123  {
1124  delete [] m_compressedBuffer;
1125  m_compressedBuffer = 0;
1126  }
1127 
1128  // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
1129  // convert to bytes
1130  m_compressedBuffer = new ossim_uint8[(64*64*12)/8];
1132  {
1133  m_uncompressedBuffer = new ossim_uint8[256*256];
1134  }
1135  else
1136  {
1137  m_uncompressedBuffer = new ossim_uint8[256*256*3];
1138  }
1139 
1141  m_tile->initialize();
1142 }
virtual void initialize()
Initialize the data buffer.
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.
static ossimImageDataFactory * instance()
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
unsigned char * m_compressedBuffer
This is for storage of a single compressed buffer.
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
unsigned char * m_uncompressedBuffer
This is used as a buffer to uncompress the data to.
unsigned char ossim_uint8

◆ buildFrameEntryArray()

bool ossimRpfCacheTileSource::buildFrameEntryArray ( ossimFilename  imageFile)
protected

Definition at line 190 of file ossimRpfCacheTileSource.cpp.

191 {
192  static const char MODULE[] = "ossimRpfCacheTileSource::buildFrameEntryArray";
193  if ( traceDebug() )
194  {
195  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
196  }
197 
198  std::ifstream in((imageFile).c_str() );
199 
200  std::string line;
201  ossim_uint32 index = 0; // used throughout
202  while( in.good() )
203  {
204  // Read in a line.
205  std::getline(in, line);
206 
207  ossimString tmpStr = ossimString(line);
208  if (!tmpStr.empty())
209  {
210  if (index == 0)
211  {
212  std::vector<ossimString> box_lat_lon;
213  tmpStr.split(box_lat_lon, "|");
214 
215  if (box_lat_lon.size() > 2)
216  {
217  std::vector<ossimString> ll;
218  std::vector<ossimString> ur;
219 
220  box_lat_lon[0].split(ll, ",");
221  box_lat_lon[1].split(ur, ",");
222  ossimString bandStr = box_lat_lon[2];
223 
224  m_bBox_LL_Lon = ll[0].toFloat64();
225  m_bBox_LL_Lat = ll[1].toFloat64();
226  m_bBox_UR_Lon = ur[0].toFloat64();
227  m_bBox_UR_Lat = ur[1].toFloat64();
228 
230 
231  ossim_int32 bands = ossimString(bandStr).toInt32();
232  if (bands == 1)
233  {
235  }
236  else if (bands == 3)
237  {
239  }
240  }
241  else
242  {
243  return false;
244  }
245  }
246  else if (index == 1)
247  {
248  m_fileNames.push_back(tmpStr);
249  std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
250  if (frame_lat_lon.size() > 2)
251  {
252  ossimString ll_lon_lat = frame_lat_lon[1];
253  ossimString ur_lon_lat = frame_lat_lon[2];
254  ossim_float64 ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
255  ossim_float64 ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
256  ossim_float64 ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
257  ossim_float64 ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
258 
259  checkLongitude(ll_lon, ur_lon);
260 
261  ossim_float64 bBox_lat_diff = std::fabs(m_bBox_UR_Lat - m_bBox_LL_Lat);
262  ossim_float64 bBox_lon_diff = std::fabs(m_bBox_UR_Lon - m_bBox_LL_Lon);
263 
264  ossim_float64 lat_diff = std::fabs(ur_lat - ll_lat);
265  ossim_float64 lon_diff = std::fabs(ur_lon - ll_lon);
266 
267  m_numOfFramesVertical = static_cast<ossim_uint32>(bBox_lat_diff/lat_diff + 0.5);
268  m_numOfFramesHorizontal = static_cast<ossim_uint32>(bBox_lon_diff/lon_diff + 0.5);
269 
272 
273  if ( traceDebug() )
274  {
276  << "\nscene height in degrees: " << bBox_lat_diff
277  << "\nscene width in degrees: " << bBox_lon_diff
278  << "\nframe height in degrees: " << lat_diff
279  << "\nframe width in degrees: " << lon_diff
280  << "\nframes vertical: " << m_numOfFramesVertical
281  << "\nframes horizontal: " << m_numOfFramesHorizontal
282  << "\nlines: " << m_numberOfLines
283  << "\nsamples: " << m_numberOfSamples << "\n";
284  }
285  }
286  else
287  {
288  return false;
289  }
290  }
291  else
292  {
293  m_fileNames.push_back(tmpStr);
294  }
295 
296  } // matches: if (!tmpStr.empty())
297 
298  ++index;
299 
300  } // matches: while( in.good() )
301  in.close();
302 
304  for(index = 0; index < m_frameEntryArray.size(); ++index)
305  {
307  }
308 
309  for(index = 0; index < m_fileNames.size(); ++index)
310  {
311  ossimString tmpStr = m_fileNames[index];
312  std::vector<ossimString> frameInfos = tmpStr.split("|");
313  if (frameInfos.size() > 1)
314  {
315  ossimString fileName = frameInfos[0];
316  ossimString ll_lon_lat = frameInfos[1];
317  ossimString ur_lon_lat = frameInfos[2];
318  double ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
319  double ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
320  double ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
321  double ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
322 
323  checkLongitude(ll_lon, ur_lon);
324 
325  ossim_float64 tmpColPostion = std::fabs(ll_lon - m_bBox_LL_Lon);
326  ossim_float64 tmpFrameLon = std::fabs(ur_lon - ll_lon);
327 
328  ossim_float64 tmpRowPostion = std::fabs(m_bBox_UR_Lat - ur_lat);
329  ossim_float64 tmpFrameLat = std::fabs(ur_lat - ll_lat);
330 
331  ossim_uint32 colNum = static_cast<ossim_uint32>(tmpColPostion/tmpFrameLon + 0.5);
332  ossim_uint32 rowNum = static_cast<ossim_uint32>(tmpRowPostion/tmpFrameLat + 0.5);
333 
334  if (colNum >= m_numOfFramesHorizontal)
335  {
336  colNum = m_numOfFramesHorizontal-1; // Clamp to last column.
337  }
338 
339  if (rowNum >= m_numOfFramesVertical)
340  {
341  rowNum = m_numOfFramesVertical-1; // Clamp to last row.
342  }
343 
344  ossimRpfFrameEntry tempEntry;
345  tempEntry.setEntry(ossimFilename(""), fileName);
346  m_frameEntryArray[rowNum][colNum] = tempEntry;
347  }
348  else
349  {
350  return false;
351  }
352  }
353 
354  return true;
355 }
std::vector< ossimString > m_fileNames
The size of the input frames.
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
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
unsigned int ossim_uint32
void setEntry(const ossimFilename &rootDirectory, const ossimFilename &pathToFrameFileFromRoot)
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
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...
bool empty() const
Definition: ossimString.h:411
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.
ossim_uint32 m_numberOfLines
This will be computed based on the frames organized within the directory.
int ossim_int32

◆ checkLongitude()

void ossimRpfCacheTileSource::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 357 of file ossimRpfCacheTileSource.cpp.

References ossim::almostEqual().

359 {
360  //---
361  // Test for scene coordinates being 180 to 180 and adjust leftLon to -180
362  // if so.
363  //
364  // NOTE:
365  // Setting tolerance to 1/7200 about 15 meters.
366  // Not sure if this is too loose or not. (drb)
367  //---
368  const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
369 
370  if ( ossim::almostEqual(leftLon, 180.0, TOLERANCE) )
371  {
372  if ( ossim::almostEqual(rightLon, 180.0, TOLERANCE) )
373  {
374  leftLon = -180.0;
375  }
376  }
377 }
bool almostEqual(T x, T y, T tolerance=FLT_EPSILON)
Definition: ossimCommon.h:53
double ossim_float64

◆ close()

void ossimRpfCacheTileSource::close ( )
virtual

Closes this image handler and deletes any allocated data.

Reimplemented from ossimImageHandler.

Definition at line 123 of file ossimRpfCacheTileSource.cpp.

References deleteAll().

Referenced by ~ossimRpfCacheTileSource().

124 {
125  deleteAll();
126 }

◆ deleteAll()

void ossimRpfCacheTileSource::deleteAll ( )
protected

Definition at line 1144 of file ossimRpfCacheTileSource.cpp.

References ossimImageHandler::theOverview.

Referenced by close().

1145 {
1146  theOverview = 0;
1147 }
ossimRefPtr< ossimImageHandler > theOverview

◆ establishDecimationFactors()

void ossimRpfCacheTileSource::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 1307 of file ossimRpfCacheTileSource.cpp.

References ossimImageHandler::establishDecimationFactors(), and ossimImageHandler::theDecimationFactors.

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

◆ fillSubTileCadrg()

void ossimRpfCacheTileSource::fillSubTileCadrg ( const ossimRpfFrame aFrame,
const ossimIrect tileRect,
const ossimFrameEntryData frameEntryData,
ossimImageData tile 
)
protected

Will uncompress the CADRG file using a VQ decompression algorithm.

Parameters
aFrameFrame that overlaps the requested tile rect.
tileRectThe region requested to render.
frameEntryDataThe frame entry data.

Definition at line 832 of file ossimRpfCacheTileSource.cpp.

References CIBCADRG_FRAME_HEIGHT, CIBCADRG_FRAME_WIDTH, ossimIrect::clipToRect(), ossimRpfFrame::fillSubFrameBuffer(), ossimRpfFrame::getColorGrayscaleTable(), ossimRpfFrame::getCompressionSection(), ossimRpfCompressionSection::getTable(), ossimIrect::height(), ossimImageData::loadTile(), m_compressedBuffer, m_uncompressedBuffer, OSSIM_BSQ, ossimRpfCacheTileSource::ossimFrameEntryData::thePixelCol, ossimRpfCacheTileSource::ossimFrameEntryData::thePixelRow, ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by fillTile().

837 {;
838 // first let's grab the absolute position of the frame rectangle in pixel space
839  ossimIrect frameRect(frameEntryData.thePixelCol,
840  frameEntryData.thePixelRow,
841  frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH - 1,
842  frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
843 
844 
845 // now clip it to the tile
846  ossimIrect clipRect = tileRect.clipToRect(frameRect);
847 
848  const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
849 
850  if(!compressionSection)
851  {
852  return;
853  }
854 
855  const vector<ossimRpfColorGrayscaleTable>& colorTable =
856  aFrame.getColorGrayscaleTable();
857 
858 // ESH 03/2009 -- Partial fix for ticket #646.
859 // Crash fix on reading RPFs: Make sure the colorTable vector
860 // has entries before trying to make use of them.
861  int numTables = (int)colorTable.size();
862  if ( numTables <= 0 )
863  {
864  return;
865  }
866 
867  ossim_uint8 *tempRows[3];
868 
869  tempRows[0] = m_uncompressedBuffer;
870  tempRows[1] = (m_uncompressedBuffer + 256*256);
871  tempRows[2] = (tempRows[1] + 256*256);
872 
873 // find the shift to 0,0
874  ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
875  clipRect.ul().y - frameEntryData.thePixelRow);
876 
877 
878 // In order to compute the subframe we will need the corner offsets of
879 // the upper left of the frame and the upper left of the clip rect. The
880 // clip rect should be completely within the frame. This just translates the value
881 // to make the upper left of the frame be 0,0.
882 //
883  ossimIrect offsetRect(tempDelta.x,
884  tempDelta.y,
885  tempDelta.x + clipRect.width()-1,
886  tempDelta.y + clipRect.height()-1);
887 
888 // each subframe is 64x64. We will actually use 256x256 since
889 // we will be uncompressing them. Note CADRG is a 256x256 tile
890 // compressed to 64x64x12 bit data
891 //
892  ossimIrect subFrameRect(offsetRect.ul().x/256,
893  offsetRect.ul().y/256,
894  (offsetRect.lr().x)/256,
895  (offsetRect.lr().y)/256);
896 
897  ossim_uint32 readPtr = 0;
898 
899  ossim_int32 row = 0;
900  ossim_int32 col = 0;
901  ossim_uint32 i = 0;
902  ossim_uint32 j = 0;
903  ossim_int32 upperY = subFrameRect.lr().y;
904  ossim_int32 upperX = subFrameRect.lr().x;
905  ossim_int32 lowerY = subFrameRect.ul().y;
906  ossim_int32 lowerX = subFrameRect.ul().x;
907  for(row = lowerY; row <= upperY; ++row)
908  {
909  for(col = lowerX; col <= upperX; ++col)
910  {
911  readPtr = 0;
912  if(aFrame.fillSubFrameBuffer(m_compressedBuffer, 0, row, col))
913  {
914  for (i = 0; i < 256; i += 4)
915  {
916  for (j = 0; j < 256; j += 8)
917  {
918  ossim_uint16 firstByte = m_compressedBuffer[readPtr++] & 0xff;
919  ossim_uint16 secondByte = m_compressedBuffer[readPtr++] & 0xff;
920  ossim_uint16 thirdByte = m_compressedBuffer[readPtr++] & 0xff;
921 
922  //because dealing with half-bytes is hard, we
923  //uncompress two 4x4 tiles at the same time. (a
924  //4x4 tile compressed is 12 bits )
925  // this little code was grabbed from openmap software.
926 
927  /* Get first 12-bit value as index into VQ table */
928  // I think we need to swap
929  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
930 
931  /* Get second 12-bit value as index into VQ table*/
932  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
933 
934  for (ossim_uint32 t = 0; t < 4; ++t)
935  {
936  for (ossim_uint32 e = 0; e < 4; ++e)
937  {
938  ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
939  ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
940 
941  ossim_uint32 pixindex = ((i+t)*256) +
942  (j + e);
943  const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
944  const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
945 
946 
947  tempRows[0][pixindex] = color1[0];
948  tempRows[1][pixindex] = color1[1];
949  tempRows[2][pixindex] = color1[2];
950 
951  tempRows[0][pixindex+4] = color2[0];
952  tempRows[1][pixindex+4] = color2[1];
953  tempRows[2][pixindex+4] = color2[2];
954  } //for e
955  } //for t
956  } /* for j */
957  } //for i
958  }
959  else
960  {
961  memset(m_uncompressedBuffer, 0, 256*256*3);
962  }
963  ossim_int32 tempCol = col*256;
964  ossim_int32 tempRow = row*256;
965  ossimIrect subRectToFill(frameRect.ul().x + tempCol,
966  frameRect.ul().y + tempRow,
967  frameRect.ul().x + tempCol + 255,
968  frameRect.ul().y + tempRow + 255);
970  subRectToFill,
971  OSSIM_BSQ);
972  }
973  }
974 }
const std::vector< ossimRpfCompressionOffsetTableData > & getTable() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
unsigned short ossim_uint16
const vector< ossimRpfColorGrayscaleTable > & getColorGrayscaleTable() const
Definition: ossimRpfFrame.h:80
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
bool fillSubFrameBuffer(ossim_uint8 *buffer, ossim_uint32 spectralGroup, ossim_uint32 row, ossim_uint32 col) const
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
unsigned int ossim_uint32
unsigned char * m_compressedBuffer
This is for storage of a single compressed buffer.
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
unsigned char * m_uncompressedBuffer
This is used as a buffer to uncompress the data to.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
const ossimRpfCompressionSection * getCompressionSection() const
Definition: ossimRpfFrame.h:76
unsigned char ossim_uint8
int ossim_int32

◆ fillSubTileCib()

void ossimRpfCacheTileSource::fillSubTileCib ( const ossimRpfFrame aFrame,
const ossimIrect tileRect,
const ossimFrameEntryData frameEntryData,
ossimImageData tile 
)
protected

Will uncompress the CIB file using a VQ decompression algorithm.

Parameters
aFrameFrame that overlaps the requested tile rect.
tileRectThe region requested to render.
frameEntryDataThe frame entry data.

Definition at line 976 of file ossimRpfCacheTileSource.cpp.

References CIBCADRG_FRAME_HEIGHT, CIBCADRG_FRAME_WIDTH, ossimIrect::clipToRect(), ossimRpfFrame::fillSubFrameBuffer(), ossimRpfFrame::getColorGrayscaleTable(), ossimRpfFrame::getCompressionSection(), ossimRpfCompressionSection::getTable(), ossimIrect::height(), ossimImageData::loadTile(), m_compressedBuffer, m_uncompressedBuffer, OSSIM_BSQ, ossimRpfCacheTileSource::ossimFrameEntryData::thePixelCol, ossimRpfCacheTileSource::ossimFrameEntryData::thePixelRow, ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by fillTile().

981 {
982  // first let's grab the absolute position of the frame rectangle in pixel
983  // space
984  ossimIrect frameRect(frameEntryData.thePixelCol,
985  frameEntryData.thePixelRow,
986  frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH - 1,
987  frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
988 
989 
990  // now clip it to the tile
991  ossimIrect clipRect = tileRect.clipToRect(frameRect);
992 
993  const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
994 
995  if(!compressionSection)
996  {
997  return;
998  }
999 
1000  const vector<ossimRpfColorGrayscaleTable>& colorTable =
1001  aFrame.getColorGrayscaleTable();
1002 
1003  // ESH 03/2009 -- Partial fix for ticket #646.
1004  // Crash fix on reading RPFs: Make sure the colorTable vector
1005  // has entries before trying to make use of them.
1006  int numTables = (int)colorTable.size();
1007  if ( numTables <= 0 )
1008  {
1009  return;
1010  }
1011 
1012  // check to see if it does overlap. If it doesn't then the width and height
1013  // will be a single point
1014  {
1015  ossim_uint8 *tempRow;
1016 
1017  tempRow = m_uncompressedBuffer;
1018 
1019  // find the shift to 0,0
1020  ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
1021  clipRect.ul().y - frameEntryData.thePixelRow);
1022 
1023  // In order to compute the subframe we will need the corner offsets of
1024  // the upper left of the frame and the upper left of the clip rect. The
1025  // clip rect should be completely within the frame. This just translates the value
1026  // to make the upper left of the frame be 0,0.
1027  //
1028  ossimIrect offsetRect(tempDelta.x,
1029  tempDelta.y,
1030  tempDelta.x + clipRect.width()-1,
1031  tempDelta.y + clipRect.height()-1);
1032 
1033  // each subframe is 64x64. We will actually use 256x256 since
1034  // we will be uncompressing them. Note CADRG is a 256x256 tile
1035  // compressed to 64x64x12 bit data
1036  //
1037  ossimIrect subFrameRect(offsetRect.ul().x/256,
1038  offsetRect.ul().y/256,
1039  (offsetRect.lr().x)/256,
1040  (offsetRect.lr().y)/256);
1041 
1042  ossim_int32 row = 0;
1043  ossim_int32 col = 0;
1044  ossim_uint32 i = 0;
1045  ossim_uint32 j = 0;
1046  ossim_uint32 readPtr = 0;
1047  for(row = subFrameRect.ul().y; row <= subFrameRect.lr().y; ++row)
1048  {
1049  for(col = subFrameRect.ul().x; col <= subFrameRect.lr().x; ++col)
1050  {
1051  readPtr = 0;
1052  if(aFrame.fillSubFrameBuffer(m_compressedBuffer, 0, row, col))
1053  {
1054  for (i = 0; i < 256; i += 4)
1055  {
1056  for (j = 0; j < 256; j += 8)
1057  {
1058  ossim_uint16 firstByte = m_compressedBuffer[readPtr++] & 0xff;
1059  ossim_uint16 secondByte = m_compressedBuffer[readPtr++] & 0xff;
1060  ossim_uint16 thirdByte = m_compressedBuffer[readPtr++] & 0xff;
1061 
1062  //because dealing with half-bytes is hard, we
1063  //uncompress two 4x4 tiles at the same time. (a
1064  //4x4 tile compressed is 12 bits )
1065  // this little code was grabbed from openmap software.
1066 
1067  /* Get first 12-bit value as index into VQ table */
1068  // I think we need to swap
1069  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
1070 
1071  /* Get second 12-bit value as index into VQ table*/
1072  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
1073 
1074  for (ossim_uint32 t = 0; t < 4; ++t)
1075  {
1076  for (ossim_uint32 e = 0; e < 4; ++e)
1077  {
1078  ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
1079  ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
1080 
1081  ossim_uint32 pixindex = ((i+t)*256) + (j + e);
1082  const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
1083  const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
1084 
1085 
1086  tempRow[pixindex] = color1[0];
1087  tempRow[pixindex + 4] = color2[0];
1088  } //for e
1089  } //for t
1090  } /* for j */
1091  } //for i
1092  }
1093  else
1094  {
1095  memset(m_uncompressedBuffer, 0, 256*256);
1096  }
1097  ossim_int32 tCol = col*256;
1098  ossim_int32 tRow = row*256;
1099  ossimIrect subRectToFill(frameRect.ul().x + tCol,
1100  frameRect.ul().y + tRow,
1101  frameRect.ul().x + tCol + 255,
1102  frameRect.ul().y + tRow + 255);
1104  subRectToFill,
1105  OSSIM_BSQ);
1106  }
1107  }
1108  }
1109 }
const std::vector< ossimRpfCompressionOffsetTableData > & getTable() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
unsigned short ossim_uint16
const vector< ossimRpfColorGrayscaleTable > & getColorGrayscaleTable() const
Definition: ossimRpfFrame.h:80
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
bool fillSubFrameBuffer(ossim_uint8 *buffer, ossim_uint32 spectralGroup, ossim_uint32 row, ossim_uint32 col) const
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
unsigned int ossim_uint32
unsigned char * m_compressedBuffer
This is for storage of a single compressed buffer.
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
unsigned char * m_uncompressedBuffer
This is used as a buffer to uncompress the data to.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
const ossimRpfCompressionSection * getCompressionSection() const
Definition: ossimRpfFrame.h:76
unsigned char ossim_uint8
int ossim_int32

◆ fillTile()

void ossimRpfCacheTileSource::fillTile ( const ossimIrect tileRect,
const vector< ossimFrameEntryData > &  framesInvolved,
ossimImageData tile 
)
protected

This is a wrapper for the fill cib and fill cadrg.

It takes the frames involved that were found in the getIntersectingEntries and call the appropriate fill cib or fill cadrg on each frame entry data. It will loop through making sure that the frame file exists before calling the associated fill routines.

Parameters
tileRectRegion to fill.
framesInvolvedAll intersecting frames used to render the region.

Definition at line 798 of file ossimRpfCacheTileSource.cpp.

References fillSubTileCadrg(), fillSubTileCib(), m_productType, m_workFrame, ossimErrorCodes::OSSIM_OK, OSSIM_PRODUCT_TYPE_CIB, and ossimRpfFrame::parseFile().

Referenced by getTile().

802 {
803  ossim_uint32 idx = 0;
804  for(idx = 0;
805  idx < framesInvolved.size();
806  ++idx)
807  {
808 
809  if(m_workFrame->parseFile(framesInvolved[idx].theFrameEntry.getFullPath())
811  {
812  // we will fill a subtile. We pass in which frame it is and the position of the frame.
813  // the actual pixel will be 1536*row and 1536 *col.
815  {
817  tileRect,
818  framesInvolved[idx],
819  tile);
820  }
821  else
822  {
824  tileRect,
825  framesInvolved[idx],
826  tile);
827  }
828  }
829  }
830 }
void fillSubTileCib(const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
Will uncompress the CIB file using a VQ decompression algorithm.
static const ossimErrorCode OSSIM_OK
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
unsigned int ossim_uint32
ossimErrorCode parseFile(const ossimFilename &filename, bool minimalParse=false)
void fillSubTileCadrg(const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
Will uncompress the CADRG file using a VQ decompression algorithm.

◆ getEntryList()

void ossimRpfCacheTileSource::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 730 of file ossimRpfCacheTileSource.cpp.

731 {
732  entryList.push_back(0);
733 }

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimRpfCacheTileSource::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 545 of file ossimRpfCacheTileSource.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::CENTRAL_MERIDIAN_KW, ossimKeywordNames::DATUM_KW, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, ossimRefPtr< T >::get(), getNumberOfInputBands(), getNumberOfLines(), getNumberOfOutputBands(), getNumberOfSamples(), ossimImageHandler::initImageParameters(), 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, m_bBox_LL_Lat, m_bBox_LL_Lon, m_bBox_UR_Lat, m_bBox_UR_Lon, ossimKeywordNames::NUMBER_INPUT_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimKeywordNames::ORIGIN_LATITUDE_KW, ossimImageHandler::theGeometry, 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, ossimKeywordNames::UR_LON_KW, and ossimRefPtr< T >::valid().

546 {
547  if (theGeometry.valid()) return theGeometry;
548 
549  // datum
550  // WGS 84
551  ossimKeywordlist kwl;
552  const char* prefix = 0; // legacy
553  kwl.add(prefix,
555  "WGE",
556  true);
557 
562 
563  double latInterval = fabs(ul.latd() - lr.latd())/ getNumberOfLines();
564  double lonInterval = fabs(ul.lond() - ur.lond())/ getNumberOfSamples();
565 
566  kwl.add(prefix,
568  ul.latd(),//-(latInterval/2.0),
569  true);
570 
571  kwl.add(prefix,
573  ul.lond(),//+(lonInterval/2.0),
574  true);
575 
576  kwl.add(prefix,
578  ll.latd(),//+(latInterval/2.0),
579  true);
580 
581  kwl.add(prefix,
583  ll.lond(),//+(lonInterval/2.0),
584  true);
585 
586  kwl.add(prefix,
588  lr.latd(),//+(latInterval/2.0),
589  true);
590 
591  kwl.add(prefix,
593  lr.lond(),//-(lonInterval/2.0),
594  true);
595 
596  kwl.add(prefix,
598  ur.latd(),//-(latInterval/2.0),
599  true);
600 
601  kwl.add(prefix,
603  ur.lond(),//-(latInterval/2.0),
604  true);
605 
606  kwl.add(prefix,
609  true);
610 
611  kwl.add(prefix,
614  true);
615 
616  kwl.add(prefix,
619  true);
620 
621  kwl.add(prefix,
624  true);
625 
626 
627  //---
628  // Make a projection to get the easting / northing of the tie point and
629  // the scale in meters. This will only be used by the CIB.
630  //---
631  kwl.add(prefix,
633  "WGE",
634  true);
635 
636  ossimGpt origin((ul.latd()+lr.latd())*.5,
637  (ul.lond()+lr.lond())*.5,
638  0.0);
639 
640  double deltaLatPerPixel = latInterval;
641  double deltaLonPerPixel = lonInterval;
642 
643  ossimDpt tie;
644 
645  tie.lat = ul.latd() - deltaLatPerPixel/2.0;
646  tie.lon = ul.lond() + deltaLonPerPixel/2.0;
647 
648  kwl.add(prefix,
650  tie.toString(),
651  true);
652 
653  kwl.add(prefix,
655  deltaLatPerPixel,
656  true);
657 
658  kwl.add(prefix,
660  deltaLonPerPixel,
661  true);
662 
663  kwl.add(prefix,
665  origin.latd(),
666  true);
667 
668  kwl.add(prefix,
670  origin.lond(),
671  true);
672 
673  kwl.add(prefix,
675  ul.latd()-(deltaLatPerPixel/2.0),
676  true);
677 
678  kwl.add(prefix,
680  ul.lond()+(deltaLonPerPixel/2.0),
681  true);
682 
683  kwl.add(prefix,
685  "ossimEquDistCylProjection",
686  true);
687 
688  // Capture this for next time.
690  theGeometry->loadState(kwl, prefix);
691 
692  // Set image things the geometry object should know about.
694 
695  return theGeometry;
696 }
ossimRefPtr< ossimImageGeometry > theGeometry
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.
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
static const char * TYPE_KW
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual ossim_uint32 getNumberOfOutputBands() const
This method allows one to query the number of output bands.
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...
static const char * ORIGIN_LATITUDE_KW
ossimString toString(ossim_uint32 precision=15) const
Definition: ossimDpt.cpp:160
virtual ossim_uint32 getNumberOfInputBands() const
This method allows you to query the number of input bands.
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
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.

◆ getImageRectangle()

ossimIrect ossimRpfCacheTileSource::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 537 of file ossimRpfCacheTileSource.cpp.

References getNumberOfLines(), and getNumberOfSamples().

Referenced by getIntersectingEntries(), and getTile().

538 {
539  return ossimIrect(0, // upper left x
540  0, // upper left y
541  getNumberOfSamples(reduced_res_level) - 1, // lower right x
542  getNumberOfLines(reduced_res_level) - 1); // lower right y
543 }
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 ossimRpfCacheTileSource::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 1203 of file ossimRpfCacheTileSource.cpp.

1204 {
1205  return 256;
1206 }

◆ getImageTileWidth()

ossim_uint32 ossimRpfCacheTileSource::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 1198 of file ossimRpfCacheTileSource.cpp.

1199 {
1200  return 256;
1201 }

◆ getIntersectingEntries()

vector< ossimRpfCacheTileSource::ossimFrameEntryData > ossimRpfCacheTileSource::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 762 of file ossimRpfCacheTileSource.cpp.

References CIBCADRG_FRAME_HEIGHT, CIBCADRG_FRAME_WIDTH, ossimIrect::clipToRect(), ossimRpfFrameEntry::exists(), getImageRectangle(), ossimIrect::intersects(), isOpen(), ossimIrect::lr(), m_frameEntryArray, ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

763 {
764  vector<ossimFrameEntryData> result;
765 
766  // make sure we have the Toc entry to render
767  if(!isOpen()) return result;
768 
769  ossimIrect imageRect = getImageRectangle();
770  if(rect.intersects(imageRect))
771  {
772  ossimIrect clipRect = rect.clipToRect(imageRect);
773  ossimIrect frameRect(clipRect.ul().x/CIBCADRG_FRAME_WIDTH,
774  clipRect.ul().y/CIBCADRG_FRAME_HEIGHT,
775  clipRect.lr().x/CIBCADRG_FRAME_WIDTH,
776  clipRect.lr().y/CIBCADRG_FRAME_HEIGHT);
777 
778  for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
779  {
780  for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
781  {
782  ossimRpfFrameEntry tempEntry = m_frameEntryArray[row][col];
783  if(tempEntry.exists())
784  {
785  result.push_back(ossimFrameEntryData(row,
786  col,
789  tempEntry));
790  }
791  }
792  }
793  }
794 
795  return result;
796 }
const ossimIpt & ul() const
Definition: ossimIrect.h:274
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
std::vector< std::vector< ossimRpfFrameEntry > > m_frameEntryArray
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
bool isOpen() const
Determines if its open if there eists a table of contents object.
int ossim_int32

◆ getLongName()

ossimString ossimRpfCacheTileSource::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 117 of file ossimRpfCacheTileSource.cpp.

118 {
119  return ossimString("RpfCache reader");
120 }

◆ getNumberOfInputBands()

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

Definition at line 462 of file ossimRpfCacheTileSource.cpp.

References m_productType, OSSIM_PRODUCT_TYPE_CADRG, OSSIM_PRODUCT_TYPE_CIB, and OSSIM_PRODUCT_TYPE_UNKNOWN.

Referenced by getImageGeometry().

463 {
464  switch(m_productType)
465  {
467  {
468  return 0;
469  }
471  {
472  return 1;
473  }
475  {
476  return 3;
477  }
478  }
479 
480  return 0;
481 }
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.

◆ getNumberOfLines()

ossim_uint32 ossimRpfCacheTileSource::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 504 of file ossimRpfCacheTileSource.cpp.

References ossimImageHandler::getNumberOfLines(), m_numberOfLines, ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getImageGeometry(), and getImageRectangle().

505 {
506  if (reduced_res_level == 0)
507  {
508  return m_numberOfLines;
509  }
510  else if (theOverview.valid())
511  {
512  return theOverview->getNumberOfLines(reduced_res_level);
513  }
514 
515  return 0;
516 }
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 ossimRpfCacheTileSource::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.

Definition at line 483 of file ossimRpfCacheTileSource.cpp.

References m_productType, OSSIM_PRODUCT_TYPE_CADRG, OSSIM_PRODUCT_TYPE_CIB, and OSSIM_PRODUCT_TYPE_UNKNOWN.

Referenced by getImageGeometry(), and getTile().

484 {
485  switch(m_productType)
486  {
488  {
489  return 0;
490  }
492  {
493  return 1;
494  }
496  {
497  return 3;
498  }
499  }
500 
501  return 0;
502 }
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.

◆ getNumberOfSamples()

ossim_uint32 ossimRpfCacheTileSource::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 518 of file ossimRpfCacheTileSource.cpp.

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

Referenced by getImageGeometry(), and getImageRectangle().

519 {
520  if (reduced_res_level == 0)
521  {
522  return m_numberOfSamples;
523  }
524  else if (theOverview.valid())
525  {
526  return theOverview->getNumberOfSamples(reduced_res_level);
527  }
528 
529  return 0;
530 }
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.
ossim_uint32 m_numberOfSamples
This will be computed based on the frames organized within the directory.

◆ getOutputScalarType()

ossimScalarType ossimRpfCacheTileSource::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 698 of file ossimRpfCacheTileSource.cpp.

References OSSIM_UCHAR.

699 {
700  return OSSIM_UCHAR;
701 }
8 bit unsigned iteger

◆ getProperty()

ossimRefPtr< ossimProperty > ossimRpfCacheTileSource::getProperty ( const ossimString name) const
virtual

Gets a property for matching name.

Parameters
nameThe name of the property to get.
Returns
Returns property matching "name".

Reimplemented from ossimImageHandler.

Definition at line 1218 of file ossimRpfCacheTileSource.cpp.

References ossimImageHandler::getProperty(), m_productType, OSSIM_PRODUCT_TYPE_CADRG, and OSSIM_PRODUCT_TYPE_CIB.

1219 {
1220  if(name == "file_type")
1221  {
1223  {
1224  return new ossimStringProperty("file_type", "CIB");
1225  }
1227  {
1228  return new ossimStringProperty("file_type", "CADRG");
1229  }
1230  return 0;
1231  }
1232  return ossimImageHandler::getProperty(name);
1233 }
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const

◆ getShortName()

ossimString ossimRpfCacheTileSource::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 112 of file ossimRpfCacheTileSource.cpp.

113 {
114  return ossimString("RpfCache");
115 }

◆ getTile() [1/2]

ossimRefPtr< ossimImageData > ossimRpfCacheTileSource::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 379 of file ossimRpfCacheTileSource.cpp.

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

381 {
382  if (m_tile.valid())
383  {
384  // Image rectangle must be set prior to calling getTile.
385  m_tile->setImageRectangle(rect);
386 
387  if ( getTile( m_tile.get(), resLevel ) == false )
388  {
390  {
391  m_tile->makeBlank();
392  }
393  }
394  }
395 
396  return m_tile;
397 }
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
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.
virtual void makeBlank()
Initializes data to null pixel values.

◆ getTile() [2/2]

bool ossimRpfCacheTileSource::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 399 of file ossimRpfCacheTileSource.cpp.

References fillTile(), getImageRectangle(), ossimImageData::getImageRectangle(), getIntersectingEntries(), ossimImageData::getNumberOfBands(), getNumberOfOutputBands(), ossimImageHandler::getOverviewTile(), ossimIrect::intersects(), isOpen(), ossimSource::isSourceEnabled(), isValidRLevel(), m_productType, ossimImageData::makeBlank(), OSSIM_PRODUCT_TYPE_UNKNOWN, status, and ossimImageData::validate().

401 {
402  bool status = false;
403 
404  //---
405  // Not open, this tile source bypassed, or invalid res level,
406  // return a blank tile.
407  //---
408  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
409  result && (result->getNumberOfBands() == getNumberOfOutputBands()) &&
411  {
412  if ( resLevel > 0 )
413  {
414  //---
415  // Check for overview tile. Some overviews can contain r0 so always
416  // call even if resLevel is 0 (if overview is not virtual). Method
417  // returns true on success, false on error.
418  //---
419  status = getOverviewTile(resLevel, result);
420  }
421 
422  if (!status) // Did not get an overview tile.
423  {
424  status = true;
425 
426  ossimIrect rect = result->getImageRectangle();
427 
428  ossimIrect imageRect = getImageRectangle();
429 
430  if ( rect.intersects(imageRect) )
431  {
432  //---
433  // Start with a blank tile in case there is not total coverage
434  // for rect.
435  //---
436  result->makeBlank();
437 
438  vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
439  if(frames.size() > 0)
440  {
441  //---
442  // Now lets render each frame. Note we will have to find
443  // subframes
444  // that intersect the rectangle of interest for each frame.
445  //---
446  fillTile(rect, frames, result);
447 
448  // Revalidate tile status.
449  result->validate();
450  }
451  }
452  else
453  {
454  result->makeBlank();
455  }
456  }
457  }
458 
459  return status;
460 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossim_uint32 getNumberOfBands() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual ossim_uint32 getNumberOfOutputBands() const
This method allows one to query the number of output bands.
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 ossimDataObjectStatus validate() const
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
bool isValidRLevel(ossim_uint32 reduced_res_level) const
virtual ossimIrect getImageRectangle() const
return status
virtual void makeBlank()
Initializes data to null pixel values.
void fillTile(const ossimIrect &tileRect, const vector< ossimFrameEntryData > &framesInvolved, ossimImageData *tile)
This is a wrapper for the fill cib and fill cadrg.
bool isOpen() const
Determines if its open if there eists a table of contents object.

◆ getTileHeight()

ossim_uint32 ossimRpfCacheTileSource::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 708 of file ossimRpfCacheTileSource.cpp.

References m_tileSize, and ossimIpt::y.

709 {
710  return m_tileSize.y;
711 }
ossimIpt m_tileSize
The size of the output tile.
ossim_int32 y
Definition: ossimIpt.h:142

◆ getTileWidth()

ossim_uint32 ossimRpfCacheTileSource::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 703 of file ossimRpfCacheTileSource.cpp.

References m_tileSize, and ossimIpt::x.

704 {
705  return m_tileSize.x;
706 }
ossimIpt m_tileSize
The size of the output tile.
ossim_int32 x
Definition: ossimIpt.h:141

◆ isCadrg()

bool ossimRpfCacheTileSource::isCadrg ( ) const
Returns
true if CADRG

Definition at line 1213 of file ossimRpfCacheTileSource.cpp.

References m_productType, and OSSIM_PRODUCT_TYPE_CADRG.

1214 {
1216 }
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.

◆ isCib()

bool ossimRpfCacheTileSource::isCib ( ) const
Returns
true if CIB

Definition at line 1208 of file ossimRpfCacheTileSource.cpp.

References m_productType, and OSSIM_PRODUCT_TYPE_CIB.

1209 {
1211 }
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.

◆ isOpen()

bool ossimRpfCacheTileSource::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 128 of file ossimRpfCacheTileSource.cpp.

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

Referenced by getIntersectingEntries(), getTile(), and setEntryToRender().

129 {
130  //return (theTableOfContents!=0);
132 
133  if(ext == "rpf")
134  {
135  return true;
136  }
137  else
138  {
139  return false;
140  }
141 }
ossimFilename theImageFile
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimString ext() const

◆ isValidRLevel()

bool ossimRpfCacheTileSource::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 746 of file ossimRpfCacheTileSource.cpp.

References ossimImageHandler::isValidRLevel(), ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getTile().

747 {
748  if (reduced_res_level == 0)
749  {
750  return true;
751  }
752  else if (theOverview.valid())
753  {
754  return theOverview->isValidRLevel(reduced_res_level);
755  }
756  else
757  {
758  return false;
759  }
760 }
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 ossimRpfCacheTileSource::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 1157 of file ossimRpfCacheTileSource.cpp.

1159 {
1160  const char* MODULE = "ossimRpfCacheTileSource::loadState";
1161 
1162  if(traceDebug())
1163  {
1164  CLOG << "Entering..." << endl;
1165  }
1166  bool result = ossimImageHandler::loadState(kwl, prefix);
1167 
1168  if(!result)
1169  {
1170  if(traceDebug())
1171  {
1172  CLOG << "Leaving..." << endl;
1173  }
1174  return false;
1175  }
1176  const char* lookup = 0;
1177  lookup = kwl.find(ossimString(prefix), "entry");
1178  ossim_int32 entry = ossimString(lookup).toInt32();
1179 
1180  // if an entry is specified then
1181  // call the open with an entry number
1182  if(lookup)
1183  {
1184  if(traceDebug())
1185  {
1186  CLOG << "Leaving..." << endl;
1187  }
1189  setCurrentEntry(entry);
1190  return result;
1191  }
1192 
1194 
1195  return result;
1196 }
virtual bool open()=0
Pure virtual open.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
#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
int ossim_int32

◆ open()

bool ossimRpfCacheTileSource::open ( )
virtual

Pure virtual open.

Derived classes must implement.

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

Implements ossimImageHandler.

Definition at line 143 of file ossimRpfCacheTileSource.cpp.

144 {
145  if(traceDebug())
146  {
147  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfCacheTileSource::open(): Entered....." << std::endl;
148  }
149 
150  ossimFilename imageFile = theImageFile;
151  bool result = true;
152 
153  if(isOpen() == false)
154  {
155  close();
156  result = false;
157  }
158 
159  if(result)
160  {
161  if (m_fileNames.size() == 0 && m_frameEntryArray.size() == 0)
162  {
163  if (buildFrameEntryArray(imageFile) == false)
164  {
165  return false;
166  }
167  }
168 
169  setCurrentEntry(0);
170  //---
171  // Adjust image rect so not to go over the -180 to 180 and -90 to 90
172  // bounds.
173  //---
175 
176  // Set the base class image file name.
177  theImageFile = imageFile;
179  m_tile->initialize();
180  }
181 
182  if(traceDebug())
183  {
184  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfCacheTileSource::open(): Leaving at line" << __LINE__ << std::endl;
185  }
186 
187  return result;
188 }
std::vector< ossimString > m_fileNames
The size of the input frames.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
ossimFilename theImageFile
virtual void initialize()
Initialize the data buffer.
ossimRefPtr< ossimImageData > m_tile
This is the actual data returned from a getTile request.
static ossimImageDataFactory * instance()
bool buildFrameEntryArray(ossimFilename imageFile)
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
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 void close()
Closes this image handler and deletes any allocated data.
bool isOpen() const
Determines if its open if there eists a table of contents object.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ populateLut()

void ossimRpfCacheTileSource::populateLut ( )
protected

Definition at line 1235 of file ossimRpfCacheTileSource.cpp.

References ossimRpfFrame::getColorGrayscaleTable(), m_fileNames, m_productType, ossimErrorCodes::OSSIM_OK, OSSIM_PRODUCT_TYPE_CADRG, OSSIM_PRODUCT_TYPE_CIB, OSSIM_UINT8, ossimRpfFrame::parseFile(), and ossimImageHandler::theLut.

Referenced by setEntryToRender().

1236 {
1237  theLut = 0;
1238  if(m_fileNames.size() > 0)
1239  {
1240  // bool found = false;
1241  ossimRpfFrameEntry tempEntry;
1242  ossimRpfFrame aFrame;
1243  ossimFilename fileName = m_fileNames[0].split("|")[0];
1244  // if (fileName.exists())
1245  // {
1246  // found = true;
1247  // }
1248 
1249  if(aFrame.parseFile(fileName)
1251  {
1252  const vector<ossimRpfColorGrayscaleTable>& colorTable =
1253  aFrame.getColorGrayscaleTable();
1254 
1255  // ESH 03/2009 -- Partial fix for ticket #646.
1256  // Crash fix on reading RPFs: Make sure the colorTable vector
1257  // has entries before trying to make use of them.
1258  int numTables = (int)colorTable.size();
1259 
1260  ossim_uint32 numElements = (numTables > 0) ? colorTable[0].getNumberOfElements() : 0;
1261  if(numElements > 0)
1262  {
1265  {
1266  theLut = new ossimNBandLutDataObject(numElements,
1267  3,
1268  OSSIM_UINT8);
1269  }
1270  else
1271  {
1272  theLut = 0;
1273  return;
1274  }
1275  ossim_uint32 idx = 0;
1276 
1277  for(idx = 0; idx < numElements;++idx)
1278  {
1279  const ossim_uint8* startOfData = colorTable[0].getStartOfData(idx);
1280  switch(m_productType)
1281  {
1283  {
1284  (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1285  (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1286  (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1287  break;
1288  }
1290  {
1291  (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1292  (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[1]);
1293  (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[2]);
1294  break;
1295  }
1296  default:
1297  {
1298  break;
1299  }
1300  }
1301  }
1302  }
1303  }
1304  }
1305 }
std::vector< ossimString > m_fileNames
The size of the input frames.
static const ossimErrorCode OSSIM_OK
const vector< ossimRpfColorGrayscaleTable > & getColorGrayscaleTable() const
Definition: ossimRpfFrame.h:80
ossimRpfCacheProductType m_productType
Holds the enumeration specifying the product type.
unsigned int ossim_uint32
ossimErrorCode parseFile(const ossimFilename &filename, bool minimalParse=false)
class ossimNBandLutDataObject
ossimRefPtr< ossimNBandLutDataObject > theLut
8 bit unsigned integer
unsigned char ossim_uint8

◆ saveState()

bool ossimRpfCacheTileSource::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 1149 of file ossimRpfCacheTileSource.cpp.

References ossimImageHandler::saveState().

1151 {
1152  bool result = ossimImageHandler::saveState(kwl, prefix);
1153 
1154  return result;
1155 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setActualImageRect()

void ossimRpfCacheTileSource::setActualImageRect ( )
protected

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

Definition at line 532 of file ossimRpfCacheTileSource.cpp.

References m_actualImageRect, m_numberOfLines, and m_numberOfSamples.

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

◆ setCurrentEntry()

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

Reimplemented from ossimImageHandler.

Definition at line 713 of file ossimRpfCacheTileSource.cpp.

References ossimString::clear(), ossimImageHandler::completeOpen(), setEntryToRender(), ossimImageHandler::theGeometry, and ossimImageHandler::theOverviewFile.

714 {
715  // Clear the geometry.
716  theGeometry = 0;
717 
718  // Must clear or openOverview will use last entries.
720 
721  if(!setEntryToRender(entryIdx))
722  {
723  return false;
724  }
725  completeOpen();
726 
727  return true;
728 }
void clear()
Erases the entire container.
Definition: ossimString.h:432
ossimRefPtr< ossimImageGeometry > theGeometry
virtual bool setEntryToRender(ossim_uint32 index)
Sets the entry to render.
virtual void completeOpen()
Will complete the opening process.
ossimFilename theOverviewFile

◆ setEntryToRender()

bool ossimRpfCacheTileSource::setEntryToRender ( ossim_uint32  index)
protectedvirtual

Sets the entry to render.

Definition at line 735 of file ossimRpfCacheTileSource.cpp.

References isOpen(), and populateLut().

Referenced by setCurrentEntry().

736 {
737  if(isOpen())
738  {
739  populateLut();
740  return true;
741  }
742 
743  return false;
744 }
bool isOpen() const
Determines if its open if there eists a table of contents object.

Member Data Documentation

◆ CIBCADRG_FRAME_HEIGHT

const ossim_uint32 ossimRpfCacheTileSource::CIBCADRG_FRAME_HEIGHT = 1536
static

CONSTANT representing the height of a Frame.

This should be 1536.

Definition at line 292 of file ossimRpfCacheTileSource.h.

Referenced by fillSubTileCadrg(), fillSubTileCib(), and getIntersectingEntries().

◆ CIBCADRG_FRAME_WIDTH

const ossim_uint32 ossimRpfCacheTileSource::CIBCADRG_FRAME_WIDTH = 1536
static

CONSTANT representing the width of a Frame.

This should be 1536.

Definition at line 287 of file ossimRpfCacheTileSource.h.

Referenced by fillSubTileCadrg(), fillSubTileCib(), and getIntersectingEntries().

◆ m_actualImageRect

ossimIrect ossimRpfCacheTileSource::m_actualImageRect
protected

This holds the image bounds for the current entry.

Definition at line 436 of file ossimRpfCacheTileSource.h.

Referenced by setActualImageRect().

◆ m_bBox_LL_Lat

ossim_float64 ossimRpfCacheTileSource::m_bBox_LL_Lat
protected

Definition at line 488 of file ossimRpfCacheTileSource.h.

Referenced by getImageGeometry().

◆ m_bBox_LL_Lon

ossim_float64 ossimRpfCacheTileSource::m_bBox_LL_Lon
protected

Definition at line 487 of file ossimRpfCacheTileSource.h.

Referenced by getImageGeometry().

◆ m_bBox_UR_Lat

ossim_float64 ossimRpfCacheTileSource::m_bBox_UR_Lat
protected

Definition at line 490 of file ossimRpfCacheTileSource.h.

Referenced by getImageGeometry().

◆ m_bBox_UR_Lon

ossim_float64 ossimRpfCacheTileSource::m_bBox_UR_Lon
protected

Definition at line 489 of file ossimRpfCacheTileSource.h.

Referenced by getImageGeometry().

◆ m_compressedBuffer

unsigned char* ossimRpfCacheTileSource::m_compressedBuffer
protected

This is for storage of a single compressed buffer.

Definition at line 441 of file ossimRpfCacheTileSource.h.

Referenced by allocateForProduct(), fillSubTileCadrg(), fillSubTileCib(), and ~ossimRpfCacheTileSource().

◆ m_fileNames

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

The size of the input frames.

Definition at line 470 of file ossimRpfCacheTileSource.h.

Referenced by populateLut().

◆ m_frameEntryArray

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

Definition at line 494 of file ossimRpfCacheTileSource.h.

Referenced by getIntersectingEntries().

◆ m_numberOfLines

ossim_uint32 ossimRpfCacheTileSource::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 453 of file ossimRpfCacheTileSource.h.

Referenced by getNumberOfLines(), and setActualImageRect().

◆ m_numberOfSamples

ossim_uint32 ossimRpfCacheTileSource::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 460 of file ossimRpfCacheTileSource.h.

Referenced by getNumberOfSamples(), and setActualImageRect().

◆ m_numOfFramesHorizontal

ossim_uint32 ossimRpfCacheTileSource::m_numOfFramesHorizontal
protected

Definition at line 492 of file ossimRpfCacheTileSource.h.

◆ m_numOfFramesVertical

ossim_uint32 ossimRpfCacheTileSource::m_numOfFramesVertical
protected

Definition at line 491 of file ossimRpfCacheTileSource.h.

◆ m_productType

ossimRpfCacheProductType ossimRpfCacheTileSource::m_productType
protected

Holds the enumeration specifying the product type.

The product type can be a CIB or a CADRG product.

Definition at line 481 of file ossimRpfCacheTileSource.h.

Referenced by allocateForProduct(), fillTile(), getNumberOfInputBands(), getNumberOfOutputBands(), getProperty(), getTile(), isCadrg(), isCib(), and populateLut().

◆ m_tile

ossimRefPtr<ossimImageData> ossimRpfCacheTileSource::m_tile
protected

This is the actual data returned from a getTile request.

Definition at line 465 of file ossimRpfCacheTileSource.h.

Referenced by allocateForProduct(), and getTile().

◆ m_tileSize

ossimIpt ossimRpfCacheTileSource::m_tileSize
protected

The size of the output tile.

Definition at line 475 of file ossimRpfCacheTileSource.h.

Referenced by getTileHeight(), and getTileWidth().

◆ m_uncompressedBuffer

unsigned char* ossimRpfCacheTileSource::m_uncompressedBuffer
protected

This is used as a buffer to uncompress the data to.

Definition at line 446 of file ossimRpfCacheTileSource.h.

Referenced by allocateForProduct(), fillSubTileCadrg(), fillSubTileCib(), and ~ossimRpfCacheTileSource().

◆ m_workFrame

ossimRpfFrame* ossimRpfCacheTileSource::m_workFrame
mutableprotected

Definition at line 483 of file ossimRpfCacheTileSource.h.

Referenced by fillTile(), and ~ossimRpfCacheTileSource().


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