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

#include <ossimMrSidReader.h>

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

Public Member Functions

 ossimMrSidReader ()
 default construtor More...
 
virtual ~ossimMrSidReader ()
 virtural destructor More...
 
virtual ossimString getShortName () const
 Returns short name. More...
 
virtual ossimString getLongName () const
 Returns long name. More...
 
virtual ossimString getClassName () const
 Returns class name. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 Method to grab a tile(rectangle) from image. 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 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 ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual void getDecimationFactor (ossim_uint32 resLevel, ossimDpt &result) const
 Gets the decimation factor for a resLevel. More...
 
virtual void getDecimationFactors (vector< ossimDpt > &decimations) const
 Get array of decimations for all levels. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Returns the number of decimation levels. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 resLevel=0) const
 Gets number of lines for res level. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel=0) const
 Gets the number of samples for res level. More...
 
virtual bool open ()
 Open method. More...
 
virtual bool isOpen () const
 Method to test for open file stream. More...
 
virtual void closeEntry ()
 Method to close current entry. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. 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...
 
- 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 void close ()
 Deletes the overview and clears the valid image vertices. More...
 
virtual bool buildHistogram (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histogram for image file. More...
 
virtual bool buildAllHistograms (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histograms for all image entries. More...
 
virtual bool buildOverview (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for theImageFile. More...
 
virtual bool buildAllOverviews (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for all image entries. More...
 
virtual bool buildOverview (const ossimFilename &filename, ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build an over file for filename. More...
 
ossimRefPtr< ossimMultiResLevelHistogramgetImageHistogram () const
 Fetches the current entry image's histogram. More...
 
virtual void setImageGeometry (ossimImageGeometry *geom)
 Sets the image geometry object. More...
 
virtual void saveImageGeometry () const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual void saveImageGeometry (const ossimFilename &geometry_file) const
 Saves the image geometry to a file that will be made based on the image file name. More...
 
virtual ossimIrect getImageRectangle (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual ossimIrect getBoundingRect (ossim_uint32 resLevel=0) const
 Returns zero-based bounding rectangle of the image. More...
 
virtual 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 saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. 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)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
ossimFilename getFilenameWithThisExtension (const ossimString &ext, bool set_e0_prefix=false) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
void getFilenameWithThisExt (const ossimString &ext, ossimFilename &f) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
ossim_uint32 getStartingResLevel () const
 
void setStartingResLevel (ossim_uint32 level)
 
bool getOpenOverviewFlag () const
 
void setOpenOverviewFlag (bool flag)
 Sets theOpenOverviewFlag. More...
 
virtual void setSupplementaryDirectory (const ossimFilename &dir)
 Sets the supplementary directory. More...
 
virtual const ossimFilenamegetSupplementaryDirectory () const
 Returns the supplementary directory. More...
 
const ossimStringgetImageID () const
 Fetches the image ID. More...
 
void setImageID (const ossimString &id)
 Sets the image ID in case it is externally generated. More...
 
ossimPixelType getPixelType () const
 Returns the raster pixel alignment type. More...
 
virtual bool getRgbBandList (std::vector< ossim_uint32 > &bandList) const
 Convenience method to get the zero based rgb output band list. More...
 
template<class T >
std::shared_ptr< T > getStateAs ()
 
template<class T >
std::shared_ptr< const T > getStateAs () const
 
std::shared_ptr< ossim::ImageHandlerState > getState ()
 
std::shared_ptr< const ossim::ImageHandlerState > getState () const
 
void setState (std::shared_ptr< ossim::ImageHandlerState > state)
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the default processing tile width. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the default processing tile height. 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 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 ossimRefPtr< ossimImageGeometrygetExternalImageGeometry () const
 Gets the image geometry from external ".geom" or ".aux.xml" file. More...
 
virtual ossimRefPtr< ossimImageGeometrygetInternalImageGeometry () const
 Method to get geometry from internal mrsid tags. More...
 
- Protected Member Functions inherited from ossimImageHandler
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)
 

Private Member Functions

bool computeDecimationFactors (std::vector< ossimDpt > &decimations) const
 
bool getImageDimensions (std::vector< ossimIrect > &tileDims) const
 
ossimProjectiongetGeoProjection ()
 
void getDataType ()
 
void computeMinMax ()
 
bool getMetadataElement (LTIMetadataDatabase metaDb, const char *tagName, void *pValue, int iLength=0)
 

Private Attributes

MrSIDImageReader * theReader
 
LTINavigator * theImageNavigator
 
ossim_uint32 theMinDwtLevels
 
ossimIrect theImageRect
 
std::vector< ossimIrecttheMrSidDims
 Has sub image offset. More...
 
ossim_uint32 theNumberOfBands
 
ossimScalarType theScalarType
 
ossimRefPtr< ossimImageDatatheTile
 

Additional Inherited Members

- Public Types inherited from ossimImageHandler
enum  ossimImageHandlerOverviewCompressionType {
  OSSIM_OVERVIEW_COMPRESSION_NONE = 0, OSSIM_OVERVIEW_COMPRESSION_JPEG, OSSIM_OVERVIEW_COMPRESSION_LZW, OSSIM_OVERVIEW_COMPRESSION_DEFLATE,
  OSSIM_OVERVIEW_COMPRESSION_PACKBITS
}
 
- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 
- 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 38 of file ossimMrSidReader.h.

Constructor & Destructor Documentation

◆ ossimMrSidReader()

ossimMrSidReader::ossimMrSidReader ( )

default construtor

◆ ~ossimMrSidReader()

ossimMrSidReader::~ossimMrSidReader ( )
virtual

virtural destructor

Definition at line 85 of file ossimMrSidReader.cpp.

References closeEntry(), theImageNavigator, and theReader.

86 {
87  closeEntry();
88 
89  // Note: Not a ref ptr. This is a MrSIDImageReader*.
90  if ( theReader )
91  {
92  theReader->release();
93  theReader = 0;
94  }
95  if (theImageNavigator != 0)
96  {
97  delete theImageNavigator;
99  }
100 }
virtual void closeEntry()
Method to close current entry.
LTINavigator * theImageNavigator
MrSIDImageReader * theReader

Member Function Documentation

◆ closeEntry()

void ossimMrSidReader::closeEntry ( )
virtual

Method to close current entry.

Note
There is a bool kdu_compressed_source::close() and a void ossimImageHandler::close(); hence, a new close to avoid conflicting return types.

Definition at line 319 of file ossimMrSidReader.cpp.

References ossimImageHandler::close(), and theTile.

Referenced by ~ossimMrSidReader().

320 {
321  theTile = 0;
322 
324 }
ossimRefPtr< ossimImageData > theTile
virtual void close()
Deletes the overview and clears the valid image vertices.

◆ computeDecimationFactors()

bool ossimMrSidReader::computeDecimationFactors ( std::vector< ossimDpt > &  decimations) const
private

Definition at line 522 of file ossimMrSidReader.cpp.

References getNumberOfDecimationLevels(), getNumberOfLines(), getNumberOfSamples(), ossimDpt::x, and ossimDpt::y.

Referenced by getDecimationFactors().

524 {
525  bool result = true;
526 
527  decimations.clear();
528 
529  const ossim_uint32 LEVELS = getNumberOfDecimationLevels();
530 
531  for (ossim_uint32 level = 0; level < LEVELS; ++level)
532  {
533  ossimDpt pt;
534 
535  if (level == 0)
536  {
537  // Assuming r0 is full res for now.
538  pt.x = 1.0;
539  pt.y = 1.0;
540  }
541  else
542  {
543  // Get the sample decimation.
545  ossim_float64 rL = getNumberOfSamples(level);
546  if ( (r0 > 0.0) && (rL > 0.0) )
547  {
548  pt.x = rL / r0;
549  }
550  else
551  {
552  result = false;
553  break;
554  }
555 
556  // Get the line decimation.
557  r0 = getNumberOfLines(0);
558  rL = getNumberOfLines(level);
559  if ( (r0 > 0.0) && (rL > 0.0) )
560  {
561  pt.y = rL / r0;
562  }
563  else
564  {
565  result = false;
566  break;
567  }
568  }
569 
570  decimations.push_back(pt);
571  }
572 
573  if (traceDebug())
574  {
576  << "ossimMrSidReader::computeDecimationFactors DEBUG\n";
577  for (ossim_uint32 i = 0; i < decimations.size(); ++i)
578  {
580  << "decimation[" << i << "]: " << decimations[i]
581  << std::endl;
582  }
583  }
584 
585  return result;
586 }
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const
Gets number of lines for res level.
double y
Definition: ossimDpt.h:165
double ossim_float64
unsigned int ossim_uint32
virtual ossim_uint32 getNumberOfDecimationLevels() const
Returns the number of decimation levels.
double x
Definition: ossimDpt.h:164
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const
Gets the number of samples for res level.

◆ computeMinMax()

void ossimMrSidReader::computeMinMax ( )
private

Definition at line 999 of file ossimMrSidReader.cpp.

1000 {
1001 }

◆ getClassName()

ossimString ossimMrSidReader::getClassName ( ) const
virtual

Returns class name.

Returns
"ossimMrSidReader"

Reimplemented from ossimObject.

Definition at line 112 of file ossimMrSidReader.cpp.

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

◆ getDataType()

void ossimMrSidReader::getDataType ( )
private

Definition at line 633 of file ossimMrSidReader.cpp.

References OSSIM_FLOAT32, OSSIM_FLOAT64, OSSIM_SCALAR_UNKNOWN, OSSIM_SINT16, OSSIM_SINT32, OSSIM_SINT8, OSSIM_UINT16, OSSIM_UINT32, OSSIM_UINT8, theReader, and theScalarType.

634 {
635  if (theReader != 0)
636  {
637  LTIDataType pixelType = theReader->getPixelProps().getDataType();
638 
639  LTIPixel pixel = theReader->getPixelProps();
640 
641  switch (pixelType)
642  {
643  case LTI_DATATYPE_UINT8:
644  {
646  break;
647  }
648  case LTI_DATATYPE_SINT8:
649  {
651  break;
652  }
653  case LTI_DATATYPE_UINT16:
654  {
656  break;
657  }
658  case LTI_DATATYPE_SINT16:
659  {
661  break;
662  }
663  case LTI_DATATYPE_UINT32:
664  {
666  break;
667  }
668  case LTI_DATATYPE_SINT32:
669  {
671  break;
672  }
673  case LTI_DATATYPE_FLOAT32:
674  {
676  break;
677  }
678  case LTI_DATATYPE_FLOAT64:
679  {
681  break;
682  }
683  default:
684  {
686  break;
687  }
688  }
689  }
690 }
8 bit signed integer
64 bit floating point
16 bit unsigned integer
16 bit signed integer
32 bit floating point
32 bit unsigned integer
32 bit signed integer
ossimScalarType theScalarType
8 bit unsigned integer
MrSIDImageReader * theReader

◆ getDecimationFactor()

void ossimMrSidReader::getDecimationFactor ( ossim_uint32  resLevel,
ossimDpt result 
) const
virtual

Gets the decimation factor for a resLevel.

Parameters
resLevelReduced resolution set for requested decimation.
resultossimDpt to initialize with requested decimation.

Reimplemented from ossimImageHandler.

Definition at line 117 of file ossimMrSidReader.cpp.

References ossimImageGeometry::decimationFactor(), ossimDpt::makeNan(), ossimImageHandler::theGeometry, and ossimRefPtr< T >::valid().

119 {
120  if (theGeometry.valid())
121  {
122  theGeometry->decimationFactor(resLevel, result);
123  }
124  else
125  {
126  result.makeNan();
127  }
128 }
ossimRefPtr< ossimImageGeometry > theGeometry
bool valid() const
Definition: ossimRefPtr.h:75
void makeNan()
Definition: ossimDpt.h:65
ossimDpt decimationFactor(ossim_uint32 r_index) const
Returns the decimation factor from R0 for the resolution level specified.

◆ getDecimationFactors()

void ossimMrSidReader::getDecimationFactors ( vector< ossimDpt > &  decimations) const
virtual

Get array of decimations for all levels.

Parameters
decimationsVector to initialize with decimations.

Reimplemented from ossimImageHandler.

Definition at line 130 of file ossimMrSidReader.cpp.

References computeDecimationFactors(), ossimImageGeometry::decimationFactors(), ossimImageGeometry::getNumberOfDecimations(), ossimImageGeometry::setDiscreteDecimation(), ossimImageHandler::theGeometry, and ossimRefPtr< T >::valid().

132 {
133  if (theGeometry.valid())
134  {
136  {
137  theGeometry->decimationFactors(decimations);
138  }
139  else
140  {
141  // First time called...
142  if ( computeDecimationFactors(decimations) )
143  {
144  theGeometry->setDiscreteDecimation(decimations);
145  }
146  else
147  {
148  decimations.clear();
149  }
150  }
151  }
152  else
153  {
154  if ( !computeDecimationFactors(decimations) )
155  {
156  decimations.clear();
157  }
158  }
159 }
ossimRefPtr< ossimImageGeometry > theGeometry
bool valid() const
Definition: ossimRefPtr.h:75
bool computeDecimationFactors(std::vector< ossimDpt > &decimations) const
void decimationFactors(std::vector< ossimDpt > &decimations) const
Gets array of all decimation levels.
void setDiscreteDecimation(const std::vector< ossimDpt > &decimation_list)
Sets the decimation scheme to a discrete list of decimation factors.
ossim_uint32 getNumberOfDecimations() const

◆ getExternalImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimMrSidReader::getExternalImageGeometry ( ) const
protectedvirtual

Gets the image geometry from external ".geom" or ".aux.xml" file.

Returns
The image geometry object associated with this mrsid image.

Reimplemented from ossimImageHandler.

Definition at line 480 of file ossimMrSidReader.cpp.

References ossimFilename::exists(), ossimRefPtr< T >::get(), ossimImageHandler::getExternalImageGeometry(), ossimAuxXmlSupportData::getProjection(), ossimImageGeometry::setProjection(), ossimImageHandler::theImageFile, and ossimRefPtr< T >::valid().

Referenced by getImageGeometry().

481 {
482  // Check for external .geom file:
484  if ( geom.valid() == false )
485  {
486  // Check for .aux.xml file:
487  ossimFilename auxXmlFile = theImageFile;
488  auxXmlFile += ".aux.xml";
489  if ( auxXmlFile.exists() )
490  {
492  ossimRefPtr<ossimProjection> proj = sd.getProjection( auxXmlFile );
493  if ( proj.valid() )
494  {
495  geom = new ossimImageGeometry();
496  geom->setProjection( proj.get() );
497  }
498  }
499  }
500  return geom;
501 }
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
ossimFilename theImageFile
bool valid() const
Definition: ossimRefPtr.h:75
bool exists() const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
Utility/support data class to extract the projection from a dot aux dot xml file commonly found with ...
ossimRefPtr< ossimProjection > getProjection(const ossimFilename &file) const
Method to get a projection if possible.

◆ getGeoProjection()

ossimProjection * ossimMrSidReader::getGeoProjection ( )
private

Definition at line 692 of file ossimMrSidReader.cpp.

References ossimKeywordlist::add(), ossimString::contains(), ossimProjectionFactoryRegistry::createProjection(), ossimKeywordNames::DATUM_KW, ossimString::downcase(), ossimString::empty(), ossimFilename::exists(), ossimKeywordlist::findKey(), ossimAuxFileHandler::getDatumName(), ossimWkt::getKwl(), getMetadataElement(), getNumberOfLines(), getNumberOfSamples(), ossimAuxFileHandler::getProjectionName(), ossimAuxFileHandler::getUnitType(), ossimProjectionFactoryRegistry::instance(), ossimKeywordNames::NUMBER_LINES_KW, ossimKeywordNames::NUMBER_SAMPLES_KW, ossimAuxFileHandler::open(), ossimNotify(), ossimNotifyLevel_WARN, ossimWkt::parse(), ossimKeywordNames::PCS_CODE_KW, ossimKeywordNames::PIXEL_SCALE_UNITS_KW, ossimKeywordNames::PIXEL_SCALE_XY_KW, ossimKeywordNames::PROJECTION_KW, ossimFilename::setExtension(), ossimString::size(), ossimImageHandler::theImageFile, theReader, ossimKeywordNames::TIE_POINT_UNITS_KW, ossimKeywordNames::TIE_POINT_XY_KW, ossimDpt::toString(), and ossimKeywordNames::TYPE_KW.

693 {
694  if (theReader == 0)
695  return 0;
696 
697  // A local KWL will be filled as items are read from the support data. At the end,
698  // the projection factory will be provided with the populated KWL to instantiate proper
699  // map projection. No prefix needed.
700  ossimKeywordlist kwl;
701 
702  // Add the lines and samples.
705 
706  ossimString proj_type;
707  ossimString datum_type;
708  ossimString scale_units = "unknown";
709  ossimString tie_pt_units = "unknown";
710 
711  ossim_uint32 code = 0;
712  ossim_uint32 gcsCode = 0;
713  ossim_uint32 pcsCode = 0;
714 
715  const LTIGeoCoord& geo = theReader->getGeoCoord();
716  LTIMetadataDatabase metaDb = theReader->getMetadata();
717 
718 #if 0 /* Please keep for debug. (drb) */
719  for (ossim_uint32 i = 0; i < metaDb.getIndexCount(); ++i )
720  {
721  const LTIMetadataRecord* rec = 0;
722  metaDb.getDataByIndex(i, rec);
723  cout << "rec.getTagName(): " << rec->getTagName() << endl;
724  }
725  const char* projStr = geo.getWKT();
726  if ( projStr )
727  {
728  std::string wktStr = projStr;
729 
730  cout << "wktStr: " << wktStr << endl;
731  ossimWkt wkt;
732  if ( wkt.open( wktStr ) )
733  {
734  cout << "kwl:\n" << wkt.getKwl() << endl;
735  }
736  }
737 #endif
738 
739  // Can only handle non-rotated images since only projection object returned (no 2d transform):
740  if( (geo.getXRot() != 0.0) || (geo.getYRot() != 0.0))
741  return 0;
742 
743  bool gcsFound = getMetadataElement(
744  metaDb, "GEOTIFF_NUM::2048::GeographicTypeGeoKey", &gcsCode);
745  bool pcsFound = getMetadataElement(
746  metaDb, "GEOTIFF_NUM::3072::ProjectedCSTypeGeoKey", &pcsCode);
747 
748  if (gcsFound && !pcsFound)
749  {
750  code = gcsCode;
751  kwl.add(ossimKeywordNames::TYPE_KW, "ossimEquDistCylProjection");
752  proj_type = "ossimEquDistCylProjection";
754  tie_pt_units = "degrees";
755 
756  // Assign units if set in Metadata
757  char unitStr[200];
758  if (getMetadataElement(metaDb, "GEOTIFF_CHAR::GeogAngularUnitsGeoKey",
759  &unitStr, sizeof(unitStr)) == true)
760  {
761  ossimString unitTag(unitStr);
762  if ( unitTag.contains("Angular_Degree") ) // decimal degrees
763  scale_units = "degrees";
764  else if ( unitTag.contains("Angular_Minute") ) // decimal minutes
765  scale_units = "minutes";
766  else if ( unitTag.contains("Angular_Second") ) // decimal seconds
767  scale_units = "seconds";
768  }
769  }
770  else
771  {
772  if (!pcsFound)
773  {
774  pcsFound = getMetadataElement(metaDb, "GEOTIFF_NUM::3074::ProjectionGeoKey", &code);
775  }
776  else
777  {
778  code = pcsCode;
779  }
780 
781  if (pcsFound)
782  {
784 
785  ossimString unitTag;
786 
787  char unitStr[200];
788  if (getMetadataElement(metaDb, "GEOTIFF_CHAR::ProjLinearUnitsGeoKey", &unitStr,
789  sizeof(unitStr)) == true )
790  {
791  unitTag = unitStr;
792  }
793  else
794  {
795  // Have data with no ProjLinearUnitsGeoKey so try WKT string.
796  const char* wktProjStr = geo.getWKT();
797  if ( wktProjStr )
798  {
799  std::string wktStr = wktProjStr;
800  ossimWkt wkt;
801  if ( wkt.parse( wktStr ) )
802  {
803  unitTag = wkt.getKwl().findKey( std::string("PROJCS.UNIT.name") );
804  }
805  }
806  }
807 
808  if ( unitTag.size() )
809  {
810  unitTag.downcase();
811 
812  if ( unitTag.contains("meter") || unitTag.contains("metre") )
813  {
814  scale_units = "meters";
815  }
816  else if ( unitTag.contains("linear_foot_us_survey") )
817  {
818  scale_units = "us_survey_feet";
819  }
820  else if ( unitTag.contains("linear_foot") )
821  {
822  scale_units = "feet";
823  }
824  tie_pt_units = scale_units;
825  }
826 
827  }
828  else
829  {
830  // Try with WKT:
831  const char* projStr = geo.getWKT();
832  kwl.add(ossimKeywordNames::TYPE_KW, projStr);
833  }
834  }
835 
836  char rasterTypeStr[200];
837  strcpy( rasterTypeStr, "unnamed" );
838  double topLeftX = geo.getX(); // AMBIGUOUS! OLK 5/10
839  double topLeftY = geo.getY(); // AMBIGUOUS! OLK 5/10
840  if (getMetadataElement(metaDb, "GEOTIFF_CHAR::GTRasterTypeGeoKey", &rasterTypeStr, sizeof(rasterTypeStr)) == true)
841  {
842  ossimString rasterTypeTag(rasterTypeStr);
843 
844  // If the raster type is pixel_is_area, shift the tie point by
845  // half a pixel to locate it at the pixel center.
846  if ( rasterTypeTag.contains("RasterPixelIsPoint") )
847  {
848  topLeftX -= geo.getXRes() / 2.0; // AMBIGUOUS -- DOESN'T MATCH COMMENT! OLK 5/10
849  topLeftY += geo.getYRes() / 2.0; // AMBIGUOUS! OLK 5/10
850  }
851  }
852  ossimDpt gsd(fabs(geo.getXRes()), fabs(geo.getYRes()));
853  ossimDpt tie(topLeftX, topLeftY);
854 
855  // CANNOT HANDLE 2D TRANSFORMS -- ONLY REAL PROJECTIONS. (OLK 5/10)
856  //std::stringstream mString;
858  //mString << ossimString::toString(geo.getXRes(), 20)
859  // << " " << ossimString::toString(geo.getXRot(), 20)
860  // << " " << 0 << " "
861  // << ossimString::toString(geo.getX(), 20)
862  // << " " << ossimString::toString(geo.getYRot(), 20)
863  // << " " << ossimString::toString(geo.getYRes(), 20)
864  // << " " << 0 << " "
865  // << ossimString::toString(geo.getY(), 20)
866  // << " " << 0 << " " << 0 << " " << 1 << " " << 0
867  // << " " << 0 << " " << 0 << " " << 0 << " " << 1;
868  //kwl.add(ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW, mString.str().c_str());
869 
870  // if meta data does not have the code info, try to read from .aux file
871  if (code == 0)
872  {
873  ossimFilename auxFile = theImageFile;
874  auxFile.setExtension("aux");
875  ossimAuxFileHandler auxHandler;
876  if (auxFile.exists() && auxHandler.open(auxFile))
877  {
878  ossimString proj_name = auxHandler.getProjectionName();
879  ossimString datum_name = auxHandler.getDatumName();
880  ossimString unitType = auxHandler.getUnitType();
881 
882  // HACK: Geographic projection is specified in non-WKT format. Intercepting here. OLK 5/10
883  // TODO: Need projection factory that can handle miscellaneous non-WKT specs as they are
884  // encountered.
885  if (proj_name.contains("Geographic"))
886  {
887  kwl.add(ossimKeywordNames::TYPE_KW, "ossimEquDistCylProjection", false);
888  scale_units = "degrees";
889  tie_pt_units = "degrees";
890  }
891  else
892  {
893  // pass along MrSid's projection name and pray it can be resolved:
894  kwl.add(ossimKeywordNames::PROJECTION_KW, proj_name, false);
895  if (unitType.empty())
896  {
897  if (proj_name.downcase().contains("feet"))
898  {
899  scale_units = "feet";
900  tie_pt_units = "feet";
901  }
902  }
903  else
904  {
905  scale_units = unitType;
906  tie_pt_units = unitType;
907  }
908  }
909 
910  // HACK: WGS-84 is specified in non-WKT format. Intercepting here. OLK 5/10
911  // TODO: Need datum factory that can handle miscellaneous non-WKT specs as they are
912  // encountered.
913  if (datum_name.contains("WGS") && datum_name.contains("84"))
914  kwl.add(ossimKeywordNames::DATUM_KW, "EPSG:6326");
915  else
916  kwl.add(ossimKeywordNames::DATUM_KW, datum_name, false);
917  }
918  }
919 
920  if ( scale_units.empty() || (scale_units == "unknown" ) ||
921  tie_pt_units.empty() || (tie_pt_units == "unknown" ) )
922  {
924  << "ossimMrSidReader::getProjection WARNING: Undefined units!"
925  << "\nscale units: " << scale_units
926  << "\ntie_pt_units: " << tie_pt_units
927  << std::endl;
928  }
929 
930  kwl.add(ossimKeywordNames::PIXEL_SCALE_XY_KW, gsd.toString());
932  kwl.add(ossimKeywordNames::TIE_POINT_XY_KW, tie.toString());
933  kwl.add(ossimKeywordNames::TIE_POINT_UNITS_KW, tie_pt_units);
934 
935  ossimProjection* proj =
937  return proj;
938 }
const ossimString & getProjectionName() const
Reads a single record from a aux file.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel=0) const
Gets number of lines for res level.
static const char * PROJECTION_KW
const ossimString & getDatumName() const
static const char * DATUM_KW
ossimFilename theImageFile
Represents serializable keyword/value map.
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
bool contains(char aChar) const
Definition: ossimString.h:58
static const char * NUMBER_LINES_KW
static const char * TYPE_KW
bool open(const ossimFilename &file)
the file for reading
const ossimString & getUnitType() const
static const char * PIXEL_SCALE_XY_KW
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
bool exists() const
std::string::size_type size() const
Definition: ossimString.h:405
unsigned int ossim_uint32
Utility/support data class to parse WKT text string to an ossimKeywordlist.
Definition: ossimWkt.h:68
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
static ossimProjectionFactoryRegistry * instance()
static const char * PCS_CODE_KW
bool getMetadataElement(LTIMetadataDatabase metaDb, const char *tagName, void *pValue, int iLength=0)
bool empty() const
Definition: ossimString.h:411
bool parse(const std::string &wkt)
Parses string to keyword list.
Definition: ossimWkt.cpp:52
const ossimKeywordlist & getKwl() const
Definition: ossimWkt.cpp:63
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
MrSIDImageReader * theReader
static const char * NUMBER_SAMPLES_KW
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
static const char * PIXEL_SCALE_UNITS_KW
static const char * TIE_POINT_UNITS_KW
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const
Gets the number of samples for res level.

◆ getImageDimensions()

bool ossimMrSidReader::getImageDimensions ( std::vector< ossimIrect > &  tileDims) const
private

Definition at line 588 of file ossimMrSidReader.cpp.

References ossimIrect::height(), theImageRect, theReader, and ossimIrect::width().

589 {
590  bool result = true;
591 
592  tileDims.clear();
593 
594  if (theReader != 0)
595  {
596  ossim_uint32 levels = theReader->getNumLevels();
597 
598  for (ossim_uint32 level=0; level <= levels; ++level)
599  {
600  lt_uint32 width = 0;
601  lt_uint32 height = 0;
602 
603  double mag = LTIUtils::levelToMag(level);
604  LTIUtils::getDimsAtMag(theImageRect.width(), theImageRect.height(), mag, width, height);
605 
606  // Make the imageRect upper left relative to any sub image offset.
607  ossimIrect imageRect(0, 0, width-1, height-1);
608 
609  tileDims.push_back(imageRect);
610  }
611  }
612  else
613  {
614  result = false;
615  }
616 
617  return result;
618 }
ossimIrect theImageRect
ossim_uint32 height() const
Definition: ossimIrect.h:487
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
MrSIDImageReader * theReader

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimMrSidReader::getImageGeometry ( )
virtual

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

The geometry contains full-to-local image transform as well as projection (image-to-world).

Reimplemented from ossimImageHandler.

Definition at line 447 of file ossimMrSidReader.cpp.

References ossimImageGeometryRegistry::extendGeometry(), ossimRefPtr< T >::get(), getExternalImageGeometry(), getInternalImageGeometry(), ossimImageGeometry::getProjection(), ossimImageHandler::initImageParameters(), ossimImageGeometryRegistry::instance(), and ossimImageHandler::theGeometry.

Referenced by getTile().

448 {
449  if ( !theGeometry )
450  {
451  //---
452  // Check for external geom:
453  //---
455 
456  if ( !theGeometry )
457  {
458  //---
459  // Check the internal geometry first to avoid a factory call.
460  //---
462 
463  // At this point it is assured theGeometry is set.
464 
465  // Check for set projection.
466  if ( !theGeometry->getProjection() )
467  {
468  // Try factories for projection.
470  }
471  }
472 
473  // Set image things the geometry object should know about.
475  }
476 
477  return theGeometry;
478 }
static ossimImageGeometryRegistry * instance()
ossimRefPtr< ossimImageGeometry > theGeometry
virtual ossimRefPtr< ossimImageGeometry > getInternalImageGeometry() const
Method to get geometry from internal mrsid tags.
virtual bool extendGeometry(ossimImageHandler *handler) const
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Gets the image geometry from external ".geom" or ".aux.xml" file.

◆ getImageTileHeight()

ossim_uint32 ossimMrSidReader::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 height which can be different than the internal image tile height on disk.

Implements ossimImageHandler.

Definition at line 428 of file ossimMrSidReader.cpp.

References ossimIrect::height(), theImageRect, and theMrSidDims.

429 {
430  ossim_uint32 result = 0;
431  if ( theMrSidDims.size() )
432  {
433  if ( theMrSidDims[0].height() != theImageRect.height() )
434  {
435  // Not a single tile.
436  result = theMrSidDims[0].height();
437  }
438  }
439  return result;
440 }
ossimIrect theImageRect
ossim_uint32 height() const
Definition: ossimIrect.h:487
unsigned int ossim_uint32
std::vector< ossimIrect > theMrSidDims
Has sub image offset.

◆ getImageTileWidth()

ossim_uint32 ossimMrSidReader::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 414 of file ossimMrSidReader.cpp.

References theImageRect, theMrSidDims, and ossimIrect::width().

415 {
416  ossim_uint32 result = 0;
417  if ( theMrSidDims.size() )
418  {
419  if ( theMrSidDims[0].width() != theImageRect.width() )
420  {
421  // Not a single tile.
422  result = theMrSidDims[0].width();
423  }
424  }
425  return result;
426 }
ossimIrect theImageRect
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
std::vector< ossimIrect > theMrSidDims
Has sub image offset.

◆ getInternalImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimMrSidReader::getInternalImageGeometry ( ) const
protectedvirtual

Method to get geometry from internal mrsid tags.

Returns
The image geometry object associated with this mrsid image.

Reimplemented from ossimImageHandler.

Definition at line 503 of file ossimMrSidReader.cpp.

Referenced by getImageGeometry().

504 {
505  static const char MODULE[] = "ossimMrSidReader::getInternalImageGeometry";
506  if (traceDebug())
507  {
508  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
509  }
510 
512 
513  // Must cast away constness.
514  ossimMrSidReader* th = const_cast<ossimMrSidReader*>(this);
516 
517  geom->setProjection(proj.get());
518 
519  return geom;
520 }
void setProjection(ossimProjection *projection)
Sets the projection to be used for local-to-world coordinate transformation.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
ossimProjection * getGeoProjection()
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getLongName()

ossimString ossimMrSidReader::getLongName ( ) const
virtual

Returns long name.

Returns
"ossim mrsid reader"

Reimplemented from ossimObject.

Definition at line 107 of file ossimMrSidReader.cpp.

108 {
109  return ossimString("ossim mrsid reader");
110 }

◆ getMetadataElement()

bool ossimMrSidReader::getMetadataElement ( LTIMetadataDatabase  metaDb,
const char *  tagName,
void *  pValue,
int  iLength = 0 
)
private

Definition at line 940 of file ossimMrSidReader.cpp.

Referenced by getGeoProjection().

944 {
945  if (!metaDb.has(tagName))
946  {
947  return false;
948  }
949 
950  const LTIMetadataRecord* metaRec = 0;
951  metaDb.get(tagName, metaRec );
952 
953  if (!metaRec->isScalar())
954  {
955  return false;
956  }
957 
958  // XXX: return FALSE if we have more than one element in metadata record
959  int iSize;
960  switch(metaRec->getDataType())
961  {
962  case LTI_METADATA_DATATYPE_UINT8:
963  case LTI_METADATA_DATATYPE_SINT8:
964  iSize = 1;
965  break;
966  case LTI_METADATA_DATATYPE_UINT16:
967  case LTI_METADATA_DATATYPE_SINT16:
968  iSize = 2;
969  break;
970  case LTI_METADATA_DATATYPE_UINT32:
971  case LTI_METADATA_DATATYPE_SINT32:
972  case LTI_METADATA_DATATYPE_FLOAT32:
973  iSize = 4;
974  break;
975  case LTI_METADATA_DATATYPE_FLOAT64:
976  iSize = 8;
977  break;
978  case LTI_METADATA_DATATYPE_ASCII:
979  iSize = iLength;
980  break;
981  default:
982  iSize = 0;
983  break;
984  }
985 
986  if ( metaRec->getDataType() == LTI_METADATA_DATATYPE_ASCII )
987  {
988  strncpy( (char *)pValue, ((const char**)metaRec->getScalarData())[0], iSize );
989  ((char *)pValue)[iSize - 1] = '\0';
990  }
991  else
992  {
993  memcpy( pValue, metaRec->getScalarData(), iSize);
994  }
995 
996  return true;
997 }

◆ getNumberOfDecimationLevels()

ossim_uint32 ossimMrSidReader::getNumberOfDecimationLevels ( ) const
virtual

Returns the number of decimation levels.

This returns the total number of decimation levels. It is important to note that res level 0 or full resolution is included in the list and has decimation values 1.0, 1.0

Returns
The number of decimation levels.

Reimplemented from ossimImageHandler.

Definition at line 161 of file ossimMrSidReader.cpp.

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

Referenced by computeDecimationFactors().

162 {
163  ossim_uint32 result = 1; // Add r0
164 
165  if (theMinDwtLevels)
166  {
167  //---
168  // Add internal overviews.
169  //---
170  result += theMinDwtLevels;
171  }
172 
173  if (theOverview.valid())
174  {
175  //---
176  // Add external overviews.
177  //---
179  }
180 
181  return result;
182 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
unsigned int ossim_uint32
ossimRefPtr< ossimImageHandler > theOverview
ossim_uint32 theMinDwtLevels

◆ getNumberOfInputBands()

ossim_uint32 ossimMrSidReader::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageSource.

Definition at line 404 of file ossimMrSidReader.cpp.

References theNumberOfBands.

405 {
406  return theNumberOfBands;
407 }
ossim_uint32 theNumberOfBands

◆ getNumberOfLines()

ossim_uint32 ossimMrSidReader::getNumberOfLines ( ossim_uint32  resLevel = 0) const
virtual

Gets number of lines for res level.

Parameters
resLevelReduced resolution level to return lines of. Default = 0
Returns
The number of lines for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 184 of file ossimMrSidReader.cpp.

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

Referenced by computeDecimationFactors(), and getGeoProjection().

186 {
187  ossim_uint32 result = 0;
188  if ( isValidRLevel(resLevel) )
189  {
190  if (resLevel <= theMinDwtLevels)
191  {
192  if (theMrSidDims.size() > 0)
193  {
194  result = theMrSidDims[resLevel].height();
195  }
196  }
197  else if (theOverview.valid())
198  {
199  result = theOverview->getNumberOfSamples(resLevel);
200  }
201  }
202  return result;
203 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
unsigned int ossim_uint32
std::vector< ossimIrect > theMrSidDims
Has sub image offset.
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossim_uint32 theMinDwtLevels

◆ getNumberOfOutputBands()

ossim_uint32 ossimMrSidReader::getNumberOfOutputBands ( ) const
virtual

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

Note: we are supporting sources that can have multiple data objects. If you want to know the scalar type of an object you can pass in the

Reimplemented from ossimImageSource.

Definition at line 409 of file ossimMrSidReader.cpp.

References theNumberOfBands.

410 {
411  return theNumberOfBands;
412 }
ossim_uint32 theNumberOfBands

◆ getNumberOfSamples()

ossim_uint32 ossimMrSidReader::getNumberOfSamples ( ossim_uint32  resLevel = 0) const
virtual

Gets the number of samples for res level.

Parameters
resLevelReduced resolution level to return samples of. Default = 0
Returns
The number of samples for specified reduced resolution level.

Implements ossimImageHandler.

Definition at line 205 of file ossimMrSidReader.cpp.

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

Referenced by computeDecimationFactors(), and getGeoProjection().

207 {
208  ossim_uint32 result = 0;
209  if ( isValidRLevel(resLevel) )
210  {
211  if (resLevel <= theMinDwtLevels)
212  {
213  if (theMrSidDims.size() > 0)
214  {
215  result = theMrSidDims[resLevel].width();
216  }
217  }
218  else if (theOverview.valid())
219  {
220  result = theOverview->getNumberOfSamples(resLevel);
221  }
222  }
223  return result;
224 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
unsigned int ossim_uint32
std::vector< ossimIrect > theMrSidDims
Has sub image offset.
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossim_uint32 theMinDwtLevels

◆ getOutputScalarType()

ossimScalarType ossimMrSidReader::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 442 of file ossimMrSidReader.cpp.

References theScalarType.

Referenced by getTile().

443 {
444  return theScalarType;
445 }
ossimScalarType theScalarType

◆ getShortName()

ossimString ossimMrSidReader::getShortName ( ) const
virtual

Returns short name.

Returns
"ossim_mrsid_reader"

Reimplemented from ossimObject.

Definition at line 102 of file ossimMrSidReader.cpp.

103 {
104  return ossimString("ossim_mrsid_reader");
105 }

◆ getTile()

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

Method to grab a tile(rectangle) from image.

Parameters
rectThe zero based rectangle to grab.
resLevelThe reduced resolution level to grab from.
Returns
The ref pointer with the image data pointer.

Reimplemented from ossimImageSource.

Definition at line 326 of file ossimMrSidReader.cpp.

References ossimIrect::clipToRect(), ossimIrect::completely_within(), ossimImageGeometry::decimationFactor(), ossimImageHandler::getBoundingRect(), ossimImageData::getBuf(), getImageGeometry(), getOutputScalarType(), ossimImageSource::getTile(), ossimIrect::height(), ossimIrect::intersects(), isOpen(), ossimSource::isSourceEnabled(), ossimImageHandler::isValidRLevel(), ossimDpt::lat, ossimImageData::loadBand(), ossimIrect::lr(), ossimImageData::makeBlank(), ossimImageData::setImageRectangle(), ossimRectilinearDataObject::setScalarType(), ossimImageHandler::theGeometry, theImageNavigator, theMinDwtLevels, theNumberOfBands, ossimImageHandler::theOverview, theReader, theTile, ossimIrect::ul(), ossimRefPtr< T >::valid(), ossimImageData::validate(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

328 {
329  LT_STATUS sts = LT_STS_Uninit;
330 
331  // This tile source bypassed, or invalid res level, return null tile.
332  if(!isSourceEnabled() || !isOpen() || !isValidRLevel(resLevel))
333  {
335  }
336 
337  ossimIrect imageBound = getBoundingRect(resLevel);
338  if(!rect.intersects(imageBound))
339  {
341  }
342 
343  // Check for overview.
344  if( resLevel > theMinDwtLevels )
345  {
346  if(theOverview.valid())
347  {
348  ossimRefPtr<ossimImageData> tileData = theOverview->getTile(rect, resLevel);
349  tileData->setScalarType(getOutputScalarType());
350  return tileData;
351  }
352  }
353 
354  theTile->setImageRectangle(rect);
355 
356  // Compute clip rectangle with respect to the image bounds.
357  ossimIrect clipRect = rect.clipToRect(imageBound);
358 
359  if (rect.completely_within(clipRect) == false)
360  {
361  // Not filling whole tile so blank it out first.
362  theTile->makeBlank();
363  }
364 
365  lt_uint16 anOssimBandIndex = 0;
366 
367  LTIPixel pixel(theReader->getColorSpace(), theNumberOfBands, theReader->getDataType());
368  LTISceneBuffer sceneBuffer(pixel, clipRect.width(), clipRect.height(), NULL);
369 
370  if (!theGeometry.valid())
371  {
373  }
374  double mag = theGeometry->decimationFactor(resLevel).lat;
375  sts = theImageNavigator->setSceneAsULWH(clipRect.ul().x,
376  clipRect.ul().y,
377  clipRect.lr().x - clipRect.ul().x + 1,
378  clipRect.lr().y - clipRect.ul().y + 1, mag);
379 
380  LTIScene scene = theImageNavigator->getScene();
381  sts = theReader->read(scene, sceneBuffer);
382 
383  if (LT_SUCCESS(sts) == true)
384  {
385  if(clipRect == rect)
386  {
387  void *buf = theTile->getBuf();
388  sceneBuffer.exportDataBSQ(buf);
389  }
390  else
391  {
392  for(anOssimBandIndex = 0; anOssimBandIndex < theNumberOfBands; anOssimBandIndex++)
393  {
394  theTile->loadBand(sceneBuffer.getBandData(anOssimBandIndex),//sceneBuffer.getTotalBandData(anOssimBandIndex),
395  clipRect, anOssimBandIndex);
396  }
397  }
398  }
399 
400  theTile->validate();
401  return theTile;
402 }
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
ossimRefPtr< ossimImageGeometry > theGeometry
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
bool completely_within(const ossimIrect &rect) const
Definition: ossimIrect.cpp:425
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
double lat
Definition: ossimDpt.h:165
virtual ossimDataObjectStatus validate() const
ossimRefPtr< ossimImageData > theTile
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
ossim_uint32 theNumberOfBands
virtual void makeBlank()
Initializes data to null pixel values.
virtual ossimScalarType getOutputScalarType() const
Returns the output pixel type of the tile source.
ossimRefPtr< ossimImageHandler > theOverview
virtual bool isOpen() const
Method to test for open file stream.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
Returns zero-based bounding rectangle of the image.
ossim_int32 x
Definition: ossimIpt.h:141
LTINavigator * theImageNavigator
ossim_uint32 theMinDwtLevels
virtual void setScalarType(ossimScalarType type)
See ossimScalarType in ossimConstants for a full list.
MrSIDImageReader * theReader
ossimDpt decimationFactor(ossim_uint32 r_index) const
Returns the decimation factor from R0 for the resolution level specified.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)

◆ isOpen()

bool ossimMrSidReader::isOpen ( ) const
virtual

Method to test for open file stream.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 314 of file ossimMrSidReader.cpp.

References ossimRefPtr< T >::get(), and theTile.

Referenced by getTile().

315 {
316  return theTile.get();
317 }
ossimRefPtr< ossimImageData > theTile

◆ loadState()

bool ossimMrSidReader::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 620 of file ossimMrSidReader.cpp.

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

622 {
623  bool result = false;
624 
625  if ( ossimImageHandler::loadState(kwl, prefix) )
626  {
627  result = open();
628  }
629 
630  return result;
631 }
virtual bool open()
Open method.
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 ossimMrSidReader::open ( )
virtual

Open method.

Returns
true on success, false on error.

Implements ossimImageHandler.

Definition at line 226 of file ossimMrSidReader.cpp.

Referenced by loadState().

227 {
228  static const char MODULE[] = "ossimMrSidReader::open";
229 
230  if (traceDebug())
231  {
233  << MODULE << " entered...\n"
234  << "image: " << theImageFile << "\n";
235  }
236 
237  bool result = false;
238 
239  if(isOpen())
240  {
241  closeEntry();
242  }
243 
244  ossimString ext = theImageFile.ext();
245  ext.downcase();
246  if ( ext != "sid" )
247  {
248  return false;
249  }
250 
251  LT_STATUS sts = LT_STS_Uninit;
252 
253  const LTFileSpec fileSpec(theImageFile.c_str());
254 
255  theReader = MrSIDImageReader::create();
256  sts = theReader->initialize(fileSpec, true);
257  if (LT_SUCCESS(sts) == false)
258  {
259  return false;
260  }
261 
262  theImageNavigator = new LTINavigator(*theReader);
263 
264  theImageRect = ossimIrect(0, 0, theReader->getWidth()-1, theReader->getHeight()-1);
265  theNumberOfBands = theReader->getNumBands();
266  theMinDwtLevels = theReader->getNumLevels();
267 
268  getDataType();
269 
271  {
273  {
274  ossim_uint32 width = theReader->getWidth();
275  ossim_uint32 height = theReader->getHeight();
276 
277  // Check for zero width, height.
278  if ( !width || !height )
279  {
280  ossimIpt tileSize;
281  ossim::defaultTileSize(tileSize);
282 
283  width = tileSize.x;
284  height = tileSize.y;
285  }
286 
288 
289  theTile->initialize();
290 
291  // Call the base complete open to pick up overviews.
292  computeMinMax();
293  completeOpen();
294 
295  result = true;
296  }
297  }
298 
299  if (result == false)
300  {
301  closeEntry();
302  }
303 
304  if (traceDebug())
305  {
307  << MODULE << " exit status = " << (result?"true":"false\n")
308  << std::endl;
309  }
310 
311  return result;
312 }
bool getImageDimensions(std::vector< ossimIrect > &tileDims) const
ossimIrect theImageRect
ossimFilename theImageFile
virtual void closeEntry()
Method to close current entry.
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
unsigned int ossim_uint32
ossimRefPtr< ossimImageData > theTile
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
ossimScalarType theScalarType
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
std::vector< ossimIrect > theMrSidDims
Has sub image offset.
ossim_uint32 theNumberOfBands
virtual void completeOpen()
Will complete the opening process.
virtual bool isOpen() const
Method to test for open file stream.
ossim_int32 y
Definition: ossimIpt.h:142
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
ossimString ext() const
ossim_int32 x
Definition: ossimIpt.h:141
LTINavigator * theImageNavigator
ossim_uint32 theMinDwtLevels
MrSIDImageReader * theReader
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

Member Data Documentation

◆ theImageNavigator

LTINavigator* ossimMrSidReader::theImageNavigator
private

Definition at line 221 of file ossimMrSidReader.h.

Referenced by getTile(), and ~ossimMrSidReader().

◆ theImageRect

ossimIrect ossimMrSidReader::theImageRect
private

Definition at line 224 of file ossimMrSidReader.h.

Referenced by getImageDimensions(), getImageTileHeight(), and getImageTileWidth().

◆ theMinDwtLevels

ossim_uint32 ossimMrSidReader::theMinDwtLevels
private

◆ theMrSidDims

std::vector<ossimIrect> ossimMrSidReader::theMrSidDims
private

Has sub image offset.

Image dimensions for each level.

Definition at line 227 of file ossimMrSidReader.h.

Referenced by getImageTileHeight(), getImageTileWidth(), getNumberOfLines(), and getNumberOfSamples().

◆ theNumberOfBands

ossim_uint32 ossimMrSidReader::theNumberOfBands
private

Definition at line 229 of file ossimMrSidReader.h.

Referenced by getNumberOfInputBands(), getNumberOfOutputBands(), and getTile().

◆ theReader

MrSIDImageReader* ossimMrSidReader::theReader
private

◆ theScalarType

ossimScalarType ossimMrSidReader::theScalarType
private

Definition at line 230 of file ossimMrSidReader.h.

Referenced by getDataType(), and getOutputScalarType().

◆ theTile

ossimRefPtr<ossimImageData> ossimMrSidReader::theTile
private

Definition at line 231 of file ossimMrSidReader.h.

Referenced by closeEntry(), getTile(), and isOpen().


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