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

CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a color image. More...

#include <ossimCibCadrgTileSource.h>

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

Classes

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

Public Types

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

Public Member Functions

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

Static Public Attributes

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

Protected Member Functions

virtual ~ossimCibCadrgTileSource ()
 Destructor. More...
 
void updatePropertiesToFirstValidFrame ()
 
virtual void setTocEntryToRender (const ossimRpfTocEntry *entry)
 Sets the entry to be renderer. More...
 
virtual bool setEntryToRender (ossim_uint32 index)
 Sets the entry to render. More...
 
vector< ossimFrameEntryDatagetIntersectingEntries (const ossimIrect &rect)
 It is important to note that each frame is organized into an easting northing type orientation. More...
 
void fillTile (const ossimIrect &tileRect, const vector< ossimFrameEntryData > &framesInvolved, ossimImageData *tile)
 This is a wrapper for the fill cib and fill cadrg. More...
 
void fillSubTileCib (const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
 Will uncompress the CIB file using a VQ decompression algorithm. More...
 
void fillSubTileCadrg (const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
 Will uncompress the CADRG file using a VQ decompression algorithm. More...
 
void allocateForProduct ()
 Will allocate an internal buffer for the given product. More...
 
const ossimRpfTocEntryfindFirstFrame ()
 This will search each entry in the table and look for a certain entry. More...
 
void deleteAll ()
 
void populateLut ()
 
- 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

unsigned char * theCompressedBuffer
 This is for storage of a single compressed buffer. More...
 
unsigned char * theUncompressedBuffer
 This is used as a buffer to uncompress the data to. More...
 
ossim_uint32 theNumberOfLines
 This will be computed based on the frames organized within the directory. More...
 
ossim_uint32 theNumberOfSamples
 This will be computed based on the frames organized within the directory. More...
 
ossimRefPtr< ossimImageDatatheTile
 This is the actual data returned from a getTile request. More...
 
ossimRpfToctheTableOfContents
 Will own a table of contents. More...
 
const ossimRpfTocEntrytheEntryToRender
 This is the actual frame file to render. More...
 
ossim_int32 theEntryNumberToRender
 This will be the entry number that we are currently rendering. More...
 
ossimCibCadrgProductType theProductType
 Holds the enumeration specifying the product type. More...
 
ossimRpfFrametheWorkFrame
 
bool theSkipEmptyCheck
 If true during the call to open(), the RPF file is opened even if all the frame files are missing. More...
 
- 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
 

Friends

class ossimMultiEntryCibCadrg
 

Detailed Description

CIB/CADRG formats are encoded the same except that the CIB is a grey scale image and the CADRG is a color image.

Both are VQ compressed. The images are encoded into an NITF format with embedded RPF headers. It reads the embedded RPF tags from the NITF file and parses the data. It allows for you to select which CIB/CADRG entry to render. The handler is opened by giving it the associated a.toc file. This is a table of contents file that describes all the entries found in the CIB/CADRG product. You must set which entry you wish to render. By default it will render the first product it comes to.

Note: This handler will eventually merge into the nitf handler.

Definition at line 35 of file ossimCibCadrgTileSource.h.

Member Enumeration Documentation

◆ ossimCibCadrgProductType

Basic enumeration.

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

Enumerator
OSSIM_PRODUCT_TYPE_UNKNOWN 
OSSIM_PRODUCT_TYPE_CIB 
OSSIM_PRODUCT_TYPE_CADRG 

Definition at line 45 of file ossimCibCadrgTileSource.h.

Constructor & Destructor Documentation

◆ ossimCibCadrgTileSource()

ossimCibCadrgTileSource::ossimCibCadrgTileSource ( )

Default constructor.

Initializes all internal attributes to a default state.

Definition at line 51 of file ossimCibCadrgTileSource.cpp.

57  theTile(0),
62  theWorkFrame(0),
63  theSkipEmptyCheck(false)
64 {
65  if (traceDebug())
66  {
68  << "ossimCibCadrgTileSource::ossimCibCadrgTileSource entered...\n";
69 #ifdef OSSIM_ID_ENABLED
71  << "OSSIM_ID: " << OSSIM_ID << "\n";
72 #endif
73  }
74 
75  // Moved memory allocation to happen in first get tile. drb
76 
77  // theWorkFrame = new ossimRpfFrame;
78 
79  // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
80  // convert to bytes
81  // theCompressedBuffer = new ossim_uint8[(64*64*12)/8];
82 
83  // whether CIB or CADRG we will alocate the buffer
84  // to the larger of the 2 (CADRG is 3 bands)
85  // theUncompressedBuffer = new ossim_uint8[256*256*3];
86 
87 }
ossim_uint32 theNumberOfLines
This will be computed based on the frames organized within the directory.
ossimRpfToc * theTableOfContents
Will own a table of contents.
unsigned char * theCompressedBuffer
This is for storage of a single compressed buffer.
bool theSkipEmptyCheck
If true during the call to open(), the RPF file is opened even if all the frame files are missing...
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
unsigned char * theUncompressedBuffer
This is used as a buffer to uncompress the data to.
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
ossimRefPtr< ossimImageData > theTile
This is the actual data returned from a getTile request.
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.
ossimImageHandler()
Constructor (default):
ossim_uint32 theNumberOfSamples
This will be computed based on the frames organized within the directory.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimCibCadrgTileSource()

ossimCibCadrgTileSource::~ossimCibCadrgTileSource ( )
protectedvirtual

Destructor.

Will return allocated memory back to the heap.

Definition at line 89 of file ossimCibCadrgTileSource.cpp.

References close(), theCompressedBuffer, theUncompressedBuffer, and theWorkFrame.

90 {
92  {
93  delete [] theCompressedBuffer;
95  }
97  {
98  delete [] theUncompressedBuffer;
100  }
101  if(theWorkFrame)
102  {
103  delete theWorkFrame;
104  theWorkFrame = 0;
105  }
106  close();
107 }
unsigned char * theCompressedBuffer
This is for storage of a single compressed buffer.
unsigned char * theUncompressedBuffer
This is used as a buffer to uncompress the data to.
virtual void close()
Closes this image handler and deletes any allocated data.

Member Function Documentation

◆ allocateForProduct()

void ossimCibCadrgTileSource::allocateForProduct ( )
protected

Will allocate an internal buffer for the given product.

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

Definition at line 1036 of file ossimCibCadrgTileSource.cpp.

References ossimImageDataFactory::create(), ossimImageData::initialize(), ossimImageDataFactory::instance(), OSSIM_PRODUCT_TYPE_CIB, OSSIM_PRODUCT_TYPE_UNKNOWN, theCompressedBuffer, theProductType, theTile, theUncompressedBuffer, and theWorkFrame.

Referenced by getTile().

1037 {
1039  {
1040  return;
1041  }
1042 
1043  if ( theWorkFrame )
1044  {
1045  delete theWorkFrame;
1046  }
1048 
1050  {
1051  delete [] theCompressedBuffer;
1052  }
1053 
1054  //---
1055  // A CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to convert
1056  // to bytes.
1057  //---
1058  theCompressedBuffer = new ossim_uint8[(64*64*12)/8];
1059 
1061  {
1062  delete [] theUncompressedBuffer;
1063  }
1065  {
1066  theUncompressedBuffer = new ossim_uint8[256*256];
1067  }
1068  else
1069  {
1070  theUncompressedBuffer = new ossim_uint8[256*256*3];
1071  }
1072 
1074  theTile->initialize();
1075 }
unsigned char * theCompressedBuffer
This is for storage of a single compressed buffer.
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
unsigned char * theUncompressedBuffer
This is used as a buffer to uncompress the data to.
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimRefPtr< ossimImageData > theTile
This is the actual data returned from a getTile request.
unsigned char ossim_uint8

◆ close()

void ossimCibCadrgTileSource::close ( )
virtual

Closes this image handler and deletes any allocated data.

Reimplemented from ossimImageHandler.

Definition at line 120 of file ossimCibCadrgTileSource.cpp.

References ossimImageHandler::close(), and deleteAll().

Referenced by ~ossimCibCadrgTileSource().

121 {
122  deleteAll();
124 }
virtual void close()
Deletes the overview and clears the valid image vertices.

◆ deleteAll()

void ossimCibCadrgTileSource::deleteAll ( )
protected

Definition at line 1098 of file ossimCibCadrgTileSource.cpp.

References ossimImageHandler::theOverview, and theTableOfContents.

Referenced by close().

1099 {
1100  theOverview = 0;
1101  if(theTableOfContents)
1102  {
1103  delete theTableOfContents;
1104  theTableOfContents = 0;
1105  }
1106 }
ossimRpfToc * theTableOfContents
Will own a table of contents.
ossimRefPtr< ossimImageHandler > theOverview

◆ fillSubTileCadrg()

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

Will uncompress the CADRG file using a VQ decompression algorithm.

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

Definition at line 757 of file ossimCibCadrgTileSource.cpp.

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

Referenced by fillTile().

762 {
763  // first let's grab the absolute position of the frame rectangle in pixel space
764  ossimIrect frameRect(frameEntryData.thePixelCol,
765  frameEntryData.thePixelRow,
766  frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH - 1,
767  frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
768 
769 
770  // now clip it to the tile
771  ossimIrect clipRect = tileRect.clipToRect(frameRect);
772 
773  const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
774 
775  if(!compressionSection)
776  {
777  return;
778  }
779 
780  const vector<ossimRpfColorGrayscaleTable>& colorTable =
781  aFrame.getColorGrayscaleTable();
782 
783  // ESH 03/2009 -- Partial fix for ticket #646.
784  // Crash fix on reading RPFs: Make sure the colorTable vector
785  // has entries before trying to make use of them.
786  int numTables = (int)colorTable.size();
787  if ( numTables <= 0 )
788  {
789  return;
790  }
791 
792  ossim_uint8 *tempRows[3];
793 
794  tempRows[0] = theUncompressedBuffer;
795  tempRows[1] = (theUncompressedBuffer + 256*256);
796  tempRows[2] = (tempRows[1] + 256*256);
797 
798  // find the shift to 0,0
799  ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
800  clipRect.ul().y - frameEntryData.thePixelRow);
801 
802 
803  // In order to compute the subframe we will need the corner offsets of
804  // the upper left of the frame and the upper left of the clip rect. The
805  // clip rect should be completely within the frame. This just translates the value
806  // to make the upper left of the frame be 0,0.
807  //
808  ossimIrect offsetRect(tempDelta.x,
809  tempDelta.y,
810  tempDelta.x + clipRect.width()-1,
811  tempDelta.y + clipRect.height()-1);
812 
813  // each subframe is 64x64. We will actually use 256x256 since
814  // we will be uncompressing them. Note CADRG is a 256x256 tile
815  // compressed to 64x64x12 bit data
816  //
817  ossimIrect subFrameRect(offsetRect.ul().x/256,
818  offsetRect.ul().y/256,
819  (offsetRect.lr().x)/256,
820  (offsetRect.lr().y)/256);
821 
822  ossim_uint32 readPtr = 0;
823 
824  ossim_int32 row = 0;
825  ossim_int32 col = 0;
826  ossim_uint32 i = 0;
827  ossim_uint32 j = 0;
828  ossim_int32 upperY = subFrameRect.lr().y;
829  ossim_int32 upperX = subFrameRect.lr().x;
830  ossim_int32 lowerY = subFrameRect.ul().y;
831  ossim_int32 lowerX = subFrameRect.ul().x;
832  for(row = lowerY; row <= upperY; ++row)
833  {
834  for(col = lowerX; col <= upperX; ++col)
835  {
836  readPtr = 0;
837  if(aFrame.fillSubFrameBuffer(theCompressedBuffer, 0, row, col))
838  {
839  for (i = 0; i < 256; i += 4)
840  {
841  for (j = 0; j < 256; j += 8)
842  {
843  ossim_uint16 firstByte = theCompressedBuffer[readPtr++] & 0xff;
844  ossim_uint16 secondByte = theCompressedBuffer[readPtr++] & 0xff;
845  ossim_uint16 thirdByte = theCompressedBuffer[readPtr++] & 0xff;
846 
847  //because dealing with half-bytes is hard, we
848  //uncompress two 4x4 tiles at the same time. (a
849  //4x4 tile compressed is 12 bits )
850  // this little code was grabbed from openmap software.
851 
852  /* Get first 12-bit value as index into VQ table */
853  // I think we need to swap
854  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
855 
856  /* Get second 12-bit value as index into VQ table*/
857  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
858 
859  for (ossim_uint32 t = 0; t < 4; ++t)
860  {
861  for (ossim_uint32 e = 0; e < 4; ++e)
862  {
863  ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
864  ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
865 
866  ossim_uint32 pixindex = ((i+t)*256) +
867  (j + e);
868  const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
869  const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
870 
871 
872  tempRows[0][pixindex] = color1[0];
873  tempRows[1][pixindex] = color1[1];
874  tempRows[2][pixindex] = color1[2];
875 
876  tempRows[0][pixindex+4] = color2[0];
877  tempRows[1][pixindex+4] = color2[1];
878  tempRows[2][pixindex+4] = color2[2];
879  } //for e
880  } //for t
881  } /* for j */
882  } //for i
883  }
884  else
885  {
886  memset(theUncompressedBuffer, 0, 256*256*3);
887  }
888  ossim_int32 tempCol = col*256;
889  ossim_int32 tempRow = row*256;
890  ossimIrect subRectToFill(frameRect.ul().x + tempCol,
891  frameRect.ul().y + tempRow,
892  frameRect.ul().x + tempCol + 255,
893  frameRect.ul().y + tempRow + 255);
895  subRectToFill,
896  OSSIM_BSQ);
897  }
898  }
899 }
const std::vector< ossimRpfCompressionOffsetTableData > & getTable() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
unsigned short ossim_uint16
unsigned char * theCompressedBuffer
This is for storage of a single compressed buffer.
const vector< ossimRpfColorGrayscaleTable > & getColorGrayscaleTable() const
Definition: ossimRpfFrame.h:80
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
unsigned char * theUncompressedBuffer
This is used as a buffer to uncompress the data to.
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
bool fillSubFrameBuffer(ossim_uint8 *buffer, ossim_uint32 spectralGroup, ossim_uint32 row, ossim_uint32 col) const
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
const ossimRpfCompressionSection * getCompressionSection() const
Definition: ossimRpfFrame.h:76
unsigned char ossim_uint8
int ossim_int32

◆ fillSubTileCib()

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

Will uncompress the CIB file using a VQ decompression algorithm.

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

Definition at line 901 of file ossimCibCadrgTileSource.cpp.

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

Referenced by fillTile().

906 {
907  // first let's grab the absolute position of the frame rectangle in pixel
908  // space
909  ossimIrect frameRect(frameEntryData.thePixelCol,
910  frameEntryData.thePixelRow,
911  frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH - 1,
912  frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
913 
914 
915  // now clip it to the tile
916  ossimIrect clipRect = tileRect.clipToRect(frameRect);
917 
918  const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
919 
920  if(!compressionSection)
921  {
922  return;
923  }
924 
925  const vector<ossimRpfColorGrayscaleTable>& colorTable =
926  aFrame.getColorGrayscaleTable();
927 
928  // ESH 03/2009 -- Partial fix for ticket #646.
929  // Crash fix on reading RPFs: Make sure the colorTable vector
930  // has entries before trying to make use of them.
931  int numTables = (int)colorTable.size();
932  if ( numTables <= 0 )
933  {
934  return;
935  }
936 
937  // check to see if it does overlap. If it doesn't then the width and height
938  // will be a single point
939  {
940  ossim_uint8 *tempRow;
941 
942  tempRow = theUncompressedBuffer;
943 
944  // find the shift to 0,0
945  ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
946  clipRect.ul().y - frameEntryData.thePixelRow);
947 
948  // In order to compute the subframe we will need the corner offsets of
949  // the upper left of the frame and the upper left of the clip rect. The
950  // clip rect should be completely within the frame. This just translates the value
951  // to make the upper left of the frame be 0,0.
952  //
953  ossimIrect offsetRect(tempDelta.x,
954  tempDelta.y,
955  tempDelta.x + clipRect.width()-1,
956  tempDelta.y + clipRect.height()-1);
957 
958  // each subframe is 64x64. We will actually use 256x256 since
959  // we will be uncompressing them. Note CADRG is a 256x256 tile
960  // compressed to 64x64x12 bit data
961  //
962  ossimIrect subFrameRect(offsetRect.ul().x/256,
963  offsetRect.ul().y/256,
964  (offsetRect.lr().x)/256,
965  (offsetRect.lr().y)/256);
966 
967  ossim_int32 row = 0;
968  ossim_int32 col = 0;
969  ossim_uint32 i = 0;
970  ossim_uint32 j = 0;
971  ossim_uint32 readPtr = 0;
972  for(row = subFrameRect.ul().y; row <= subFrameRect.lr().y; ++row)
973  {
974  for(col = subFrameRect.ul().x; col <= subFrameRect.lr().x; ++col)
975  {
976  readPtr = 0;
977  if(aFrame.fillSubFrameBuffer(theCompressedBuffer, 0, row, col))
978  {
979  for (i = 0; i < 256; i += 4)
980  {
981  for (j = 0; j < 256; j += 8)
982  {
983  ossim_uint16 firstByte = theCompressedBuffer[readPtr++] & 0xff;
984  ossim_uint16 secondByte = theCompressedBuffer[readPtr++] & 0xff;
985  ossim_uint16 thirdByte = theCompressedBuffer[readPtr++] & 0xff;
986 
987  //because dealing with half-bytes is hard, we
988  //uncompress two 4x4 tiles at the same time. (a
989  //4x4 tile compressed is 12 bits )
990  // this little code was grabbed from openmap software.
991 
992  /* Get first 12-bit value as index into VQ table */
993  // I think we need to swap
994  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
995 
996  /* Get second 12-bit value as index into VQ table*/
997  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
998 
999  for (ossim_uint32 t = 0; t < 4; ++t)
1000  {
1001  for (ossim_uint32 e = 0; e < 4; ++e)
1002  {
1003  ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
1004  ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
1005 
1006  ossim_uint32 pixindex = ((i+t)*256) + (j + e);
1007  const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
1008  const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
1009 
1010 
1011  tempRow[pixindex] = color1[0];
1012  tempRow[pixindex + 4] = color2[0];
1013  } //for e
1014  } //for t
1015  } /* for j */
1016  } //for i
1017  }
1018  else
1019  {
1020  memset(theUncompressedBuffer, 0, 256*256);
1021  }
1022  ossim_int32 tCol = col*256;
1023  ossim_int32 tRow = row*256;
1024  ossimIrect subRectToFill(frameRect.ul().x + tCol,
1025  frameRect.ul().y + tRow,
1026  frameRect.ul().x + tCol + 255,
1027  frameRect.ul().y + tRow + 255);
1029  subRectToFill,
1030  OSSIM_BSQ);
1031  }
1032  }
1033  }
1034 }
const std::vector< ossimRpfCompressionOffsetTableData > & getTable() const
ossim_uint32 height() const
Definition: ossimIrect.h:487
const ossimIpt & ul() const
Definition: ossimIrect.h:274
unsigned short ossim_uint16
unsigned char * theCompressedBuffer
This is for storage of a single compressed buffer.
const vector< ossimRpfColorGrayscaleTable > & getColorGrayscaleTable() const
Definition: ossimRpfFrame.h:80
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
unsigned char * theUncompressedBuffer
This is used as a buffer to uncompress the data to.
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
bool fillSubFrameBuffer(ossim_uint8 *buffer, ossim_uint32 spectralGroup, ossim_uint32 row, ossim_uint32 col) const
unsigned int ossim_uint32
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
const ossimRpfCompressionSection * getCompressionSection() const
Definition: ossimRpfFrame.h:76
unsigned char ossim_uint8
int ossim_int32

