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

#include <ossimAdrgTileSource.h>

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

Public Types

enum  {
  ADRG_TILE_WIDTH = 128, ADRG_TILE_HEIGHT = 128, ADRG_TILE_SIZE = 16384, BAND_OFFSET = 16384,
  NUMBER_OF_BANDS = 3
}
 
enum  ADRG_COLOR { RED_BAND = 0, GREEN_BAND = 1, BLUE_BAND = 2 }
 
- 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

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

Protected Member Functions

virtual ~ossimAdrgTileSource ()
 
void adjustToStartOfTile (ossimIpt &pt) const
 Adjust point to even 128 boundary. More...
 
bool fillBuffer (const ossimIrect &tile_rect, const ossimIrect &clip_rect, ossimImageData *tile)
 Returns true on success, false on error. 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 void establishDecimationFactors ()
 Virtual method determines the decimation factors at each resolution level. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &inBandList, std::vector< ossim_uint32 > &outBandList)
 Convenience method to set output band list. More...
 
void getFilenameWithNoExtension (ossimFilename &f) const
 Get filename with no extension, using supplentary directory for dirname if set. More...
 
- Protected Member Functions inherited from ossimImageSource
 ossimImageSource (const ossimImageSource &rhs)
 
const ossimImageSourceoperator= (const ossimImageSource &)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 

Protected Attributes

ossimRefPtr< ossimImageDatam_Tile
 
ossim_uint8m_TileBuffer
 
std::ifstream m_FileStr
 
ossimAdrgHeaderm_AdrgHeader
 
- 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 25 of file ossimAdrgTileSource.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ADRG_TILE_WIDTH 
ADRG_TILE_HEIGHT 
ADRG_TILE_SIZE 
BAND_OFFSET 
NUMBER_OF_BANDS 

Definition at line 29 of file ossimAdrgTileSource.h.

◆ ADRG_COLOR

Enumerator
RED_BAND 
GREEN_BAND 
BLUE_BAND 

Definition at line 38 of file ossimAdrgTileSource.h.

Constructor & Destructor Documentation

◆ ossimAdrgTileSource()

ossimAdrgTileSource::ossimAdrgTileSource ( )

Definition at line 53 of file ossimAdrgTileSource.cpp.

54  :
56  m_Tile(0),
57  m_TileBuffer(0),
58  m_FileStr(),
59  m_AdrgHeader(0)
60 {
61  // Construction not complete. Users should call "open" method.
62 }
ossimRefPtr< ossimImageData > m_Tile
ossimImageHandler()
Constructor (default):
ossimAdrgHeader * m_AdrgHeader

◆ ~ossimAdrgTileSource()

ossimAdrgTileSource::~ossimAdrgTileSource ( )
protectedvirtual

Definition at line 64 of file ossimAdrgTileSource.cpp.

References close(), m_AdrgHeader, and m_TileBuffer.

65 {
66  if(m_AdrgHeader)
67  {
68  delete m_AdrgHeader;
69  m_AdrgHeader = 0;
70  }
71  if (m_TileBuffer)
72  {
73  delete [] m_TileBuffer;
74  m_TileBuffer = 0;
75  }
76 
77  close();
78 }
virtual void close()
Deletes the overview and clears the valid image vertices.
ossimAdrgHeader * m_AdrgHeader

Member Function Documentation

◆ adjustToStartOfTile()

void ossimAdrgTileSource::adjustToStartOfTile ( ossimIpt pt) const
protected

Adjust point to even 128 boundary.

Assumes 0,0 origin.

Definition at line 678 of file ossimAdrgTileSource.cpp.

References ossimIpt::x, and ossimIpt::y.

Referenced by fillBuffer().

679 {
680  pt.x &= 0xffffff80;
681  pt.y &= 0xffffff80;
682 }
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ close()

void ossimAdrgTileSource::close ( )
virtual

Deletes the overview and clears the valid image vertices.

Derived classes should implement.