◆ fillTile()

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

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

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

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

Definition at line 723 of file ossimCibCadrgTileSource.cpp.

References fillSubTileCadrg(), fillSubTileCib(), ossimErrorCodes::OSSIM_OK, OSSIM_PRODUCT_TYPE_CIB, ossimRpfFrame::parseFile(), theProductType, and theWorkFrame.

Referenced by getTile().

727 {
728  ossim_uint32 idx = 0;
729  for(idx = 0;
730  idx < framesInvolved.size();
731  ++idx)
732  {
733 
734  if(theWorkFrame->parseFile(framesInvolved[idx].theFrameEntry.getFullPath())
736  {
737  // we will fill a subtile. We pass in which frame it is and the position of the frame.
738  // the actual pixel will be 1536*row and 1536 *col.
740  {
742  tileRect,
743  framesInvolved[idx],
744  tile);
745  }
746  else
747  {
749  tileRect,
750  framesInvolved[idx],
751  tile);
752  }
753  }
754  }
755 }
static const ossimErrorCode OSSIM_OK
void fillSubTileCib(const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
Will uncompress the CIB file using a VQ decompression algorithm.
unsigned int ossim_uint32
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
ossimErrorCode parseFile(const ossimFilename &filename, bool minimalParse=false)
void fillSubTileCadrg(const ossimRpfFrame &aFrame, const ossimIrect &tileRect, const ossimFrameEntryData &frameEntryData, ossimImageData *tile)
Will uncompress the CADRG file using a VQ decompression algorithm.

◆ findFirstFrame()

const ossimRpfTocEntry * ossimCibCadrgTileSource::findFirstFrame ( )
protected

This will search each entry in the table and look for a certain entry.

The first entry it comes to that has Geographic coverage will be the frame to render. This method is best here instead of in the ossimRpfToc. I am not sure, but I feel these types of searches are specific to the product (CADRG, CIB ...). This is called immediately after a succesful open of the ossimRpfToc

Definition at line 1077 of file ossimCibCadrgTileSource.cpp.

References getProductEntryList(), getProductScaleList(), ossimRpfToc::getTocEntry(), theEntryNumberToRender, and theTableOfContents.

1078 {
1079  vector<ossimString> products = getProductScaleList();
1080  vector<ossim_int32> indexProducts;
1081 
1082  if(products.size() > 0)
1083  {
1084  indexProducts = getProductEntryList(products[0]);
1085 
1086  if(indexProducts.size()>0)
1087  {
1088  theEntryNumberToRender = indexProducts[0];
1089 
1090  return theTableOfContents->getTocEntry(indexProducts[0]);
1091  }
1092  }
1093 
1094  return 0;
1095 }
vector< ossimString > getProductScaleList() const
This retrieves all product scales that are within the Table of contents.
ossimRpfToc * theTableOfContents
Will own a table of contents.
const ossimRpfTocEntry * getTocEntry(ossim_uint32 index) const
vector< ossim_int32 > getProductEntryList(const ossimString &productScale) const
Using the product scales from getProductScaleList() you can pass each string in so you can get all as...
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.

◆ getCurrentEntry()

ossim_uint32 ossimCibCadrgTileSource::getCurrentEntry ( ) const
virtual
Returns
The current entry number.
Note
This implementation returns 0. Derived classes should override if of multiple entry image type.

Reimplemented from ossimImageHandler.

Definition at line 447 of file ossimCibCadrgTileSource.cpp.

References theEntryNumberToRender.

448 {
450 }
unsigned int ossim_uint32
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.

◆ getCurrentEntryIndex()

ossim_int32 ossimCibCadrgTileSource::getCurrentEntryIndex ( ) const
virtual

Returns -1 if invalid.

Definition at line 539 of file ossimCibCadrgTileSource.cpp.

References theEntryNumberToRender.

540 {
541  return theEntryNumberToRender;
542 }
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.

◆ getCurrentTocEntry()

const ossimRpfTocEntry * ossimCibCadrgTileSource::getCurrentTocEntry ( ) const
virtual
Returns
The current entry being rendered

Definition at line 544 of file ossimCibCadrgTileSource.cpp.

References theEntryToRender.

545 {
546  return theEntryToRender;
547 }
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.

◆ getEntryList()

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

Reimplemented from ossimImageHandler.

Definition at line 473 of file ossimCibCadrgTileSource.cpp.

References getProductEntryList(), and getProductScaleList().

474 {
475  std::vector<ossimString> scaleList = getProductScaleList();
476  ossim_uint32 scaleIdx = 0;
477  ossim_uint32 entryIdx = 0;
478  for(scaleIdx = 0; scaleIdx < scaleList.size(); ++scaleIdx)
479  {
480  std::vector<ossim_int32> eList = getProductEntryList(scaleList[scaleIdx]);
481 
482  for(entryIdx = 0; entryIdx < eList.size(); ++entryIdx)
483  {
484  entryList.push_back(eList[entryIdx]);
485  }
486  }
487 
488 }
vector< ossimString > getProductScaleList() const
This retrieves all product scales that are within the Table of contents.
unsigned int ossim_uint32
vector< ossim_int32 > getProductEntryList(const ossimString &productScale) const
Using the product scales from getProductScaleList() you can pass each string in so you can get all as...

◆ getImageGeometry()

ossimRefPtr< ossimImageGeometry > ossimCibCadrgTileSource::getImageGeometry ( )
virtual


Populates the geometry object with image geometry information.

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

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

Reimplemented from ossimImageHandler.

Definition at line 413 of file ossimCibCadrgTileSource.cpp.

References ossimRefPtr< T >::get(), ossimImageHandler::getExternalImageGeometry(), ossimRpfTocEntry::getImageGeometry(), ossimImageHandler::initImageParameters(), theEntryToRender, and ossimImageHandler::theGeometry.

414 {
415  if ( !theGeometry )
416  {
417  // Check for external geom:
419 
420  if ( !theGeometry && theEntryToRender )
421  {
423  }
424 
425  // Set image things the geometry object should know about.
427  }
428 
429  return theGeometry;
430 }
ossimRefPtr< ossimImageGeometry > theGeometry
ossimRefPtr< ossimImageGeometry > getImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
virtual ossimRefPtr< ossimImageGeometry > getExternalImageGeometry() const
Returns the image geometry object associated with this tile source or NULL if non defined...

◆ getImageRectangle()

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

Reimplemented from ossimImageHandler.

Definition at line 405 of file ossimCibCadrgTileSource.cpp.

References getNumberOfLines(), and getNumberOfSamples().

Referenced by getIntersectingEntries(), and getTile().

406 {
407  return ossimIrect(0, // upper left x
408  0, // upper left y
409  getNumberOfSamples(reduced_res_level) - 1, // lower right x
410  getNumberOfLines(reduced_res_level) - 1); // lower right y
411 }
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.
virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level=0) const
Satisfies pure virtual requirement from ImageHandler class.

◆ getImageTileHeight()

ossim_uint32 ossimCibCadrgTileSource::getImageTileHeight ( ) const
virtual

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

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

Implements ossimImageHandler.

Definition at line 1167 of file ossimCibCadrgTileSource.cpp.

Referenced by getTileHeight().

1168 {
1169  return 256; // ??? drb
1170 }

◆ getImageTileWidth()

ossim_uint32 ossimCibCadrgTileSource::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 1162 of file ossimCibCadrgTileSource.cpp.

Referenced by getTileWidth().

1163 {
1164  return 256; // ??? drb
1165 }

◆ getIntersectingEntries()

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

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

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

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

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

Definition at line 680 of file ossimCibCadrgTileSource.cpp.

References CIBCADRG_FRAME_HEIGHT, CIBCADRG_FRAME_WIDTH, ossimIrect::clipToRect(), ossimRpfTocEntry::getEntry(), getImageRectangle(), ossimRpfTocEntry::getNumberOfFramesVertical(), ossimIrect::intersects(), isOpen(), ossimIrect::lr(), theEntryToRender, ossimIrect::ul(), ossimIpt::x, and ossimIpt::y.

Referenced by getTile().

681 {
682  vector<ossimFrameEntryData> result;
683 
684  // make sure we have the Toc entry to render
685  if(!isOpen()) return result;
686 
687  ossimIrect imageRect = getImageRectangle();
688  if(rect.intersects(imageRect))
689  {
690  ossimIrect clipRect = rect.clipToRect(imageRect);
691  ossimIrect frameRect(clipRect.ul().x/CIBCADRG_FRAME_WIDTH,
692  clipRect.ul().y/CIBCADRG_FRAME_HEIGHT,
693  clipRect.lr().x/CIBCADRG_FRAME_WIDTH,
694  clipRect.lr().y/CIBCADRG_FRAME_HEIGHT);
695 
696  ossimRpfFrameEntry tempEntry;
697 
698 
699  for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
700  {
701  for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
702  {
704  col,
705  tempEntry))
706  {
707  if(tempEntry.exists())
708  {
709  result.push_back(ossimFrameEntryData(row,
710  col,
713  tempEntry));
714  }
715  }
716  }
717  }
718  }
719 
720  return result;
721 }
ossim_uint32 getNumberOfFramesVertical() const
const ossimIpt & ul() const
Definition: ossimIrect.h:274
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
bool isOpen() const
Determines if its open if there eists a table of contents object.
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
static const ossim_uint32 CIBCADRG_FRAME_HEIGHT
CONSTANT representing the height of a Frame.
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
static const ossim_uint32 CIBCADRG_FRAME_WIDTH
CONSTANT representing the width of a Frame.
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
bool getEntry(long row, long col, ossimRpfFrameEntry &result) const
int ossim_int32