Reimplemented from ossimImageHandler.

Definition at line 269 of file ossimAdrgTileSource.cpp.

References m_AdrgHeader, m_FileStr, and m_Tile.

Referenced by ~ossimAdrgTileSource().

270 {
271  if(m_AdrgHeader)
272  {
273  delete m_AdrgHeader;
274  m_AdrgHeader = 0;
275  }
276  if(m_FileStr.is_open())
277  {
278  m_FileStr.close();
279  }
280  m_Tile = 0;
281 }
ossimRefPtr< ossimImageData > m_Tile
ossimAdrgHeader * m_AdrgHeader

◆ fillBuffer()

bool ossimAdrgTileSource::fillBuffer ( const ossimIrect tile_rect,
const ossimIrect clip_rect,
ossimImageData tile 
)
protected

Returns true on success, false on error.

Definition at line 158 of file ossimAdrgTileSource.cpp.

References adjustToStartOfTile(), ADRG_TILE_HEIGHT, ADRG_TILE_SIZE, ADRG_TILE_WIDTH, ossimIrect::clipToRect(), ossimIrect::intersects(), ossimImageData::loadBand(), ossimIrect::lr(), m_AdrgHeader, m_FileStr, m_TileBuffer, ossimErrorCodes::OSSIM_ERROR, ossimErrorStatusInterface::theErrorStatus, ossimAdrgHeader::tim(), ossimIrect::ul(), ossimIpt::x, x, ossimIpt::y, and y.

Referenced by getTile().

161 {
162  //***
163  // Shift the upper left corner of the "clip_rect" to the an even chunk
164  // boundry.
165  //***
166  ossimIpt tileOrigin = clip_rect.ul();
167  adjustToStartOfTile(tileOrigin);
168 
169  //***
170  // Calculate the number of tiles needed in the line/sample directions.
171  //***
172  ossim_int32 size_in_x = clip_rect.lr().x - tileOrigin.x + 1;
173  ossim_int32 size_in_y = clip_rect.lr().y - tileOrigin.y + 1;
174 
175  ossim_int32 tiles_in_x_dir = size_in_x / ADRG_TILE_WIDTH +
176  (size_in_x % ADRG_TILE_WIDTH ? 1 : 0);
177  ossim_int32 tiles_in_y_dir = size_in_y / ADRG_TILE_HEIGHT +
178  (size_in_y % ADRG_TILE_HEIGHT ? 1 : 0);
179 
180 
181  ossimIpt ulTilePt = tileOrigin;
182 
183  // Chunk loop in line direction.
184  for (ossim_int32 y=0; y<tiles_in_y_dir; y++)
185  {
186  ulTilePt.x = tileOrigin.x;
187 
188  // Tile loop in sample direction.
189  for (ossim_int32 x=0; x<tiles_in_x_dir; x++)
190  {
191  ossimIrect adrg_tile_rect(ulTilePt.x,
192  ulTilePt.y,
193  ulTilePt.x + ADRG_TILE_WIDTH- 1,
194  ulTilePt.y + ADRG_TILE_HEIGHT - 1);
195 
196  if (adrg_tile_rect.intersects(clip_rect))
197  {
198  ossimIrect tile_clip_rect = clip_rect.clipToRect(adrg_tile_rect);
199 
200  //---
201  // Some point in the chip intersect the tile so grab the
202  // data.
203  //---
204  ossim_int32 row = (ossim_int32) ulTilePt.y / ADRG_TILE_HEIGHT;
205  ossim_int32 col = (ossim_int32) ulTilePt.x / ADRG_TILE_WIDTH;
206  ossim_int32 tileOffset = m_AdrgHeader->tim(row, col);
207 
208  if(tileOffset != 0)
209  {
210  // Get the data.
211  int seek_position = (tileOffset - 1) * 49152 + 2048;
212  int band;
213 
214  // seek to start of chip
215  m_FileStr.seekg(seek_position, ios::beg);
216  for (band=0; band<3; band++)
217  {
218  //***
219  // Read the chip from the ccf file into the chunk buffer.
220  // This will get all the bands. Bands are interleaved by
221  // chip.
222  //***
223  if (!m_FileStr.read((char*)m_TileBuffer,
225  {
227  return false;
228  }
229 
230  tile->loadBand(m_TileBuffer,
231  adrg_tile_rect,
232  tile_clip_rect,
233  band);
234 
235  } // End of band loop.
236 
237  } // End of if (tileOffset != 0)
238 
239  } // End of if (adrg_tile_rect.intersects(clip_rect))
240 
241  ulTilePt.x += ADRG_TILE_WIDTH;
242 
243  } // End of tile loop in the sample direction.
244 
245  ulTilePt.y += ADRG_TILE_HEIGHT;
246 
247  } // End of tile loop in the line direction.
248 
249  return true;
250 }
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
ossim_uint32 x
ossim_uint32 tim(ossim_uint32 row, ossim_uint32 col) const
ossim_uint32 y
const ossimIpt & ul() const
Definition: ossimIrect.h:274
static const ossimErrorCode OSSIM_ERROR
void adjustToStartOfTile(ossimIpt &pt) const
Adjust point to even 128 boundary.
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
ossimAdrgHeader * m_AdrgHeader
int ossim_int32

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimAdrgTileSource::getImageGeometry ( )
virtual

Returns the image geometry object associated with this tile source or NULL if non defined.

Reimplemented from ossimImageHandler.

Definition at line 398 of file ossimAdrgTileSource.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::CENTRAL_MERIDIAN_KW, ossimKeywordNames::DATUM_KW, ossimImageHandler::getExternalImageGeometry(), ossimImageHandler::getNumberOfDecimationLevels(), getNumberOfInputBands(), getNumberOfLines(), getNumberOfOutputBands(), getNumberOfSamples(), ossimUnitTypeLut::instance(), ossimAdrgHeader::lines(), m_AdrgHeader, ossimAdrgHeader::maxLatitude(), ossimAdrgHeader::maxLongitude(), ossimAdrgHeader::minLatitude(), ossimAdrgHeader::minLongitude(), ossimKeywordNames::NUMBER_INPUT_BANDS_KW, ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW, ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimKeywordNames::ORIGIN_LATITUDE_KW, OSSIM_DEGREES, ossimKeywordNames::PIXEL_SCALE_UNITS_KW, ossimKeywordNames::PIXEL_SCALE_XY_KW, ossimAdrgHeader::samples(), ossimAdrgHeader::startCol(), ossimAdrgHeader::startRow(), ossimImageHandler::theGeometry, ossimKeywordNames::TIE_POINT_LAT_KW, ossimKeywordNames::TIE_POINT_LON_KW, ossimKeywordNames::TIE_POINT_UNITS_KW, ossimKeywordNames::TIE_POINT_XY_KW, and ossimKeywordNames::TYPE_KW.

399 {
400  if ( !theGeometry )
401  {
402  // Check for external geom:
404 
405  if ( !theGeometry )
406  {
407  // origin of latitude
408  ossim_float64 originLatitude = (m_AdrgHeader->maxLatitude() +
409  m_AdrgHeader->minLatitude()) / 2.0;
410 
411  // central meridian.
412  ossim_float64 centralMeridian = (m_AdrgHeader->maxLongitude() +
413  m_AdrgHeader->minLongitude()) / 2.0;
414 
415  //---
416  // Compute the pixel size in latitude and longitude direction. This will
417  // be full image extents divided by full image lines and samples.
418  //---
419 
420  // Samples in full image (used to compute degPerPixelX).
421  ossim_float64 samples = m_AdrgHeader->samples();
422 
423  // Lines in full image (used to compute degPerPixelX).
424  ossim_float64 lines = m_AdrgHeader->lines();
425 
426  // Degrees in latitude direction of the full image.
427  ossim_float64 degrees_in_lat_dir = m_AdrgHeader->maxLatitude() -
429 
430  // Degrees in longitude direction of the full image.
431  ossim_float64 degrees_in_lon_dir = m_AdrgHeader->maxLongitude() -
433 
434  ossim_float64 degPerPixelY = degrees_in_lat_dir / lines;
435  ossim_float64 degPerPixelX = degrees_in_lon_dir / samples;
436 
437  //---
438  // The tie is determined with the following assumptions that need to be
439  // verified:
440  // 1) Rows and columns start at 1.
441  // 2) The min / max latitudes longitudes go to the edge of the pixel.
442  // 3) Latitude decreases by degPerPixelY with each line.
443  // 4) Longitude increases by degPerPixelX with each sample.
444  //---
445  ossim_float64 ul_lat = (m_AdrgHeader->maxLatitude() -
446  ( (m_AdrgHeader->startRow() - 1) *
447  degPerPixelY ) - ( degPerPixelY * 0.5 ) );
449  ( (m_AdrgHeader->startCol() -1) *
450  degPerPixelX ) + ( degPerPixelX * 0.5 ) );
451 
452  // projection type
453  ossimKeywordlist kwl;
454  const char* prefix = 0;
455  kwl.add(prefix,
457  "ossimEquDistCylProjection",
458  true);
459 
460  // datum.
461  kwl.add(prefix,
463  "WGE",
464  true);
465 
466  // origin latitude
467  kwl.add(prefix,
469  originLatitude,
470  true);
471 
472  // central meridin
473  kwl.add(prefix,
475  centralMeridian,
476  true);
477 
478  // Save the tie point.
479  kwl.add(prefix,
481  ossimDpt(ul_lon, ul_lat).toString().c_str(),
482  true);
483  kwl.add(prefix,
485  ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
486  true);
487 
488  // Save the scale.
489  kwl.add(prefix,
491  ul_lat,
492  true);
493 
494  kwl.add(prefix,
496  ul_lon,
497  true);
498 
499  // Save the scale.
500  kwl.add(prefix,
502  ossimDpt(degPerPixelX, degPerPixelY).toString().c_str(),
503  true);
504  kwl.add(prefix,
506  ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
507  true);
508 
509  // lines
510  kwl.add(prefix,
512  getNumberOfLines());
513 
514  // samples
515  kwl.add(prefix,
518 
519  // res sets
520  kwl.add(prefix,
523 
524  // bands
525  kwl.add(prefix,
528 
529  // bands
530  kwl.add(prefix,
533 
534  if (traceDebug())
535  {
537  << "\nminLon: " << m_AdrgHeader->minLon()
538  << "\nminLond: " << m_AdrgHeader->minLongitude()
539  << "\nminLat: " << m_AdrgHeader->minLat()
540  << "\nminLatd: " << m_AdrgHeader->minLatitude()
541  << "\nmaxLon: " << m_AdrgHeader->maxLon()
542  << "\nmaxLond: " << m_AdrgHeader->maxLongitude()
543  << "\nmaxLat: " << m_AdrgHeader->maxLat()
544  << "\nmaxLatd: " << m_AdrgHeader->maxLatitude()
545  << "\nstartRow: " << m_AdrgHeader->startRow()
546  << "\nstartCol: " << m_AdrgHeader->startCol()
547  << "\nstopRow: " << m_AdrgHeader->stopRow()
548  << "\nstopCol: " << m_AdrgHeader->stopCol()
549  << "\nfull image lines: " << lines
550  << "\nfull image samples: " << samples
551  << "\nkwl:\n" << kwl
552  << std::endl;
553  }
554 
557  theGeometry->setProjection(new_proj); // assumes management of projection instance
558 
559  } // matches (after getExternalImageGeometry()): if ( !theGeometry )
560 
561  // Set image things the geometry object should know about.
563 
564  } // matches: if ( !theGeometry )
565 
566  return theGeometry;
567 }
ossim_uint32 startRow() const
ossimRefPtr< ossimImageGeometry > theGeometry
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
static const char * DATUM_KW
static const char * CENTRAL_MERIDIAN_KW
Represents serializable keyword/value map.
ossimString minLon() const
static const char * NUMBER_LINES_KW
static const char * TIE_POINT_LON_KW
static const char * NUMBER_INPUT_BANDS_KW
ossimString minLat() const
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Returns the number of samples in the image.
double minLongitude() const
static const char * TYPE_KW
ossim_uint32 startCol() const
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
static const char * PIXEL_SCALE_XY_KW
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
static const char * TIE_POINT_XY_KW
ossim_uint32 lines() const
static const char * NUMBER_OUTPUT_BANDS_KW
ossimString maxLat() const
ossim_uint32 stopCol() const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
static ossimProjectionFactoryRegistry * instance()
static const char * ORIGIN_LATITUDE_KW
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.
double maxLatitude() const
static const char * TIE_POINT_LAT_KW
double minLatitude() const
static const char * NUMBER_REDUCED_RES_SETS_KW
ossim_uint32 stopRow() const
ossimString maxLon() const
ossim_uint32 samples() const
ossimAdrgHeader * m_AdrgHeader
static ossimUnitTypeLut * instance()
Returns the static instance of an ossimUnitTypeLut object.
static const char * NUMBER_SAMPLES_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double maxLongitude() const
static const char * PIXEL_SCALE_UNITS_KW
static const char * TIE_POINT_UNITS_KW
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Returns the number of lines in the image.

◆ getImageRectangle()

ossimIrect ossimAdrgTileSource::getImageRectangle ( ossim_uint32  reduced_res_level = 0) const
virtual

Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in.

Note that rrds 0 is the highest resolution rrds.

Reimplemented from ossimImageHandler.

Definition at line 261 of file ossimAdrgTileSource.cpp.

References getNumberOfLines(), and getNumberOfSamples().

Referenced by getTile().

262 {
263  return ossimIrect(0, // upper left x
264  0, // upper left y
265  getNumberOfSamples(reduced_res_level) - 1, // lower right x
266  getNumberOfLines(reduced_res_level) - 1); // lower right y
267 }
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Returns the number of samples in the image.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Returns the number of lines in the image.

◆ getImageTileHeight()

ossim_uint32 ossimAdrgTileSource::getImageTileHeight ( ) const
virtual

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

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

Implements ossimImageHandler.

Definition at line 632 of file ossimAdrgTileSource.cpp.

References ADRG_TILE_HEIGHT.

◆ getImageTileWidth()

ossim_uint32 ossimAdrgTileSource::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 627 of file ossimAdrgTileSource.cpp.

References ADRG_TILE_WIDTH.

◆ getLongName()

ossimString ossimAdrgTileSource::getLongName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 658 of file ossimAdrgTileSource.cpp.

659 {
660  return ossimString("adrg reader");
661 }

◆ getNumberOfInputBands()

ossim_uint32 ossimAdrgTileSource::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual requirement from ImageHandler class.

Implements ossimImageSource.

Definition at line 663 of file ossimAdrgTileSource.cpp.

References m_AdrgHeader, and ossimAdrgHeader::numberOfBands().

Referenced by getImageGeometry(), and getNumberOfOutputBands().

664 {
665  ossim_uint32 bands = 1;
666  if ( m_AdrgHeader )
667  {
668  bands = m_AdrgHeader->numberOfBands();
669  }
670  return bands;
671 }
ossim_uint32 numberOfBands() const
unsigned int ossim_uint32
ossimAdrgHeader * m_AdrgHeader

◆ getNumberOfLines()

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

Returns the number of lines in the image.

Satisfies pure virtual requirement from ImageHandler class.

Implements ossimImageHandler.

Definition at line 596 of file ossimAdrgTileSource.cpp.

References ossimImageHandler::getNumberOfLines(), m_AdrgHeader, ossimAdrgHeader::startRow(), ossimAdrgHeader::stopRow(), ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getImageGeometry(), and getImageRectangle().

597 {
598  if ( (reduced_res_level == 0) && m_AdrgHeader )
599  {
600  return (m_AdrgHeader->stopRow() - m_AdrgHeader->startRow()) + 1;
601  }
602  else if (theOverview.valid())
603  {
604  return theOverview->getNumberOfLines(reduced_res_level);
605  }
606 
607  return 0;
608 }
ossim_uint32 startRow() const
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 stopRow() const
ossimAdrgHeader * m_AdrgHeader

◆ getNumberOfOutputBands()

ossim_uint32 ossimAdrgTileSource::getNumberOfOutputBands ( ) const
virtual

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

Reimplemented from ossimImageSource.

Definition at line 252 of file ossimAdrgTileSource.cpp.

References getNumberOfInputBands().

Referenced by getImageGeometry(), and getTile().

253 {
254  return getNumberOfInputBands();
255 }
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.

◆ getNumberOfSamples()

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

Returns the number of samples in the image.

Satisfies pure virtual requirement from ImageHandler class.

Implements ossimImageHandler.

Definition at line 613 of file ossimAdrgTileSource.cpp.

References ossimImageHandler::getNumberOfSamples(), m_AdrgHeader, ossimAdrgHeader::startCol(), ossimAdrgHeader::stopCol(), ossimImageHandler::theOverview, and ossimRefPtr< T >::valid().

Referenced by getImageGeometry(), and getImageRectangle().

614 {
615  if ( (reduced_res_level == 0) && m_AdrgHeader )
616  {
617  return (m_AdrgHeader->stopCol() - m_AdrgHeader->startCol()) + 1;
618  }
619  else if (theOverview.valid())
620  {
621  return theOverview->getNumberOfSamples(reduced_res_level);
622  }
623 
624  return 0;
625 }
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 startCol() const
ossim_uint32 stopCol() const
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossimAdrgHeader * m_AdrgHeader

◆ getOutputScalarType()

ossimScalarType ossimAdrgTileSource::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 572 of file ossimAdrgTileSource.cpp.

References OSSIM_UCHAR.

573 {
574  return OSSIM_UCHAR;
575 }
8 bit unsigned iteger

◆ getProperty()

ossimRefPtr< ossimProperty > ossimAdrgTileSource::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 637 of file ossimAdrgTileSource.cpp.

References ossimImageHandler::getProperty().

638 {
639  if(name == "file_type")
640  {
641  return new ossimStringProperty(name, "ADRG");
642  }
643 
644  return ossimImageHandler::getProperty(name);
645 }
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const

◆ getPropertyNames()

void ossimAdrgTileSource::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual

Gets a list of property names available.

Parameters
propertyNamesThe list to push back names to.

Reimplemented from ossimImageHandler.

Definition at line 647 of file ossimAdrgTileSource.cpp.

References ossimImageHandler::getPropertyNames().

648 {
650  propertyNames.push_back("file_type");
651 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const

◆ getShortName()

ossimString ossimAdrgTileSource::getShortName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 653 of file ossimAdrgTileSource.cpp.

654 {
655  return ossimString("adrg");
656 }

◆ getTile() [1/2]

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

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

Satisfies pure virtual requirement from TileSource class.

Reimplemented from ossimImageSource.

Definition at line 80 of file ossimAdrgTileSource.cpp.

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

83 {
84  if (m_Tile.valid())
85  {
86  // Image rectangle must be set prior to calling getTile.
88 
89  if ( getTile( m_Tile.get(), resLevel ) == false )
90  {
92  {
93  m_Tile->makeBlank();
94  }
95  }
96  }
97 
98  return m_Tile;
99 }
ossimRefPtr< ossimImageData > m_Tile
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Returns a pointer to a tile given an origin representing the upper left corner of the tile to grab fr...
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual void makeBlank()
Initializes data to null pixel values.

◆ getTile() [2/2]

bool ossimAdrgTileSource::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 101 of file ossimAdrgTileSource.cpp.

References ossimIrect::clipToRect(), fillBuffer(), getImageRectangle(), ossimImageData::getImageRectangle(), ossimImageData::getNumberOfBands(), getNumberOfOutputBands(), ossimImageHandler::getOverviewTile(), ossimIrect::intersects(), isOpen(), ossimSource::isSourceEnabled(), ossimImageHandler::isValidRLevel(), ossimImageData::makeBlank(), ossimReferenced::ref(), status, ossimReferenced::unref(), and ossimImageData::validate().

103 {
104  bool status = false;
105 
106  //---
107  // Not open, this tile source bypassed, or invalid res level,
108  // return a blank tile.
109  //---
110  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
111  result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
112  {
113  result->ref(); // Increment ref count.
114 
115  //---
116  // Check for overview tile. Some overviews can contain r0 so always
117  // call even if resLevel is 0. Method returns true on success, false
118  // on error.
119  //---
120  status = getOverviewTile(resLevel, result);
121 
122  if (!status) // Did not get an overview tile.
123  {
124  status = true;
125 
126  ossimIrect tile_rect = result->getImageRectangle();
127 
128  ossimIrect image_rect = getImageRectangle(resLevel);
129 
130  result->makeBlank();
131 
132  //---
133  // See if any point of the requested tile is in the image.
134  //---
135  if ( tile_rect.intersects(image_rect) )
136  {
137  ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
138 
139  // Load the tile buffer with data from the adrg.
140  status = fillBuffer(tile_rect, clip_rect, result);
141 
142  if (status)
143  {
144  result->validate();
145  }
146  }
147  }
148 
149  result->unref(); // Decrement ref count.
150  }
151 
152  return status;
153 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossim_uint32 getNumberOfBands() const
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
void ref() const
increment the reference count by one, indicating that this object has another pointer which is refere...
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
virtual ossimDataObjectStatus validate() const
bool fillBuffer(const ossimIrect &tile_rect, const ossimIrect &clip_rect, ossimImageData *tile)
Returns true on success, false on error.
virtual ossimIrect getImageRectangle() const
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
void unref() const
decrement the reference count by one, indicating that a pointer to this object is referencing it...
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
return status
virtual void makeBlank()
Initializes data to null pixel values.
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in...

◆ getTileHeight()

ossim_uint32 ossimAdrgTileSource::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 588 of file ossimAdrgTileSource.cpp.

References ossimImageData::getHeight(), m_Tile, and ossimRefPtr< T >::valid().

589 {
590  return ( m_Tile.valid() ? m_Tile->getHeight() : 0 );
591 }
ossimRefPtr< ossimImageData > m_Tile
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getHeight() const

◆ getTileWidth()

ossim_uint32 ossimAdrgTileSource::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 580 of file ossimAdrgTileSource.cpp.

References ossimImageData::getWidth(), m_Tile, and ossimRefPtr< T >::valid().

581 {
582  return ( m_Tile.valid() ? m_Tile->getWidth() : 0 );
583 }
virtual ossim_uint32 getWidth() const
ossimRefPtr< ossimImageData > m_Tile
bool valid() const
Definition: ossimRefPtr.h:75

◆ isOpen()

bool ossimAdrgTileSource::isOpen ( ) const
virtual

Derived classes must implement this method to be concrete.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 673 of file ossimAdrgTileSource.cpp.

References m_AdrgHeader.

Referenced by getTile().

674 {
675  return (m_AdrgHeader!=0);
676 }
ossimAdrgHeader * m_AdrgHeader

◆ loadState()

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

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

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 381 of file ossimAdrgTileSource.cpp.

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

383 {
384  if (ossimImageHandler::loadState(kwl, prefix))
385  {
386  if (open())
387  {
388  return true;
389  }
390  }
391 
392  return false;
393 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.

◆ open()

bool ossimAdrgTileSource::open ( )
virtual
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 286 of file ossimAdrgTileSource.cpp.

Referenced by loadState().

287 {
288  static const char MODULE[] = "ossimAdrgTileSource::open";
289 
290  if(traceDebug())
291  {
293  << MODULE << "Entered..."<<std::endl;
294  }
295  if(isOpen())
296  {
297  close();
298  }
299  if(m_AdrgHeader)
300  {
301  delete m_AdrgHeader;
302  m_AdrgHeader = 0;
303  }
304  // Instantiate support data class to parse header file.
306 
307  // Check for errors.
309  {
310  if (traceDebug())
311  {
313  << MODULE << " Error in ossimAdrg header detected." << std::endl;
314  }
315 
316  close();
317  return false;
318  }
319 
321  ios::in | ios::binary);
322 
323  // Check the file pointer.
324  if(!m_FileStr)
325  {
327  if (traceDebug())
328  {
329  ossimNotify(ossimNotifyLevel_WARN) << MODULE << "\nCannot open: "
330  << m_AdrgHeader->imageFile().c_str() << std::endl;
331  }
332  close();
333 
334  return false;
335  }
336 
337  if(traceDebug())
338  {
340  << MODULE
341  << "File is opened -> "<< m_AdrgHeader->imageFile()<<std::endl;
342  }
343 
344  // allow the base handler to check for other overrides
345  completeOpen();
346  // Allocate memory.
348  m_Tile->initialize();
350 
351  if (traceDebug())
352  {
354  << "\nminLon: " << m_AdrgHeader->minLon()
355  << "\nminLond: " << m_AdrgHeader->minLongitude()
356  << "\nminLat: " << m_AdrgHeader->minLat()
357  << "\nminLatd: " << m_AdrgHeader->minLatitude()
358  << "\nmaxLon: " << m_AdrgHeader->maxLon()
359  << "\nmaxLond: " << m_AdrgHeader->maxLongitude()
360  << "\nmaxLat: " << m_AdrgHeader->maxLat()
361  << "\nmaxLatd: " << m_AdrgHeader->maxLatitude()
362  << std::endl;
363  }
364 
365  return true;
366 }
ossimRefPtr< ossimImageData > m_Tile
ossimFilename theImageFile
int errorStatus() const
ossimString minLon() const
static const ossimErrorCode OSSIM_ERROR
ossimString minLat() const
double minLongitude() const
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
ossimFilename imageFile() const
ossimString maxLat() const
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
virtual void completeOpen()
Will complete the opening process.
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
double maxLatitude() const
double minLatitude() const
ossimString maxLon() const
ossimAdrgHeader * m_AdrgHeader
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
double maxLongitude() const

◆ saveState()

bool ossimAdrgTileSource::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list.

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 371 of file ossimAdrgTileSource.cpp.

References ossimImageHandler::saveState().

373 {
374  // Currently nothing to do here.
375  return ossimImageHandler::saveState(kwl, prefix);
376 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

Member Data Documentation

◆ m_AdrgHeader

ossimAdrgHeader* ossimAdrgTileSource::m_AdrgHeader
protected

◆ m_FileStr

std::ifstream ossimAdrgTileSource::m_FileStr
protected

Definition at line 190 of file ossimAdrgTileSource.h.

Referenced by close(), and fillBuffer().

◆ m_Tile

ossimRefPtr<ossimImageData> ossimAdrgTileSource::m_Tile
protected

Definition at line 188 of file ossimAdrgTileSource.h.

Referenced by close(), getTile(), getTileHeight(), and getTileWidth().

◆ m_TileBuffer

ossim_uint8* ossimAdrgTileSource::m_TileBuffer
protected

Definition at line 189 of file ossimAdrgTileSource.h.

Referenced by fillBuffer(), and ~ossimAdrgTileSource().


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