◆ getLongName()

ossimString ossimCibCadrgTileSource::getLongName ( ) const
virtual

This method is defined in the base class ossimObject.

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

Returns
The long name for this class as an ossimString.

Reimplemented from ossimObject.

Definition at line 114 of file ossimCibCadrgTileSource.cpp.

115 {
116  return ossimString("CIB/CADRG reader");
117 }

◆ getNumberOfInputBands()

ossim_uint32 ossimCibCadrgTileSource::getNumberOfInputBands ( ) const
virtual

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

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

Returns
number of input bands.

Implements ossimImageSource.

Definition at line 335 of file ossimCibCadrgTileSource.cpp.

References OSSIM_PRODUCT_TYPE_CADRG, OSSIM_PRODUCT_TYPE_CIB, OSSIM_PRODUCT_TYPE_UNKNOWN, and theProductType.

336 {
337  switch(theProductType)
338  {
340  {
341  return 0;
342  }
344  {
345  return 1;
346  }
348  {
349  return 3;
350  }
351  }
352 
353  return 0;
354 }
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.

◆ getNumberOfLines()

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

Satisfies pure virtual requirement from ImageHandler class.

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

Implements ossimImageHandler.

Definition at line 377 of file ossimCibCadrgTileSource.cpp.

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

Referenced by getImageRectangle().

378 {
379  if (reduced_res_level == 0)
380  {
381  return theNumberOfLines;
382  }
383  else if (theOverview.valid())
384  {
385  return theOverview->getNumberOfLines(reduced_res_level);
386  }
387 
388  return 0;
389 }
ossim_uint32 theNumberOfLines
This will be computed based on the frames organized within the directory.
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

◆ getNumberOfOutputBands()

ossim_uint32 ossimCibCadrgTileSource::getNumberOfOutputBands ( ) const
virtual

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

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

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

Reimplemented from ossimImageSource.

Definition at line 356 of file ossimCibCadrgTileSource.cpp.

References OSSIM_PRODUCT_TYPE_CADRG, OSSIM_PRODUCT_TYPE_CIB, OSSIM_PRODUCT_TYPE_UNKNOWN, and theProductType.

Referenced by getTile().

357 {
358  switch(theProductType)
359  {
361  {
362  return 0;
363  }
365  {
366  return 1;
367  }
369  {
370  return 3;
371  }
372  }
373 
374  return 0;
375 }
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.

◆ getNumberOfSamples()

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

Satisfies pure virtual requirement from ImageHandler class.

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

Implements ossimImageHandler.

Definition at line 391 of file ossimCibCadrgTileSource.cpp.

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

Referenced by getImageRectangle().

392 {
393  if (reduced_res_level == 0)
394  {
395  return theNumberOfSamples;
396  }
397  else if (theOverview.valid())
398  {
399  return theOverview->getNumberOfSamples(reduced_res_level);
400  }
401 
402  return 0;
403 }
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageHandler > theOverview
virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel=0) const =0
Pure virtual, derived classes must implement.
ossim_uint32 theNumberOfSamples
This will be computed based on the frames organized within the directory.

◆ getOutputScalarType()

ossimScalarType ossimCibCadrgTileSource::getOutputScalarType ( ) const
virtual

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

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

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

Reimplemented from ossimImageSource.

Definition at line 432 of file ossimCibCadrgTileSource.cpp.

References OSSIM_UCHAR.

433 {
434  return OSSIM_UCHAR;
435 }
8 bit unsigned iteger

◆ getProductEntryList()

vector< ossim_int32 > ossimCibCadrgTileSource::getProductEntryList ( const ossimString productScale) const

Using the product scales from getProductScaleList() you can pass each string in so you can get all associated indices for a given product.

Returns
Entry indices for a passed in product scale.

Definition at line 626 of file ossimCibCadrgTileSource.cpp.

References ossimRpfTocEntry::getBoundaryInformation(), ossimRpfToc::getNumberOfEntries(), ossimRpfBoundaryRectRecord::getScale(), ossimRpfToc::getTocEntry(), ossimRpfTocEntry::isEmpty(), isOpen(), ossimString::push_back(), theSkipEmptyCheck, theTableOfContents, ossimString::trim(), and ossimString::upcase().

Referenced by findFirstFrame(), and getEntryList().

627 {
628  vector<ossim_int32> result;
629 
630  if(isOpen())
631  {
633 
634  for(ossim_int32 index = 0; index < upperBound; ++index)
635  {
636  const ossimRpfTocEntry* entry = theTableOfContents->getTocEntry(index);
637 
638  if(entry)
639  {
640  // If the "skip empty check" is true, we don't check to see if the
641  // actual frame images exist. Otherwise the check is carried out,
642  // which is the default situation.
643  bool bIsEmpty = (theSkipEmptyCheck==false) ? entry->isEmpty() : false;
644 
645  // if the entry is not empty then add it to the list.
646  if( bIsEmpty == false )
647  {
648  ossimString scale = entry->getBoundaryInformation().getScale();
649  scale = scale.trim().upcase();
650  if(scale==productScale)
651  {
652  result.push_back(index);
653  }
654  }
655  }
656  }
657  }
658 
659  if (traceDebug())
660  {
662  << "ossimCibCadrgTileSource::getProductEntryList DEBUG:"
663  << endl;
664 
665  std::vector<ossim_int32>::const_iterator i = result.begin();
666  ossim_uint32 index = 0;
667  while (i != result.end())
668  {
670  << "scale[" << index << "]: " << (*i) << endl;
671  ++index;
672  ++i;
673  }
674  }
675 
676  return result;
677 
678 }
ossim_uint32 getNumberOfEntries() const
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
ossimRpfToc * theTableOfContents
Will own a table of contents.
bool theSkipEmptyCheck
If true during the call to open(), the RPF file is opened even if all the frame files are missing...
const ossimRpfBoundaryRectRecord & getBoundaryInformation() const
bool isOpen() const
Determines if its open if there eists a table of contents object.
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
const ossimRpfTocEntry * getTocEntry(ossim_uint32 index) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ getProductScale()

ossimString ossimCibCadrgTileSource::getProductScale ( ) const
Returns
Scale string ( like 1:24000 ) for current entry.

Definition at line 1182 of file ossimCibCadrgTileSource.cpp.

References ossimRpfTocEntry::getBoundaryInformation(), ossimRpfBoundaryRectRecord::getScale(), ossimRpfToc::getTocEntry(), theEntryNumberToRender, and theTableOfContents.

1183 {
1184  ossimString result;
1185 
1186  const ossimRpfTocEntry* entry =
1188 
1189  if (entry)
1190  {
1191  result = entry->getBoundaryInformation().getScale();
1192  }
1193 
1194  return result;
1195 }
ossimRpfToc * theTableOfContents
Will own a table of contents.
const ossimRpfBoundaryRectRecord & getBoundaryInformation() const
const ossimRpfTocEntry * getTocEntry(ossim_uint32 index) const
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.

◆ getProductScaleList()

vector< ossimString > ossimCibCadrgTileSource::getProductScaleList ( ) const

This retrieves all product scales that are within the Table of contents.

I make no assumptions that a CIB/CADRG has only one product. A product here is 1meter, 5 meter, 10 meter ... etc for CIB and 1:24000, 1:50000, ... etc for CADRG.

Returns
The prduct list as a vector of strings.

Definition at line 570 of file ossimCibCadrgTileSource.cpp.

References ossimString::begin(), ossimString::end(), ossimRpfTocEntry::getBoundaryInformation(), ossimRpfToc::getNumberOfEntries(), ossimRpfBoundaryRectRecord::getScale(), ossimRpfToc::getTocEntry(), isOpen(), ossimString::push_back(), ossimString::size(), theTableOfContents, ossimString::trim(), and ossimString::upcase().

Referenced by findFirstFrame(), and getEntryList().

571 {
572  vector<ossimString> result;
573 
574  if(isOpen())
575  {
577 
578  for(ossim_int32 index = 0; index < upperBound; ++index)
579  {
580  const ossimRpfTocEntry* entry = theTableOfContents->getTocEntry(index);
581  ossimString scale = entry->getBoundaryInformation().getScale();
582 
583  scale = scale.trim().upcase();
584  if(scale!="")
585  {
586  // CIB will have product scales like 5M or 10M
587  // and CADRG's will have product scales like
588  // 1:50K and 1:250K ...
589  // So if these patterns exist then add it to
590  // the product list.
591  if( ( std::find(scale.begin(), scale.end(), ':') != scale.end() )
592  ||
593  (scale[scale.size()-1]=='M'))
594  {
595  // only add it if it doesn't already exist
596  // on the list.
597  if(find(result.begin(), result.end(), scale) == result.end())
598  {
599  result.push_back(scale);
600  }
601  }
602  }
603  }
604  }
605 
606  if (traceDebug())
607  {
609  << "ossimCibCadrgTileSource::getProductScaleList DEBUG:"
610  << endl;
611 
612  std::vector<ossimString>::const_iterator i = result.begin();
613  ossim_uint32 index = 0;
614  while (i != result.end())
615  {
617  << "scale[" << index << "]: " << (*i) << endl;
618  ++index;
619  ++i;
620  }
621  }
622 
623  return result;
624 }
ossim_uint32 getNumberOfEntries() const
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
ossimRpfToc * theTableOfContents
Will own a table of contents.
const ossimRpfBoundaryRectRecord & getBoundaryInformation() const
std::string::iterator end()
Definition: ossimString.h:423
bool isOpen() const
Determines if its open if there eists a table of contents object.
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
std::string::size_type size() const
Definition: ossimString.h:405
std::string::iterator begin()
Definition: ossimString.h:420
unsigned int ossim_uint32
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
const ossimRpfTocEntry * getTocEntry(ossim_uint32 index) const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

◆ getProperty()

ossimRefPtr< ossimProperty > ossimCibCadrgTileSource::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 1212 of file ossimCibCadrgTileSource.cpp.

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

1213 {
1214  if(name == "file_type")
1215  {
1217  {
1218  return new ossimStringProperty("file_type", "CIB");
1219  }
1221  {
1222  return new ossimStringProperty("file_type", "CADRG");
1223  }
1224  return 0;
1225  }
1226  return ossimImageHandler::getProperty(name);
1227 }
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const

◆ getPropertyNames()

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

Gets a list of property names available.

Parameters
propertyNamesThe list to push back names to.

This code is crashing and not sure why in here. Looks like a bad GeoEye baseline merge.

Reimplemented from ossimImageHandler.

Definition at line 1229 of file ossimCibCadrgTileSource.cpp.

References ossimString::c_str(), ossimImageHandler::getPropertyNames(), ossimRpfToc::getRpfHeader(), ossimImageHandler::theImageFile, and theTableOfContents.

1230 {
1231  ossimImageHandler::getPropertyNames(propertyNames);
1232  propertyNames.push_back("file_type");
1233 
1238 #if 0
1239  const ossimRpfHeader* header =
1241  if(header)
1242  {
1243  std::ifstream in(theImageFile.c_str(), std::ios::in|std::ios::binary);
1244  }
1245 #endif
1246 }
ossimFilename theImageFile
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossimRpfToc * theTableOfContents
Will own a table of contents.
const ossimRpfHeader * getRpfHeader() const
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
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

◆ getSecurityClassification()

ossimString ossimCibCadrgTileSource::getSecurityClassification ( ) const

Definition at line 1197 of file ossimCibCadrgTileSource.cpp.

References ossimRpfToc::getRpfHeader(), ossimRpfHeader::getSecurityClassification(), and theTableOfContents.

1198 {
1199  ossimString result;
1200 
1201  const ossimRpfHeader* header =
1203 
1204  if (header)
1205  {
1206  result = header->getSecurityClassification();
1207  }
1208 
1209  return result;
1210 }
ossimRpfToc * theTableOfContents
Will own a table of contents.
const ossimRpfHeader * getRpfHeader() const
ossimString getSecurityClassification() const

◆ getShortName()

ossimString ossimCibCadrgTileSource::getShortName ( ) const
virtual

This method is defined in the base class ossimObject.

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

Returns
The short name for this class as an ossimString.

Reimplemented from ossimObject.

Definition at line 109 of file ossimCibCadrgTileSource.cpp.

110 {
111  return ossimString("CIB/CADRG");
112 }

◆ getTile() [1/2]

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

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

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

Reimplemented from ossimImageSource.

Definition at line 237 of file ossimCibCadrgTileSource.cpp.

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

239 {
240  if ( theTile.valid() == false )
241  {
242  // First time through.
244  }
245 
246  if (theTile.valid())
247  {
248  // Image rectangle must be set prior to calling getTile.
249  theTile->setImageRectangle(rect);
250 
251  if ( getTile( theTile.get(), resLevel ) == false )
252  {
254  {
255  theTile->makeBlank();
256  }
257  }
258  }
259 
260  return theTile;
261 }
virtual void setImageRectangle(const ossimIrect &rect)
void allocateForProduct()
Will allocate an internal buffer for the given product.
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
ossimRefPtr< ossimImageData > theTile
This is the actual data returned from a getTile request.
virtual void makeBlank()
Initializes data to null pixel values.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
Returns a pointer to an ossimImageDataObject given a rectangluar region of interest.

◆ getTile() [2/2]

bool ossimCibCadrgTileSource::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 263 of file ossimCibCadrgTileSource.cpp.

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

265 {
266  bool status = false;
267 
268  //---
269  // Not open, this tile source bypassed, or invalid res level,
270  // return a blank tile.
271  //---
272  if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
273  result && (result->getNumberOfBands() == getNumberOfOutputBands()) &&
275  {
276  if ( resLevel > 0 )
277  {
278  //---
279  // Check for overview tile. Some overviews can contain r0 so always
280  // call even if resLevel is 0 (if overview is not virtual). Method
281  // returns true on success, false on error.
282  //---
283  status = getOverviewTile(resLevel, result);
284  }
285 
286  if (!status) // Did not get an overview tile.
287  {
288  if ( !theCompressedBuffer )
289  {
290  // First time through.
292  }
293 
294  if ( theCompressedBuffer )
295  {
296  status = true;
297 
298  ossimIrect rect = result->getImageRectangle();
299 
300  ossimIrect imageRect = getImageRectangle();
301 
302  if ( rect.intersects(imageRect) )
303  {
304  //---
305  // Start with a blank tile in case there is not total coverage
306  // for rect.
307  //---
308  result->makeBlank();
309 
310  vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
311  if(frames.size() > 0)
312  {
313  //---
314  // Now lets render each frame. Note we will have to find
315  // subframes
316  // that intersect the rectangle of interest for each frame.
317  //---
318  fillTile(rect, frames, result);
319 
320  // Revalidate tile status.
321  result->validate();
322  }
323  }
324  else
325  {
326  result->makeBlank();
327  }
328  }
329  }
330  }
331 
332  return status;
333 }
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossim_uint32 getNumberOfOutputBands() const
This method allows one to query the number of output bands.
virtual ossim_uint32 getNumberOfBands() const
void allocateForProduct()
Will allocate an internal buffer for the given product.
void fillTile(const ossimIrect &tileRect, const vector< ossimFrameEntryData > &framesInvolved, ossimImageData *tile)
This is a wrapper for the fill cib and fill cadrg.
bool intersects(const ossimIrect &rect) const
Definition: ossimIrect.cpp:183
unsigned char * theCompressedBuffer
This is for storage of a single compressed buffer.
bool isOpen() const
Determines if its open if there eists a table of contents object.
virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData *result)
Method to get an overview tile.
virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level=0) const
virtual ossimDataObjectStatus validate() const
vector< ossimFrameEntryData > getIntersectingEntries(const ossimIrect &rect)
It is important to note that each frame is organized into an easting northing type orientation...
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
virtual ossimIrect getImageRectangle() const
return status
virtual void makeBlank()
Initializes data to null pixel values.
bool isValidRLevel(ossim_uint32 reduced_res_level) const

◆ getTileHeight()

ossim_uint32 ossimCibCadrgTileSource::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 442 of file ossimCibCadrgTileSource.cpp.

References getImageTileHeight().

443 {
444  return getImageTileHeight();
445 }
virtual ossim_uint32 getImageTileHeight() const
Returns the tile width of the image or 0 if the image is not tiled.

◆ getTileWidth()

ossim_uint32 ossimCibCadrgTileSource::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 437 of file ossimCibCadrgTileSource.cpp.

References getImageTileWidth().

438 {
439  return getImageTileWidth();
440 }
virtual ossim_uint32 getImageTileWidth() const
Returns the tile width of the image or 0 if the image is not tiled.

◆ getToc()

const ossimRpfToc * ossimCibCadrgTileSource::getToc ( ) const
virtual
Returns
The table of contents object.

Definition at line 549 of file ossimCibCadrgTileSource.cpp.

References theTableOfContents.

550 {
551  return theTableOfContents;
552 }
ossimRpfToc * theTableOfContents
Will own a table of contents.

◆ isCadrg()

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

Definition at line 1177 of file ossimCibCadrgTileSource.cpp.

References OSSIM_PRODUCT_TYPE_CADRG, and theProductType.

1178 {
1180 }
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.

◆ isCib()

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

Definition at line 1172 of file ossimCibCadrgTileSource.cpp.

References OSSIM_PRODUCT_TYPE_CIB, and theProductType.

1173 {
1175 }
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.

◆ isOpen()

bool ossimCibCadrgTileSource::isOpen ( ) const
virtual

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

Returns
True if the handler is open and flase otherwise.

Implements ossimImageHandler.

Definition at line 126 of file ossimCibCadrgTileSource.cpp.

References theTableOfContents.

Referenced by getIntersectingEntries(), getProductEntryList(), getProductScaleList(), getTile(), setEntryToRender(), and setTocEntryToRender().

127 {
128  return (theTableOfContents!=0);
129 }
ossimRpfToc * theTableOfContents
Will own a table of contents.

◆ isValidRLevel()

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

Reimplemented from ossimImageHandler.

Definition at line 554 of file ossimCibCadrgTileSource.cpp.

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

Referenced by getTile().

555 {
556  if (reduced_res_level == 0)
557  {
558  return true;
559  }
560  else if (theOverview.valid())
561  {
562  return theOverview->isValidRLevel(reduced_res_level);
563  }
564  else
565  {
566  return false;
567  }
568 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool isValidRLevel(ossim_uint32 resLevel) const
Determines if the passed in reslution level is valid.
ossimRefPtr< ossimImageHandler > theOverview

◆ loadState()

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

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

Loading with a prefix.

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

Loading without a prefix.

cibCadrgHandler->laodState(kwl);

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

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

Reimplemented from ossimImageHandler.

Definition at line 1121 of file ossimCibCadrgTileSource.cpp.

1123 {
1124  const char* MODULE = "ossimCibCadrgTileSource::loadState";
1125 
1126  if(traceDebug())
1127  {
1128  CLOG << "Entering..." << endl;
1129  }
1130  bool result = ossimImageHandler::loadState(kwl, prefix);
1131 
1132  if(!result)
1133  {
1134  if(traceDebug())
1135  {
1136  CLOG << "Leaving..." << endl;
1137  }
1138  return false;
1139  }
1140  const char* lookup = 0;
1141  lookup = kwl.find(ossimString(prefix), "entry");
1142  ossim_int32 entry = ossimString(lookup).toInt32();
1143 
1144  // if an entry is specified then
1145  // call the open with an entry number
1146  if(lookup)
1147  {
1148  if(traceDebug())
1149  {
1150  CLOG << "Leaving..." << endl;
1151  }
1153  setCurrentEntry(entry);
1154  return result;
1155  }
1156 
1158 
1159  return result;
1160 }
virtual bool open()=0
Pure virtual open.
#define CLOG
Definition: ossimTrace.h:23
ossimFilename theImageFile
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossim_int32 toInt32() const
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
int ossim_int32

◆ open()

bool ossimCibCadrgTileSource::open ( )
virtual

Pure virtual open.

Derived classes must implement.

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

Implements ossimImageHandler.

Definition at line 131 of file ossimCibCadrgTileSource.cpp.

132 {
133  if(traceDebug())
134  {
136  << "ossimCibCadrgTileSource::open(): Entered....."
137  << "\ntheImageFile: " << theImageFile << std::endl;
138  }
139 
140  bool result = false;
141 
142  if(isOpen())
143  {
144  close();
145  }
146 
148 
150  {
152  {
154  {
155  vector<ossimString> scaleList = getProductScaleList();
156  if(scaleList.size() > 0)
157  {
158  std::vector<ossim_uint32> entryList;
159  getEntryList(entryList);
160  if(entryList.size() > 0)
161  {
162  setCurrentEntry(entryList[0]);
163 
164  if(theEntryToRender)
165  {
166  // a CADRG is 1536x1536 per frame.
169  }
170 
171  if(theEntryToRender->getProductType().trim().upcase() == "CADRG")
172  {
174  result = true;
175  }
176  else if(theEntryToRender->getProductType().trim().upcase() == "CIB")
177  {
179  result = true;
180  }
181 
182  // Moved this code to be called on first get tile. drb
183  // if ( result )
184  // {
185  // This initializes tiles and buffers.
186  // allocateForProduct();
187  // }
188  }
189  }
190  }
191  }
192  }
193 
194  if(!result)
195  {
197  close();
198  }
199 
200 #if 0 /* 20100414 - drb */
201  else
202  {
203  //---
204  // Adjust image rect so not to go over the -180 to 180 and -90 to 90
205  // bounds.
206  //---
207  // Note this did not do any boundary checking and was in conflict with setTocEntryToRender
208  // method calculation of lines and samps.
209  // setActualImageRect();
210 
211  std::ifstream in(theImageFile.c_str(), std::ios::in|std::ios::binary);
212  if(in.good()&&theTableOfContents->getRpfHeader())
213  {
214  }
215  completeOpen();
216 
218  theTile->initialize();
219  }
220 #endif
221 
222  if(traceDebug())
223  {
225  << "ossimCibCadrgTileSource::open(): Leaving at line " << __LINE__
226  << " result=" << (result?"true":"false") << std::endl;
227  }
228 
229  return result;
230 }
void clear()
Erases the entire container.
Definition: ossimString.h:432
ossim_uint32 getNumberOfEntries() const
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
ossim_uint32 theNumberOfLines
This will be computed based on the frames organized within the directory.
ossimFilename theImageFile
vector< ossimString > getProductScaleList() const
This retrieves all product scales that are within the Table of contents.
static const ossimErrorCode OSSIM_OK
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
ossimRpfToc * theTableOfContents
Will own a table of contents.
ossimString getProductType() const
ossim_uint32 getNumberOfSamples() const
const ossimRpfHeader * getRpfHeader() const
virtual void getEntryList(std::vector< ossim_uint32 > &entryList) const
virtual void initialize()
Initialize the data buffer.
virtual bool setCurrentEntry(ossim_uint32 entryIdx)
bool isOpen() const
Determines if its open if there eists a table of contents object.
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
static ossimImageDataFactory * instance()
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
ossimErrorCode parseFile(const ossimFilename &fileName, bool keepFileHeader=false)
Parses a.toc file.
Definition: ossimRpfToc.cpp:55
ossimRefPtr< ossimImageData > theTile
This is the actual data returned from a getTile request.
virtual void close()
Closes this image handler and deletes any allocated data.
virtual void completeOpen()
Will complete the opening process.
ossim_uint32 getNumberOfLines() const
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
ossim_uint32 theNumberOfSamples
This will be computed based on the frames organized within the directory.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ populateLut()

void ossimCibCadrgTileSource::populateLut ( )
protected

Definition at line 1248 of file ossimCibCadrgTileSource.cpp.

References ossimFilename::exists(), ossimRpfFrame::getColorGrayscaleTable(), ossimRpfTocEntry::getEntry(), ossimRpfFrameEntry::getFullPath(), ossimRpfTocEntry::getNumberOfFramesHorizontal(), ossimRpfTocEntry::getNumberOfFramesVertical(), ossimErrorCodes::OSSIM_OK, OSSIM_PRODUCT_TYPE_CADRG, OSSIM_PRODUCT_TYPE_CIB, OSSIM_UINT8, ossimRpfFrame::parseFile(), theEntryToRender, ossimImageHandler::theLut, and theProductType.

Referenced by setEntryToRender().

1249 {
1250  theLut = 0;
1251  if(theEntryToRender)
1252  {
1255  ossim_uint32 wi, hi;
1256  bool found = false;
1257  ossimRpfFrameEntry tempEntry;
1258  ossimRpfFrame aFrame;
1259  for(wi = 0; ((wi < w)&&(!found)); ++wi)
1260  {
1261  for(hi = 0; ((hi < h)&&(!found)); ++hi)
1262  {
1264  wi,
1265  tempEntry);
1266  if(tempEntry.getFullPath().exists())
1267  {
1268  found = true;
1269  }
1270  }
1271  }
1272  if(aFrame.parseFile(tempEntry.getFullPath())
1274  {
1275  const vector<ossimRpfColorGrayscaleTable>& colorTable =
1276  aFrame.getColorGrayscaleTable();
1277 
1278  // ESH 03/2009 -- Partial fix for ticket #646.
1279  // Crash fix on reading RPFs: Make sure the colorTable vector
1280  // has entries before trying to make use of them.
1281  int numTables = (int)colorTable.size();
1282 
1283  ossim_uint32 numElements = (numTables > 0) ? colorTable[0].getNumberOfElements() : 0;
1284  if(numElements > 0)
1285  {
1288  {
1289  theLut = new ossimNBandLutDataObject(numElements,
1290  3,
1291  OSSIM_UINT8);
1292  }
1293  else
1294  {
1295  theLut = 0;
1296  return;
1297  }
1298  ossim_uint32 idx = 0;
1299 
1300  for(idx = 0; idx < numElements;++idx)
1301  {
1302  const ossim_uint8* startOfData = colorTable[0].getStartOfData(idx);
1303  switch(theProductType)
1304  {
1306  {
1307  (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1308  (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1309  (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1310  break;
1311  }
1313  {
1314  (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
1315  (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[1]);
1316  (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[2]);
1317  break;
1318  }
1319  default:
1320  {
1321  break;
1322  }
1323  }
1324  }
1325  }
1326  }
1327  }
1328 }
static const ossimErrorCode OSSIM_OK
ossim_uint32 getNumberOfFramesVertical() const
const vector< ossimRpfColorGrayscaleTable > & getColorGrayscaleTable() const
Definition: ossimRpfFrame.h:80
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
bool exists() const
unsigned int ossim_uint32
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
ossim_uint32 getNumberOfFramesHorizontal() const
ossimErrorCode parseFile(const ossimFilename &filename, bool minimalParse=false)
class ossimNBandLutDataObject
ossimRefPtr< ossimNBandLutDataObject > theLut
8 bit unsigned integer
bool getEntry(long row, long col, ossimRpfFrameEntry &result) const
const ossimFilename & getFullPath() const
unsigned char ossim_uint8

◆ saveState()

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

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

Saving data without a prefix.

cibCadrgHandler->open(filename);
cibCadrgHandler->saveState(kwl);

and saving data with a prefix.

cibCadrgHandler->open(filename);
cibCadrgHandler->saveState(kwl, "handler1.");

Saving with a prefix will help uniquely identify objects in the kwl. To see what is in the keywordlist after a save state then do:

cout << kwl << endl;

There is only 1 keyword for this object:

entry: <entry number>="">

where <entry number>=""> is the index value for the current entry.

See also
ossimImageHandler for additional keywords.
Parameters
kwlKeywordlist to save the state of the object to.
prefixprefix to prepend to the keywords. This will help uniquely identify each keyword if multiple objects are saved to the same list.
Returns
True if successfully saved the state of the object and false otherwise.

Reimplemented from ossimImageHandler.

Definition at line 1108 of file ossimCibCadrgTileSource.cpp.

References ossimKeywordlist::add(), ossimImageHandler::saveState(), and theEntryNumberToRender.

1110 {
1111  bool result = ossimImageHandler::saveState(kwl, prefix);
1112 
1113  kwl.add(prefix,
1114  "entry",
1116  true);
1117 
1118  return result;
1119 }
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setCurrentEntry()

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

Reimplemented from ossimImageHandler.

Definition at line 452 of file ossimCibCadrgTileSource.cpp.

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

453 {
454  bool result = false;
455 
456  theDecimationFactors.clear();
457 
458  // Clear the geometry.
459  theGeometry = 0;
460 
461  // Must clear or openOverview will use last entries.
463 
464  if(setEntryToRender(entryIdx))
465  {
466  completeOpen();
467  result = true;
468  }
469 
470  return result;
471 }
void clear()
Erases the entire container.
Definition: ossimString.h:432
ossimRefPtr< ossimImageGeometry > theGeometry
std::vector< ossimDpt > theDecimationFactors
virtual bool setEntryToRender(ossim_uint32 index)
Sets the entry to render.
virtual void completeOpen()
Will complete the opening process.
ossimFilename theOverviewFile

◆ setEntryToRender()

bool ossimCibCadrgTileSource::setEntryToRender ( ossim_uint32  index)
protectedvirtual

Sets the entry to render.

Definition at line 490 of file ossimCibCadrgTileSource.cpp.

References ossimRpfTocEntry::getBoundaryInformation(), ossimRpfBoundaryRectRecord::getCoverage(), ossimRpfTocEntry::getProductType(), ossimRpfToc::getTocEntry(), ossimRpfCoverageSection::isGeographicRectNull(), isOpen(), OSSIM_PRODUCT_TYPE_CADRG, OSSIM_PRODUCT_TYPE_CIB, OSSIM_PRODUCT_TYPE_UNKNOWN, populateLut(), setTocEntryToRender(), theEntryNumberToRender, theEntryToRender, theProductType, theTableOfContents, ossimString::trim(), and ossimString::upcase().

Referenced by setCurrentEntry().

491 {
492  if(isOpen())
493  {
494  const ossimRpfTocEntry *temp = theTableOfContents->getTocEntry(index);
495 
496  if(temp)
497  {
499  {
500  setTocEntryToRender(temp);
501  theEntryNumberToRender = index;
502  if(theEntryToRender)
503  {
504  if(theEntryToRender->getProductType().trim().upcase() == "CADRG")
505  {
507  }
508  else if(theEntryToRender->getProductType().trim().upcase() == "CIB")
509  {
511  }
512  else
513  {
515  }
516  }
517 
518  populateLut();
519 
520  return true;
521  }
522  }
523  }
524 
525  return false;
526 }
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
ossimRpfToc * theTableOfContents
Will own a table of contents.
ossimString getProductType() const
virtual void setTocEntryToRender(const ossimRpfTocEntry *entry)
Sets the entry to be renderer.
const ossimRpfCoverageSection & getCoverage() const
const ossimRpfBoundaryRectRecord & getBoundaryInformation() const
bool isOpen() const
Determines if its open if there eists a table of contents object.
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossimCibCadrgProductType theProductType
Holds the enumeration specifying the product type.
const ossimRpfTocEntry * getTocEntry(ossim_uint32 index) const
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.

◆ setSkipEmptyCheck()

void ossimCibCadrgTileSource::setSkipEmptyCheck ( bool  bSkipEmptyCheck = false)

Changes the way the open() routine functions slightly.

Parameters
bSkipEmptyCheckIf true, the RPF file is opened even if all the frame files are missing. By default this is set to false.

Definition at line 232 of file ossimCibCadrgTileSource.cpp.

References theSkipEmptyCheck.

233 {
234  theSkipEmptyCheck = bSkipEmptyCheck;
235 }
bool theSkipEmptyCheck
If true during the call to open(), the RPF file is opened even if all the frame files are missing...

◆ setTocEntryToRender()

void ossimCibCadrgTileSource::setTocEntryToRender ( const ossimRpfTocEntry entry)
protectedvirtual

Sets the entry to be renderer.

The entry within the table of contents are stored in an Toc entry object.

Parameters
entrythe Rpf toc entry object to set to.

Definition at line 528 of file ossimCibCadrgTileSource.cpp.

References ossimRpfTocEntry::getNumberOfLines(), ossimRpfTocEntry::getNumberOfSamples(), ossimRpfToc::getTocEntryIndex(), isOpen(), theEntryNumberToRender, theEntryToRender, theNumberOfLines, theNumberOfSamples, and theTableOfContents.

Referenced by setEntryToRender().

529 {
530  if(isOpen()&&entry)
531  {
532  theEntryToRender = entry;
536  }
537 }
ossim_uint32 theNumberOfLines
This will be computed based on the frames organized within the directory.
ossimRpfToc * theTableOfContents
Will own a table of contents.
ossim_uint32 getNumberOfSamples() const
bool isOpen() const
Determines if its open if there eists a table of contents object.
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
ossim_int32 theEntryNumberToRender
This will be the entry number that we are currently rendering.
ossim_uint32 getNumberOfLines() const
ossim_uint32 theNumberOfSamples
This will be computed based on the frames organized within the directory.
ossim_int32 getTocEntryIndex(const ossimRpfTocEntry *entry)
Returns -1 if not found.

◆ updatePropertiesToFirstValidFrame()

void ossimCibCadrgTileSource::updatePropertiesToFirstValidFrame ( )
protected

Definition at line 1330 of file ossimCibCadrgTileSource.cpp.

References ossimFilename::exists(), ossimRpfTocEntry::getEntry(), ossimRpfFrameEntry::getFullPath(), ossimRpfTocEntry::getNumberOfFramesHorizontal(), ossimRpfTocEntry::getNumberOfFramesVertical(), ossimErrorCodes::OSSIM_OK, ossimRpfFrame::parseFile(), and theEntryToRender.

1331 {
1332  if(theEntryToRender)
1333  {
1336  ossim_uint32 wi, hi;
1337  bool found = false;
1338  ossimRpfFrameEntry tempEntry;
1339  ossimRpfFrame aFrame;
1340  for(wi = 0; ((wi < w)&&(!found)); ++wi)
1341  {
1342  for(hi = 0; ((hi < h)&&(!found)); ++hi)
1343  {
1345  wi,
1346  tempEntry);
1347  if(tempEntry.getFullPath().exists())
1348  {
1349  found = true;
1350  }
1351  }
1352  }
1353  if(found)
1354  {
1355  if(aFrame.parseFile(tempEntry.getFullPath()) == ossimErrorCodes::OSSIM_OK)
1356  {
1357 
1358  }
1359  }
1360  }
1361 }
static const ossimErrorCode OSSIM_OK
ossim_uint32 getNumberOfFramesVertical() const
const ossimRpfTocEntry * theEntryToRender
This is the actual frame file to render.
bool exists() const
unsigned int ossim_uint32
ossim_uint32 getNumberOfFramesHorizontal() const
ossimErrorCode parseFile(const ossimFilename &filename, bool minimalParse=false)
bool getEntry(long row, long col, ossimRpfFrameEntry &result) const
const ossimFilename & getFullPath() const

Friends And Related Function Documentation

◆ ossimMultiEntryCibCadrg

friend class ossimMultiEntryCibCadrg
friend

Definition at line 38 of file ossimCibCadrgTileSource.h.

Member Data Documentation

◆ CIBCADRG_FRAME_HEIGHT

const ossim_uint32 ossimCibCadrgTileSource::CIBCADRG_FRAME_HEIGHT = 1536
static

CONSTANT representing the height of a Frame.

This should be 1536.

Definition at line 393 of file ossimCibCadrgTileSource.h.

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

◆ CIBCADRG_FRAME_WIDTH

const ossim_uint32 ossimCibCadrgTileSource::CIBCADRG_FRAME_WIDTH = 1536
static

CONSTANT representing the width of a Frame.

This should be 1536.

Definition at line 388 of file ossimCibCadrgTileSource.h.

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

◆ theCompressedBuffer

unsigned char* ossimCibCadrgTileSource::theCompressedBuffer
protected

This is for storage of a single compressed buffer.

Definition at line 536 of file ossimCibCadrgTileSource.h.

Referenced by allocateForProduct(), fillSubTileCadrg(), fillSubTileCib(), getTile(), and ~ossimCibCadrgTileSource().

◆ theEntryNumberToRender

ossim_int32 ossimCibCadrgTileSource::theEntryNumberToRender
protected

This will be the entry number that we are currently rendering.

This will mainly be used when using overviews.

Definition at line 580 of file ossimCibCadrgTileSource.h.

Referenced by findFirstFrame(), getCurrentEntry(), getCurrentEntryIndex(), getProductScale(), saveState(), setEntryToRender(), and setTocEntryToRender().

◆ theEntryToRender

const ossimRpfTocEntry* ossimCibCadrgTileSource::theEntryToRender
protected

This is the actual frame file to render.

This should be divided into frames where each frame is 1536x1536 in size.

Definition at line 573 of file ossimCibCadrgTileSource.h.

Referenced by getCurrentTocEntry(), getImageGeometry(), getIntersectingEntries(), populateLut(), setEntryToRender(), setTocEntryToRender(), and updatePropertiesToFirstValidFrame().

◆ theNumberOfLines

ossim_uint32 ossimCibCadrgTileSource::theNumberOfLines
protected

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

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

Definition at line 548 of file ossimCibCadrgTileSource.h.

Referenced by getNumberOfLines(), and setTocEntryToRender().

◆ theNumberOfSamples

ossim_uint32 ossimCibCadrgTileSource::theNumberOfSamples
protected

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

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

Definition at line 555 of file ossimCibCadrgTileSource.h.

Referenced by getNumberOfSamples(), and setTocEntryToRender().

◆ theProductType

ossimCibCadrgProductType ossimCibCadrgTileSource::theProductType
protected

Holds the enumeration specifying the product type.

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

Definition at line 586 of file ossimCibCadrgTileSource.h.

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

◆ theSkipEmptyCheck

bool ossimCibCadrgTileSource::theSkipEmptyCheck
protected

If true during the call to open(), the RPF file is opened even if all the frame files are missing.

By default this is set to false.

Definition at line 594 of file ossimCibCadrgTileSource.h.

Referenced by getProductEntryList(), and setSkipEmptyCheck().

◆ theTableOfContents

ossimRpfToc* ossimCibCadrgTileSource::theTableOfContents
protected

Will own a table of contents.

This describes all entries within the CIB/CADRG.

Definition at line 566 of file ossimCibCadrgTileSource.h.

Referenced by deleteAll(), findFirstFrame(), getProductEntryList(), getProductScale(), getProductScaleList(), getPropertyNames(), getSecurityClassification(), getToc(), isOpen(), setEntryToRender(), and setTocEntryToRender().

◆ theTile

ossimRefPtr<ossimImageData> ossimCibCadrgTileSource::theTile
protected

This is the actual data returned from a getTile request.

Definition at line 560 of file ossimCibCadrgTileSource.h.

Referenced by allocateForProduct(), and getTile().

◆ theUncompressedBuffer

unsigned char* ossimCibCadrgTileSource::theUncompressedBuffer
protected

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

Definition at line 541 of file ossimCibCadrgTileSource.h.

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

◆ theWorkFrame

ossimRpfFrame* ossimCibCadrgTileSource::theWorkFrame
mutableprotected

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