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

#include <ossimCcfTileSource.h>

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

Public Member Functions

 ossimCcfTileSource ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual bool open ()
 
virtual void close ()
 Deletes the overview and clears the valid image vertices. More...
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIrect &rect, ossim_uint32 resLevel=0)
 
virtual bool getTile (ossimImageData *result, ossim_uint32 resLevel=0)
 Method to get a tile. More...
 
virtual ossim_uint32 getNumberOfInputBands () const
 Returns the number of bands in the image. More...
 
virtual ossim_uint32 getNumberOfOutputBands () const
 Returns the number of bands in a tile returned from this TileSource. More...
 
virtual ossim_uint32 getNumberOfLines (ossim_uint32 reduced_res_level=0) const
 Returns the number of lines in the image. More...
 
virtual ossim_uint32 getNumberOfSamples (ossim_uint32 reduced_res_level=0) const
 Returns the number of samples in the image. More...
 
virtual ossim_uint32 getNumberOfDecimationLevels () const
 Returns the number of reduced resolution data sets (rrds). More...
 
virtual ossimIrect getImageRectangle (ossim_uint32 reduced_res_level=0) const
 Returns the zero based image rectangle for the reduced resolution data set (rrds) passed in. More...
 
bool setOutputBandList (const vector< ossim_uint32 > &outputBandList)
 Set the output band list. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual ossimScalarType getOutputScalarType () const
 Returns the output pixel type of the tile source. More...
 
virtual ossim_uint32 getTileWidth () const
 Returns the width of the output tile. More...
 
virtual ossim_uint32 getTileHeight () const
 Returns the height of the output tile. More...
 
virtual ossim_uint32 getImageTileWidth () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual ossim_uint32 getImageTileHeight () const
 Returns the tile width of the image or 0 if the image is not tiled. More...
 
virtual bool isOpen () const
 Derived classes must implement this method to be concrete. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 Gets a property for matching name. More...
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 Gets a list of property names available. More...
 
- Public Member Functions inherited from ossimImageHandler
 ossimImageHandler ()
 Constructor (default): More...
 
virtual ~ossimImageHandler ()
 Destructor: Derived classes should implement. More...
 
virtual void initialize ()
 initialize Does nothing in this class. More...
 
virtual bool openOverview ()
 Searches for an overview. More...
 
virtual bool openOverview (const ossimFilename &overview_file)
 Calls closeOverview(), then attempts to open the overview_file. More...
 
virtual void closeOverview ()
 If theOverview is initialized it will be deleted and set to NULL. More...
 
virtual const ossimImageHandlergetOverview () const
 
virtual bool hasOverviews () const
 
virtual ossimFilename createDefaultOverviewFilename () const
 
virtual ossimFilename createDefaultGeometryFilename () const
 
virtual ossimFilename createDefaultMetadataFilename () const
 
virtual ossimFilename createDefaultHistogramFilename () const
 
virtual ossimFilename createDefaultValidVerticesFilename () const
 
virtual bool writeValidImageVertices (const std::vector< ossimIpt > &vertices, const ossimFilename &file=ossimFilename(""))
 Outputs vertices to file and updates the internal vertex array variable "theValidImageVertices". More...
 
virtual bool openValidVertices (const ossimFilename &vertices_file)
 Opens the valid image vertices file and sets theValidImageVerticesFile variable. More...
 
virtual bool openValidVertices ()
 Creates vertices file name based on image, then tries to open. More...
 
virtual bool open (const ossimFilename &imageFile, ossim_uint32 entryIndex)
 Opens the image file. More...
 
virtual bool open (const ossimFilename &imageFile)
 
virtual bool open (std::shared_ptr< ossim::ImageHandlerState > state)
 
virtual bool buildHistogram (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histogram for image file. More...
 
virtual bool buildAllHistograms (int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL)
 Build a histograms for all image entries. More...
 
virtual bool buildOverview (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for theImageFile. More...
 
virtual bool buildAllOverviews (ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build over file for all image entries. More...
 
virtual bool buildOverview (const ossimFilename &filename, ossimImageHandlerOverviewCompressionType compressionType=OSSIM_OVERVIEW_COMPRESSION_NONE, ossim_uint32 quality=75, ossimFilterResampler::ossimFilterResamplerType resampleType=ossimFilterResampler::ossimFilterResampler_BOX, bool includeFullResFlag=false)
 Will build an over file for filename. More...
 
ossimRefPtr< ossimMultiResLevelHistogramgetImageHistogram () const
 Fetches the current entry image's histogram. More...
 
virtual ossimRefPtr< ossimImageGeometrygetImageGeometry ()
 Returns the image geometry object associated with this tile source or NULL if non defined. 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 getNumberOfReducedResSets () const
 This method is obsolete. More...
 
virtual void setFilename (const ossimFilename &filename)
 Sets the filename. More...
 
virtual const ossimFilenamegetFilename () const
 Returns the filename. More...
 
virtual bool isValidRLevel (ossim_uint32 resLevel) const
 Determines if the passed in reslution level is valid. More...
 
bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 Connection rule. More...
 
virtual void getValidImageVertices (vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual bool isBandSelector () const
 Indicates whether or not the image handler can control output band selection via the setOutputBandList method. More...
 
virtual bool setOutputBandList (const std::vector< ossim_uint32 > &band_list)
 If the image handler "isBandSeletor()" then the band selection of the output chip can be controlled. More...
 
virtual bool setOutputToInputBandList ()
 If the image handler "isBandSeletor()" then the band selection of the output are set to input or identity. More...
 
virtual bool isIdentityBandList (const std::vector< ossim_uint32 > &bandList) const
 Convenience method to see if band list is identity. More...
 
virtual bool isImageTiled () const
 Indicates whether or not the image is tiled internally. More...
 
virtual bool hasMetaData () const
 
virtual ossimRefPtr< ossimNBandLutDataObjectgetLut () const
 
virtual bool hasLut () const
 
virtual void loadMetaData ()
 There is an external file with an omd extension. More...
 
virtual double getMinPixelValue (ossim_uint32 band=0) const
 Retuns the min pixel value. More...
 
virtual double getMaxPixelValue (ossim_uint32 band=0) const
 Returns the max pixel of the band. More...
 
virtual double getNullPixelValue (ossim_uint32 band=0) const
 Each band has a null pixel associated with it. More...
 
virtual void setMinPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set min pixel value. More...
 
virtual void setMaxPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set max pixel value. More...
 
virtual void setNullPixelValue (ossim_uint32 band, const ossim_float64 &pix)
 convenience method to set null pixel value. More...
 
virtual ossim_uint32 getCurrentEntry () const
 
virtual ossim_uint32 getNumberOfEntries () const
 
virtual void getEntryName (ossim_uint32 entryIdx, std::string &name) const
 Get the name of entry as a string. More...
 
virtual void getEntryList (std::vector< ossim_uint32 > &entryList) const
 
virtual void getEntryNames (std::vector< ossimString > &entryNames) const
 
bool useEntryIndex () const
 Convenience method to determine if entry index should be used for support files, e.g. More...
 
ossimFilename getOverviewFile () const
 
virtual bool setCurrentEntry (ossim_uint32 entryIdx)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
ossimFilename getFilenameWithThisExtension (const ossimString &ext, bool set_e0_prefix=false) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
void getFilenameWithThisExt (const ossimString &ext, ossimFilename &f) const
 Returns the image file with extension set using supplentary directory for dirname if set. More...
 
ossim_uint32 getStartingResLevel () const
 
void setStartingResLevel (ossim_uint32 level)
 
bool getOpenOverviewFlag () const
 
void setOpenOverviewFlag (bool flag)
 Sets theOpenOverviewFlag. More...
 
virtual void setSupplementaryDirectory (const ossimFilename &dir)
 Sets the supplementary directory. More...
 
virtual const ossimFilenamegetSupplementaryDirectory () const
 Returns the supplementary directory. More...
 
const ossimStringgetImageID () const
 Fetches the image ID. More...
 
void setImageID (const ossimString &id)
 Sets the image ID in case it is externally generated. More...
 
ossimPixelType getPixelType () const
 Returns the raster pixel alignment type. More...
 
virtual bool getRgbBandList (std::vector< ossim_uint32 > &bandList) const
 Convenience method to get the zero based rgb output band list. More...
 
template<class T >
std::shared_ptr< T > getStateAs ()
 
template<class T >
std::shared_ptr< const T > getStateAs () const
 
std::shared_ptr< ossim::ImageHandlerState > getState ()
 
std::shared_ptr< const ossim::ImageHandlerState > getState () const
 
void setState (std::shared_ptr< ossim::ImageHandlerState > state)
 
- Public Member Functions inherited from ossimImageSource
 ossimImageSource (ossimObject *owner=0)
 
 ossimImageSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimImageSource ()
 
virtual ossimRefPtr< ossimImageDatagetTile (const ossimIpt &origin, ossim_uint32 resLevel=0)
 
virtual ossimObjectgetObject ()
 For RTTI support. More...
 
virtual const ossimObjectgetObject () const
 For RTTI support. More...
 
virtual void getDecimationFactors (std::vector< ossimDpt > &decimations) const
 Will return an array of all decimations for each resolution level. More...
 
virtual void getOutputBandList (std::vector< ossim_uint32 > &bandList) const
 Initializes bandList. More...
 
virtual void getBoundingRect (ossimIrect &rect, ossim_uint32 resLevel=0) const
 Gets the bounding rectangle of the source. More...
 
virtual void getValidImageVertices (std::vector< ossimIpt > &validVertices, ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER, ossim_uint32 resLevel=0) const
 ordering specifies how the vertices should be arranged. More...
 
virtual void setImageGeometry (const ossimImageGeometry *geom)
 Default implementation sets geometry of the first input to the geometry specified. More...
 
virtual bool isIndexedData () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

virtual ~ossimCcfTileSource ()
 
void initVerticesFromHeader ()
 
 ossimCcfTileSource (const ossimCcfTileSource &source)
 
ossimCcfTileSourceoperator= (const ossimCcfTileSource &source)
 
bool fillBuffer (const ossimIrect &tile_rect, const ossimIrect &clip_rect, const ossimIrect &image_rect, ossim_uint32 reduced_res_level, ossimImageData *tile)
 Returns true on success, false on error. More...
 
bool fillUshortBuffer (const ossimIrect &tile_rect, const ossimIrect &clip_rect, const ossimIrect &image_rect, ossim_uint32 reduced_res_level, ossimImageData *tile)
 Returns true on success, false on error. More...
 
bool fillUcharBuffer (const ossimIrect &tile_rect, const ossimIrect &clip_rect, const ossimIrect &image_rect, ossim_uint32 reduced_res_level, ossimImageData *tile)
 Returns true on success, false on error. More...
 
void adjustToStartOfChunk (ossimIpt &pt) const
 Adjust point to even 256 boundary. More...
 
void adjustToStartOfChip (ossimIpt &pt) const
 Adjust point to even 32 boundary. More...
 
bool isEcgGeom (const ossimFilename &filename) const
 
- 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

ossimCcfHead theCcfHead
 
ossimRefPtr< ossimImageDatatheTile
 
ossim_uint8theChipBuffer
 
ifstream * theFileStr
 
vector< ossim_uint32theOutputBandList
 
ossim_int32 theByteOrder
 
- Protected Attributes inherited from ossimImageHandler
ossimFilename theImageFile
 
ossimFilename theOverviewFile
 
ossimFilename theSupplementaryDirectory
 
ossimRefPtr< ossimImageHandlertheOverview
 
vector< ossimIpttheValidImageVertices
 
ossimImageMetaData theMetaData
 
ossimRefPtr< ossimImageGeometrytheGeometry
 
ossimRefPtr< ossimNBandLutDataObjecttheLut
 
std::vector< ossimDpttheDecimationFactors
 
ossimString theImageID
 
ossim_uint32 theStartingResLevel
 theStartingResLevel If set to something other than zero(default) this is indicative that the reader is an overview. More...
 
bool theOpenOverviewFlag
 If true opening of overviews will be attempted. More...
 
ossimPixelType thePixelType
 
std::shared_ptr< ossim::ImageHandlerState > m_state
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Additional Inherited Members

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

Detailed Description

Definition at line 32 of file ossimCcfTileSource.h.

Constructor & Destructor Documentation

◆ ossimCcfTileSource() [1/2]

ossimCcfTileSource::ossimCcfTileSource ( )

Definition at line 46 of file ossimCcfTileSource.cpp.

47  :
49  theCcfHead(),
50  theTile(NULL),
51  theChipBuffer(NULL),
52  theFileStr(NULL),
55 {}
vector< ossim_uint32 > theOutputBandList
OSSIM_DLL ossimByteOrder byteOrder()
Definition: ossimCommon.cpp:54
ossimRefPtr< ossimImageData > theTile
ossim_uint8 * theChipBuffer
ossimImageHandler()
Constructor (default):

◆ ~ossimCcfTileSource()

ossimCcfTileSource::~ossimCcfTileSource ( )
protectedvirtual

Definition at line 57 of file ossimCcfTileSource.cpp.

References close().

58 {
59  close();
60 }
virtual void close()
Deletes the overview and clears the valid image vertices.

◆ ossimCcfTileSource() [2/2]

ossimCcfTileSource::ossimCcfTileSource ( const ossimCcfTileSource source)
protected

Member Function Documentation

◆ adjustToStartOfChip()

void ossimCcfTileSource::adjustToStartOfChip ( ossimIpt pt) const
protected

Adjust point to even 32 boundary.

Assumes 0,0 origin.

Definition at line 901 of file ossimCcfTileSource.cpp.

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

902 {
903  pt.x &= 0xffffffe0;
904  pt.y &= 0xffffffe0;
905 }
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ adjustToStartOfChunk()

void ossimCcfTileSource::adjustToStartOfChunk ( ossimIpt pt) const
protected

Adjust point to even 256 boundary.

Assumes 0,0 origin.

Definition at line 895 of file ossimCcfTileSource.cpp.

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

Referenced by fillUcharBuffer(), and fillUshortBuffer().

896 {
897  pt.x &= 0xffffff00;
898  pt.y &= 0xffffff00;
899 }
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141

◆ close()

void ossimCcfTileSource::close ( )
virtual

Deletes the overview and clears the valid image vertices.

Derived classes should implement.

Reimplemented from ossimImageHandler.

Definition at line 739 of file ossimCcfTileSource.cpp.

References theChipBuffer, theFileStr, and theTile.

Referenced by ~ossimCcfTileSource().

740 {
741  theTile = NULL;
742  if (theChipBuffer)
743  {
744  delete [] theChipBuffer;
745  theChipBuffer = NULL;
746  }
747  if(theFileStr)
748  {
749  theFileStr->close();
750  theFileStr->clear();
751  delete theFileStr;
752  theFileStr = NULL;
753  }
754 }
ossimRefPtr< ossimImageData > theTile
ossim_uint8 * theChipBuffer

◆ fillBuffer()

bool ossimCcfTileSource::fillBuffer ( const ossimIrect tile_rect,
const ossimIrect clip_rect,
const ossimIrect image_rect,
ossim_uint32  reduced_res_level,
ossimImageData tile 
)
protected

Returns true on success, false on error.

Definition at line 146 of file ossimCcfTileSource.cpp.

References fillUcharBuffer(), fillUshortBuffer(), ossimErrorCodes::OSSIM_ERROR, OSSIM_UCHAR, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, ossimNotify(), ossimNotifyLevel_WARN, ossimCcfHead::pixelType(), status, theCcfHead, and ossimErrorStatusInterface::theErrorStatus.

Referenced by getTile().

151 {
152  bool status = false;
153 
154  //***
155  // Determine the pixel type and make the appropriate tiles.
156  //***
157  switch (theCcfHead.pixelType())
158  {
159  case OSSIM_UCHAR:
160  status = fillUcharBuffer(tile_rect,
161  clip_rect,
162  image_rect,
163  reduced_res_level,
164  tile);
165  break;
166  case OSSIM_USHORT11:
167  case OSSIM_USHORT12:
168  case OSSIM_USHORT13:
169  case OSSIM_USHORT14:
170  case OSSIM_USHORT15:
171  case OSSIM_USHORT16:
172  status = fillUshortBuffer(tile_rect,
173  clip_rect,
174  image_rect,
175  reduced_res_level,
176  tile);
177  break;
178  default:
181  << "ossimCcfTileSource fillBuffer ERROR:"
182  << "\nUnsupported pixel type!"
183  << "\nBuffer not filled. Returning error." << endl;
184  break;
185  }
186 
187  return status;
188 }
16 bit unsigned integer (15 bits used)
ossimScalarType pixelType() const
Definition: ossimCcfHead.h:99
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
16 bit unsigned integer (13 bits used)
bool fillUcharBuffer(const ossimIrect &tile_rect, const ossimIrect &clip_rect, const ossimIrect &image_rect, ossim_uint32 reduced_res_level, ossimImageData *tile)
Returns true on success, false on error.
return status
16 bit unsigned integer (11 bits used)
bool fillUshortBuffer(const ossimIrect &tile_rect, const ossimIrect &clip_rect, const ossimIrect &image_rect, ossim_uint32 reduced_res_level, ossimImageData *tile)
Returns true on success, false on error.
16 bit unsigned iteger
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
8 bit unsigned iteger
16 bit unsigned integer (12 bits used)

◆ fillUcharBuffer()

bool ossimCcfTileSource::fillUcharBuffer ( const ossimIrect tile_rect,
const ossimIrect clip_rect,
const ossimIrect image_rect,
ossim_uint32  reduced_res_level,
ossimImageData tile 
)
protected

Returns true on success, false on error.

Definition at line 193 of file ossimCcfTileSource.cpp.

References adjustToStartOfChunk(), ossimCcfHead::bytesPerChip(), ossimCcfHead::bytesPerChunk(), ossimCcfHead::chipSizePerBand(), ossimCcfHead::chunksInSampleDir(), ossimIrect::clipToRect(), ossimImageData::getBuf(), ossimImageData::getSizePerBand(), ossimImageData::getWidth(), ossimIrect::intersects(), isOpen(), ossimCcfHead::lineChipsPerChunk(), ossimCcfHead::linesPerChip(), ossimIrect::lr(), ossimCcfHead::numberOfBands(), ossimErrorCodes::OSSIM_ERROR, ossimCcfHead::sampleChipsPerChunk(), ossimCcfHead::samplesPerChip(), ossimCcfHead::startOfData(), theCcfHead, theChipBuffer, ossimErrorStatusInterface::theErrorStatus, theFileStr, ossimIrect::ul(), ossimIpt::x, x, ossimIpt::y, and y.

Referenced by fillBuffer().

198 {
199  if(!isOpen()) return false;
200 
201  const ossim_uint32 TILE_SIZE_PER_BAND = tile->getSizePerBand();
202  const ossim_uint32 CHIP_SIZE_PER_BAND = theCcfHead.chipSizePerBand();
203  const ossim_uint32 SAMPLES_PER_CHIP = theCcfHead.samplesPerChip();
204  const ossim_uint32 LINES_PER_CHIP = theCcfHead.linesPerChip();
205  const ossim_uint32 BYTES_PER_CHUNK = theCcfHead.bytesPerChunk();
206  const ossim_uint32 BYTES_PER_CHIP = theCcfHead.bytesPerChip();
207  const ossim_uint32 CHIPS_IN_SAMPLE_DIR = theCcfHead.sampleChipsPerChunk();
208  const ossim_uint32 CHIPS_IN_LINE_DIR = theCcfHead.lineChipsPerChunk();
209  const ossim_uint32 NUMBER_OF_INPUT_BANDS = theCcfHead.numberOfBands();
210  const ossim_uint32 CHUNKS_IN_SAMPLE_DIR = theCcfHead.chunksInSampleDir(reduced_res_level);
211  const ossim_uint32 CHUNK_SIDE_SIZE = SAMPLES_PER_CHIP *
212  CHIPS_IN_SAMPLE_DIR;
213  const ossim_uint32 CHIP_OFFSET_TO_END = SAMPLES_PER_CHIP - 1;
214 
215  //***
216  // Shift the upper left corner of the "clip_rect" to the an even chunk
217  // boundry.
218  //***
219  ossimIpt chunkOrigin = clip_rect.ul();
220  adjustToStartOfChunk(chunkOrigin);
221 
222  //***
223  // Calculate the number of chunks needed in the line/sample directions.
224  //***
225  ossim_uint32 size_in_x
226  = static_cast<ossim_uint32>(clip_rect.lr().x - chunkOrigin.x + 1);
227  ossim_uint32 size_in_y
228  = static_cast<ossim_uint32>(clip_rect.lr().y - chunkOrigin.y + 1);
229  ossim_uint32 w = (CHIPS_IN_SAMPLE_DIR*SAMPLES_PER_CHIP);
230  ossim_uint32 h = (CHIPS_IN_LINE_DIR*LINES_PER_CHIP);
231  ossim_uint32 chunks_in_x_dir = size_in_x / w + (size_in_x % w ? 1 : 0);
232  ossim_uint32 chunks_in_y_dir = size_in_y / h + (size_in_y % h ? 1 : 0);
233 
234 
235  //***
236  // Get the start of data for the "reduced_res_level" passed in.
237  //***
238  streampos startOfData = theCcfHead.startOfData(reduced_res_level);
239  ossimIpt ulChunkPt = chunkOrigin;
240 
241  // Chunk loop in line direction.
242  for (ossim_uint32 y=0; y<chunks_in_y_dir; ++y)
243  {
244  ulChunkPt.x = chunkOrigin.x;
245 
246  // Chunk loop in sample direction.
247  for (ossim_uint32 x=0; x<chunks_in_x_dir; ++x)
248  {
249  //***
250  // Sequence through the chips in the chunk.
251  // Grab the ccf data and stuff the tile buffer.
252  //***
253  ossimIpt chip_pt = ulChunkPt;
254 
255  // Chip loop in line direction.
256  for (ossim_uint32 y_chip=0; y_chip<CHIPS_IN_LINE_DIR; ++y_chip)
257  {
258  chip_pt.x = ulChunkPt.x; // Reset x back to front of chunk.
259 
260  // Chip loop in sample direction.
261  for (ossim_uint32 x_chip=0; x_chip<CHIPS_IN_SAMPLE_DIR; ++x_chip)
262  {
263  ossimIrect chip_rect(chip_pt.x,
264  chip_pt.y,
265  chip_pt.x + CHIP_OFFSET_TO_END,
266  chip_pt.y + CHIP_OFFSET_TO_END);
267 
268  if (chip_rect.intersects(clip_rect))
269  {
270  //***
271  // Some point in the chip intersect the tile so grab the
272  // data.
273  //***
274 
275  //***
276  // Get the seek position for the chunk.
277  //***
278  streampos tmp_offset
279  = ( ulChunkPt.y / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK *
280  CHUNKS_IN_SAMPLE_DIR ) +
281  ( ulChunkPt.x / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK );
282 
283  streampos seek_position = startOfData + tmp_offset;
284 
285  // Now move it to the chip.
286  tmp_offset
287  = ( y_chip * BYTES_PER_CHIP * CHIPS_IN_SAMPLE_DIR ) +
288  (x_chip * BYTES_PER_CHIP);
289 
290  seek_position += tmp_offset;
291 
292  // Seek to the chip
293  theFileStr->seekg(seek_position, ios::beg);
294 
295  //***
296  // Read the chip from the ccf file into the chip buffer.
297  // This will get all the bands. Bands are interleaved by
298  // chip.
299  //***
300  if (!theFileStr->read((char*)theChipBuffer, BYTES_PER_CHIP))
301  {
303  cerr << "ossimCcfTileSource fillUchBuffer READ ERROR!"
304  << "\nReturning from method." << endl;
305  return false;
306  }
307 
308  ossimIrect chip_clip_rect = clip_rect.clipToRect(chip_rect);
309 
310  //***
311  // Band loop in sample direction. Bands are interleaved by
312  // chip.
313  //***
314  for (ossim_uint32 band=0; band<NUMBER_OF_INPUT_BANDS; ++band)
315  {
316  //***
317  // Get a pointer positioned at the first valid pixel in
318  // the chip.
319  //***
320  ossim_uint8* s
321  = theChipBuffer +
322  band * CHIP_SIZE_PER_BAND +
323  (chip_clip_rect.ul().y - chip_rect.ul().y) *
324  SAMPLES_PER_CHIP + chip_clip_rect.ul().x -
325  chip_rect.ul().x;
326 
327  //***
328  // Get a pointer positioned at the first valid pixel in
329  // the tile.
330  //***
331  ossim_uint8* d
332  = (ossim_uint8*)tile->getBuf() +
333  band * TILE_SIZE_PER_BAND +
334  (chip_clip_rect.ul().y - tile_rect.ul().y) *
335  tile->getWidth() + chip_clip_rect.ul().x -
336  tile_rect.ul().x;
337 
338  // Line loop through a chip.
339  for (ossim_int32 chip_line = chip_clip_rect.ul().y;
340  chip_line <= chip_clip_rect.lr().y;
341  chip_line++)
342  {
343  // Sample loop through a chip.
344  ossim_uint32 i=0;
345  for (ossim_int32 chip_sample = chip_clip_rect.ul().x;
346  chip_sample <= chip_clip_rect.lr().x;
347  chip_sample++)
348  {
349  d[i] = s[i];
350  i++;
351  }
352 
353  // Increment the pointers by one line.
354  s += SAMPLES_PER_CHIP;
355  d += tile->getWidth();
356  }
357 
358  } // End of band loop.
359 
360  } // End of if (chip_rect.intersects(clip_rect))
361 
362  chip_pt.x += SAMPLES_PER_CHIP;
363 
364  } // End of chip loop in the sample direction.
365 
366  chip_pt.y += LINES_PER_CHIP;
367 
368  } // End of chip loop in the line direction.
369 
370  ulChunkPt.x += CHUNK_SIDE_SIZE;
371 
372  } // End of chunk loop in the sample direction.
373 
374  ulChunkPt.y += CHUNK_SIDE_SIZE;
375 
376  } // End of chunk loop in the line direction.
377 
378  return true;
379 }
ossim_uint32 samplesPerChip() const
Definition: ossimCcfHead.h:124
virtual ossim_uint32 getWidth() const
ossim_uint32 x
ossim_uint32 y
const ossimIpt & ul() const
Definition: ossimIrect.h:274
static const ossimErrorCode OSSIM_ERROR
ossim_uint32 bytesPerChunk() const
Definition: ossimCcfHead.h:104
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
ossim_uint32 chunksInSampleDir(ossim_uint32 reduced_res_level) const
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 chipSizePerBand() const
Definition: ossimCcfHead.h:135
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
std::streampos startOfData(ossim_uint32 reduced_res_level) const
ossim_uint8 * theChipBuffer
ossim_uint32 bytesPerChip() const
Definition: ossimCcfHead.h:109
void adjustToStartOfChunk(ossimIpt &pt) const
Adjust point to even 256 boundary.
ossim_uint32 linesPerChip() const
Definition: ossimCcfHead.h:129
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_uint32 lineChipsPerChunk() const
Definition: ossimCcfHead.h:119
ossim_uint32 numberOfBands() const
Definition: ossimCcfHead.h:94
ossim_int32 x
Definition: ossimIpt.h:141
ossim_uint32 sampleChipsPerChunk() const
Definition: ossimCcfHead.h:114
unsigned char ossim_uint8
int ossim_int32

◆ fillUshortBuffer()

bool ossimCcfTileSource::fillUshortBuffer ( const ossimIrect tile_rect,
const ossimIrect clip_rect,
const ossimIrect image_rect,
ossim_uint32  reduced_res_level,
ossimImageData tile 
)
protected

Returns true on success, false on error.

Definition at line 384 of file ossimCcfTileSource.cpp.

References adjustToStartOfChunk(), ossimCcfHead::bytesPerChip(), ossimCcfHead::bytesPerChunk(), ossimCcfHead::chipSizePerBand(), ossimIrect::clipToRect(), ossimImageData::getBuf(), ossimImageData::getSizePerBand(), ossimImageData::getWidth(), ossimIrect::intersects(), ossimCcfHead::lineChipsPerChunk(), ossimCcfHead::linesPerChip(), ossimIrect::lr(), ossimCcfHead::numberOfBands(), ossimErrorCodes::OSSIM_ERROR, OSSIM_LITTLE_ENDIAN, ossimCcfHead::sampleChipsPerChunk(), ossimCcfHead::samplesPerChip(), ossimCcfHead::startOfData(), theByteOrder, theCcfHead, theChipBuffer, ossimErrorStatusInterface::theErrorStatus, theFileStr, ossimIrect::ul(), ossimIpt::x, x, ossimIpt::y, and y.

Referenced by fillBuffer().

389 {
390  const ossim_uint32 TILE_SIZE_PER_BAND = tile->getSizePerBand();
391  const ossim_uint32 CHIP_SIZE_PER_BAND = theCcfHead.chipSizePerBand();
392  const ossim_uint32 SAMPLES_PER_CHIP = theCcfHead.samplesPerChip();
393  const ossim_uint32 LINES_PER_CHIP = theCcfHead.linesPerChip();
394  const ossim_uint32 BYTES_PER_CHUNK = theCcfHead.bytesPerChunk();
395  const ossim_uint32 BYTES_PER_CHIP = theCcfHead.bytesPerChip();
396  const ossim_uint32 CHIPS_IN_SAMPLE_DIR = theCcfHead.sampleChipsPerChunk();
397  const ossim_uint32 CHIPS_IN_LINE_DIR = theCcfHead.lineChipsPerChunk();
398  const ossim_uint32 NUMBER_OF_INPUT_BANDS = theCcfHead.numberOfBands();
399  const ossim_uint32 CHUNKS_IN_SAMPLE_DIR = theCcfHead.
400  chunksInSampleDir(reduced_res_level);
401  const ossim_uint32 CHUNK_SIDE_SIZE = SAMPLES_PER_CHIP *
402  CHIPS_IN_SAMPLE_DIR;
403  const ossim_uint32 CHIP_OFFSET_TO_END = SAMPLES_PER_CHIP - 1;
404 
405  //***
406  // Shift the upper left corner of the "clip_rect" to the an even chunk
407  // boundry.
408  //***
409  ossimIpt chunkOrigin = clip_rect.ul();
410  adjustToStartOfChunk(chunkOrigin);
411 
412  //***
413  // Calculate the number of chunks needed in the line/sample directions.
414  //***
415 
416  ossim_uint32 size_in_x = clip_rect.lr().x - chunkOrigin.x + 1;
417  ossim_uint32 size_in_y = clip_rect.lr().y - chunkOrigin.y + 1;
418  ossim_uint32 w = (CHIPS_IN_SAMPLE_DIR*SAMPLES_PER_CHIP);
419  ossim_uint32 h = (CHIPS_IN_LINE_DIR*LINES_PER_CHIP);
420  ossim_uint32 chunks_in_x_dir = size_in_x / w + (size_in_x % w ? 1 : 0);
421  ossim_uint32 chunks_in_y_dir = size_in_y / h + (size_in_y % h ? 1 : 0);
422  //***
423  // Get the start of data for the "reduced_res_level" passed in.
424  //***
425  streampos startOfData = theCcfHead.startOfData(reduced_res_level);
426  ossimIpt ulChunkPt = chunkOrigin;
427 
428  // Chunk loop in line direction.
429  for (ossim_uint32 y=0; y<chunks_in_y_dir; ++y)
430  {
431  ulChunkPt.x = chunkOrigin.x;
432 
433  // Chunk loop in sample direction.
434  for (ossim_uint32 x=0; x<chunks_in_x_dir; ++x)
435  {
436  //***
437  // Sequence through the chips in the chunk.
438  // Grab the ccf data and stuff the tile buffer.
439  //***
440  ossimIpt chip_pt = ulChunkPt;
441 
442  // Chip loop in line direction.
443  for (ossim_uint32 y_chip=0; y_chip<CHIPS_IN_LINE_DIR; ++y_chip)
444  {
445  chip_pt.x = ulChunkPt.x; // Reset x back to front of chunk.
446 
447  // Chip loop in sample direction.
448  for (ossim_uint32 x_chip=0; x_chip<CHIPS_IN_SAMPLE_DIR; ++x_chip)
449  {
450  ossimIrect chip_rect(chip_pt.x,
451  chip_pt.y,
452  chip_pt.x + CHIP_OFFSET_TO_END,
453  chip_pt.y + CHIP_OFFSET_TO_END);
454 
455  if (chip_rect.intersects(clip_rect))
456  {
457  //***
458  // Some point in the chip intersect the tile so grab the
459  // data.
460  //***
461 
462  //***
463  // Get the seek position for the chunk.
464  //***
465  streampos tmp_offset
466  = ( ulChunkPt.y / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK *
467  CHUNKS_IN_SAMPLE_DIR ) +
468  ( ulChunkPt.x / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK );
469 
470  streampos seek_position = startOfData + tmp_offset;
471 
472  // Now move it to the chip.
473  tmp_offset
474  = ( y_chip * BYTES_PER_CHIP * CHIPS_IN_SAMPLE_DIR ) +
475  (x_chip * BYTES_PER_CHIP);
476 
477  seek_position += tmp_offset;
478 
479  // Seek to the chip
480  theFileStr->seekg(seek_position, ios::beg);
481 
482  //***
483  // Read the chip from the ccf file into the chip buffer.
484  // This will get all the bands. Bands are interleaved by
485  // chip.
486  //***
487  if (!theFileStr->read((char*)theChipBuffer, BYTES_PER_CHIP))
488  {
490  cerr << "ossimCcfTileSource fillUshortBuffer READ ERROR!"
491  << "Returning from method." << endl;
492  return false;
493  }
494 
495  ossimIrect chip_clip_rect = clip_rect.clipToRect(chip_rect);
496 
497  //***
498  // Band loop in sample direction. Bands are interleaved by
499  // chip.
500  //***
501  for (ossim_uint32 band=0; band<NUMBER_OF_INPUT_BANDS; band++)
502  {
503  //***
504  // Get a pointer positioned at the first valid pixel in
505  // the chip.
506  //***
507  ossim_uint16* s
509  band * CHIP_SIZE_PER_BAND +
510  (chip_clip_rect.ul().y - chip_rect.ul().y) *
511  SAMPLES_PER_CHIP + chip_clip_rect.ul().x -
512  chip_rect.ul().x;
513 
514  //***
515  // Get a pointer positioned at the first valid pixel in
516  // the tile.
517  //***
518  ossim_uint16* d
519  = (ossim_uint16*)tile->getBuf() +
520  band * TILE_SIZE_PER_BAND +
521  (chip_clip_rect.ul().y - tile_rect.ul().y) *
522  tile->getWidth() + chip_clip_rect.ul().x -
523  tile_rect.ul().x;
524 
525  // Line loop through a chip.
526  for (ossim_int32 chip_line = chip_clip_rect.ul().y;
527  chip_line <= chip_clip_rect.lr().y;
528  ++chip_line)
529  {
530  // Sample loop through a chip.
531  ossim_uint32 i=0;
532  for (ossim_int32 chip_sample = chip_clip_rect.ul().x;
533  chip_sample <= chip_clip_rect.lr().x;
534  ++chip_sample)
535  {
537  {
538  //***
539  // CCF data alway stored in big endian byte
540  // order so swap the bytes.
541  //***
542  d[i] = (s[i] << 8) | (s[i] >> 8);
543  }
544  else
545  {
546  d[i] = s[i];
547  }
548 
549  ++i;
550  }
551 
552  // Increment the pointers by one line.
553  s += SAMPLES_PER_CHIP;
554  d += tile->getWidth();
555  }
556 
557  } // End of band loop.
558 
559  } // End of if (chip_rect.intersects(clip_rect))
560 
561  chip_pt.x += SAMPLES_PER_CHIP;
562 
563  } // End of chip loop in the sample direction.
564 
565  chip_pt.y += LINES_PER_CHIP;
566 
567  } // End of chip loop in the line direction.
568 
569  ulChunkPt.x += CHUNK_SIDE_SIZE;
570 
571  } // End of chunk loop in the sample direction.
572 
573  ulChunkPt.y += CHUNK_SIDE_SIZE;
574 
575  } // End of chunk loop in the line direction.
576 
577  return true;
578 }
ossim_uint32 samplesPerChip() const
Definition: ossimCcfHead.h:124
virtual ossim_uint32 getWidth() const
ossim_uint32 x
ossim_uint32 y
const ossimIpt & ul() const
Definition: ossimIrect.h:274
static const ossimErrorCode OSSIM_ERROR
unsigned short ossim_uint16
ossim_uint32 bytesPerChunk() const
Definition: ossimCcfHead.h:104
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
unsigned int ossim_uint32
const ossimIpt & lr() const
Definition: ossimIrect.h:276
ossim_uint32 chipSizePerBand() const
Definition: ossimCcfHead.h:135
ossimIrect clipToRect(const ossimIrect &rect) const
Definition: ossimIrect.cpp:501
std::streampos startOfData(ossim_uint32 reduced_res_level) const
ossim_uint8 * theChipBuffer
ossim_uint32 bytesPerChip() const
Definition: ossimCcfHead.h:109
void adjustToStartOfChunk(ossimIpt &pt) const
Adjust point to even 256 boundary.
ossim_uint32 linesPerChip() const
Definition: ossimCcfHead.h:129
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
ossim_uint32 lineChipsPerChunk() const
Definition: ossimCcfHead.h:119
ossim_uint32 numberOfBands() const
Definition: ossimCcfHead.h:94
ossim_int32 x
Definition: ossimIpt.h:141
ossim_uint32 sampleChipsPerChunk() const
Definition: ossimCcfHead.h:114
int ossim_int32

◆ getImageRectangle()

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

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

Note that rrds 0 is the highest resolution rrds.

Reimplemented from ossimImageHandler.

Definition at line 585 of file ossimCcfTileSource.cpp.

References ossimCcfHead::imageRect(), and theCcfHead.

586 {
587  return theCcfHead.imageRect(reduced_res_level);
588 }
ossimIrect imageRect(ossim_uint32 reduced_res_level) const

◆ getImageTileHeight()

ossim_uint32 ossimCcfTileSource::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 785 of file ossimCcfTileSource.cpp.

786 {
787  return 32;
788 }

◆ getImageTileWidth()

ossim_uint32 ossimCcfTileSource::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 780 of file ossimCcfTileSource.cpp.

781 {
782  return 32;
783 }

◆ getLongName()

ossimString ossimCcfTileSource::getLongName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 844 of file ossimCcfTileSource.cpp.

845 {
846  return ossimString("ccf reader");
847 }

◆ getNumberOfDecimationLevels()

ossim_uint32 ossimCcfTileSource::getNumberOfDecimationLevels ( ) const
virtual

Returns the number of reduced resolution data sets (rrds).

Note: The full res image is counted as a data set so an image with no reduced resolution data set will have a count of one.

Reimplemented from ossimImageHandler.

Definition at line 869 of file ossimCcfTileSource.cpp.

References ossimCcfHead::numberOfReducedResSets(), and theCcfHead.

870 {
872 }
ossim_uint32 numberOfReducedResSets() const
Definition: ossimCcfHead.h:55

◆ getNumberOfInputBands()

ossim_uint32 ossimCcfTileSource::getNumberOfInputBands ( ) const
virtual

Returns the number of bands in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageSource.

Definition at line 849 of file ossimCcfTileSource.cpp.

References ossimCcfHead::numberOfBands(), and theCcfHead.

Referenced by getNumberOfOutputBands().

850 {
851  return theCcfHead.numberOfBands();
852 }
ossim_uint32 numberOfBands() const
Definition: ossimCcfHead.h:94

◆ getNumberOfLines()

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

Returns the number of lines in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageHandler.

Definition at line 859 of file ossimCcfTileSource.cpp.

References ossimCcfHead::numberOfLines(), and theCcfHead.

860 {
861  return theCcfHead.numberOfLines(reduced_res_level);
862 }
ossim_uint32 numberOfLines(ossim_uint32 reduced_res_level) const

◆ getNumberOfOutputBands()

ossim_uint32 ossimCcfTileSource::getNumberOfOutputBands ( ) const
virtual

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

Reimplemented from ossimImageSource.

Definition at line 854 of file ossimCcfTileSource.cpp.

References getNumberOfInputBands().

Referenced by getTile().

855 {
856  return getNumberOfInputBands();
857 }
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.

◆ getNumberOfSamples()

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

Returns the number of samples in the image.

Satisfies pure virtual from ImageHandler class.

Implements ossimImageHandler.

Definition at line 864 of file ossimCcfTileSource.cpp.

References ossimCcfHead::numberOfSamples(), and theCcfHead.

865 {
866  return theCcfHead.numberOfSamples(reduced_res_level);
867 }
ossim_uint32 numberOfSamples(ossim_uint32 reduced_res_level) const

◆ getOutputScalarType()

ossimScalarType ossimCcfTileSource::getOutputScalarType ( ) const
virtual

Returns the output pixel type of the tile source.

Reimplemented from ossimImageSource.

Definition at line 759 of file ossimCcfTileSource.cpp.

References ossimCcfHead::pixelType(), and theCcfHead.

760 {
761  return theCcfHead.pixelType();
762 }
ossimScalarType pixelType() const
Definition: ossimCcfHead.h:99

◆ getProperty()

ossimRefPtr< ossimProperty > ossimCcfTileSource::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 879 of file ossimCcfTileSource.cpp.

References ossimImageHandler::getProperty().

880 {
881  if(name == "file_type")
882  {
883 
884  return new ossimStringProperty(name, "CCF");
885  }
886  return ossimImageHandler::getProperty(name);
887 }
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const

◆ getPropertyNames()

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

Gets a list of property names available.

Parameters
propertyNamesThe list to push back names to.

Reimplemented from ossimImageHandler.

Definition at line 889 of file ossimCcfTileSource.cpp.

References ossimImageHandler::getPropertyNames().

890 {
892  propertyNames.push_back("file_type");
893 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const

◆ getShortName()

ossimString ossimCcfTileSource::getShortName ( ) const
virtual

Reimplemented from ossimObject.

Definition at line 839 of file ossimCcfTileSource.cpp.

840 {
841  return ossimString("ccf");
842 }

◆ getTile() [1/2]

ossimRefPtr< ossimImageData > ossimCcfTileSource::getTile ( const ossimIrect rect,
ossim_uint32  resLevel = 0 
)
virtual
Returns
the requested region of interest

Reimplemented from ossimImageSource.

Definition at line 62 of file ossimCcfTileSource.cpp.

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

64 {
65  if (theTile.valid())
66  {
67  // Image rectangle must be set prior to calling getTile.
69 
70  if ( getTile( theTile.get(), resLevel ) == false )
71  {
73  {
74  theTile->makeBlank();
75  }
76  }
77  }
78 
79  return theTile;
80 }
virtual void setImageRectangle(const ossimIrect &rect)
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
ossimRefPtr< ossimImageData > theTile
virtual void makeBlank()
Initializes data to null pixel values.

◆ getTile() [2/2]

bool ossimCcfTileSource::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 82 of file ossimCcfTileSource.cpp.

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

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

◆ getTileHeight()

ossim_uint32 ossimCcfTileSource::getTileHeight ( ) const
virtual

Returns the height of the output tile.

Reimplemented from ossimImageSource.

Definition at line 775 of file ossimCcfTileSource.cpp.

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

776 {
777  return ( theTile.valid() ? theTile->getHeight() : 0 );
778 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getHeight() const
ossimRefPtr< ossimImageData > theTile

◆ getTileWidth()

ossim_uint32 ossimCcfTileSource::getTileWidth ( ) const
virtual

Returns the width of the output tile.

Reimplemented from ossimImageSource.

Definition at line 767 of file ossimCcfTileSource.cpp.

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

768 {
769  return ( theTile.valid() ? theTile->getWidth() : 0 );
770 }
virtual ossim_uint32 getWidth() const
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageData > theTile

◆ initVerticesFromHeader()

void ossimCcfTileSource::initVerticesFromHeader ( )
protected

Definition at line 790 of file ossimCcfTileSource.cpp.

References ossimCcfHead::getValidImageVertices(), theCcfHead, and ossimImageHandler::theValidImageVertices.

791 {
792  theValidImageVertices.clear();
793 
794  const vector<ossimIpt>& validImageVertices
796 
797  ossim_uint32 upper = (ossim_uint32)validImageVertices.size();
798  if(!upper) return;
799  for(ossim_uint32 index = 0; index < upper; ++index)
800  {
801  theValidImageVertices.push_back(validImageVertices[index]);
802  }
803 
804  if (traceDebug())
805  {
806  cout << "ossimCcfTileSource::initVerticesFromHeader DEBUG:"
807  << "\nValid image vertices:"
808  << endl;
809  for (ossim_uint32 i=0; i<upper; ++i)
810  {
811  cout << "\npoint[" << i << "]: " << theValidImageVertices[i];
812  }
813  cout << endl;
814  }
815 }
const std::vector< ossimIpt > & getValidImageVertices() const
Definition: ossimCcfHead.h:138
unsigned int ossim_uint32
vector< ossimIpt > theValidImageVertices

◆ isEcgGeom()

bool ossimCcfTileSource::isEcgGeom ( const ossimFilename filename) const
protected

Definition at line 817 of file ossimCcfTileSource.cpp.

References ossimString::c_str(), ossimString::downcase(), ossimFilename::exists(), and ossimFilename::setExtension().

818 {
819  ossimFilename file = filename;
820  file.setExtension("geom");
821 
822  if(file.exists())
823  {
824  char bytes[3];
825  ifstream in(file.c_str());
826 
827  in.read((char*)bytes, 3);
828  ossimString testEcg(bytes,
829  bytes + 3);
830  testEcg = testEcg.downcase();
831  if(in&&(testEcg == "ecg"))
832  {
833  return true;
834  }
835  }
836  return false;
837 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool exists() 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
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.

◆ isOpen()

bool ossimCcfTileSource::isOpen ( ) const
virtual

Derived classes must implement this method to be concrete.

Returns
true if open, false if not.

Implements ossimImageHandler.

Definition at line 874 of file ossimCcfTileSource.cpp.

References theFileStr.

Referenced by fillUcharBuffer(), and getTile().

875 {
876  return (theFileStr != NULL);
877 }

◆ loadState()

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

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

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 645 of file ossimCcfTileSource.cpp.

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

647 {
648  if (ossimImageHandler::loadState(kwl, prefix))
649  {
650  if (open())
651  {
652  return true;
653  }
654  }
655 
656  return false;
657 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.

◆ open()

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

Implements ossimImageHandler.

Definition at line 662 of file ossimCcfTileSource.cpp.

Referenced by loadState().

663 {
664  static const char MODULE[] = "ossimCcfTileSource::open";
665  if (traceExec()) CLOG << "entering..." << endl;
666 
667  if(isOpen())
668  {
669  close();
670  }
671 
672  if (traceDebug())
673  {
674  CLOG << "DEBUG -- "
675  << "\n\t theImageFile: " << theImageFile << endl;
676  }
677 
679  {
681  if (traceExec()) CLOG << "returning with error..." << endl;
682  return false;
683  }
684 
685  if (traceDebug())
686  {
687  CLOG << "DEBUG -- "
688  << "\n\t theImageFile: " << theImageFile
689  << "\n\t theCcfHead: " << theCcfHead
690  << endl;
691  }
692 
694  // Open up the file for reading.
695  theFileStr->open(theImageFile.c_str(), ios::in | ios::binary);
696 
697  if (!(*theFileStr))
698  {
700 
701  cerr << MODULE << " ERROR!"
702  << "\nCould not open file: " << theImageFile.c_str()
703  << "\nReturning..." << endl;
704  if (traceExec()) CLOG << "returning with error..." << endl;
705 
706  delete theFileStr;
707  theFileStr = NULL;
708  return false;
709  }
710 
712  theTile->initialize();
713 
715 
716  // Initialize the output band list.
718  {
720  }
721 
722  for (ossim_uint32 i=0; i<getNumberOfInputBands(); ++i)
723  {
724  theOutputBandList[i] = i; // One to one for initial setup.
725  }
726 
727  completeOpen();
728 
729  if (traceDebug() && theTile.valid())
730  {
731  CLOG << "DEBUG:"
732  << "\ntheTile:\n" << *theTile << endl;
733  }
734 
735  if (traceExec()) CLOG << "returning..." << endl;
736  return true;
737 }
vector< ossim_uint32 > theOutputBandList
#define CLOG
Definition: ossimTrace.h:23
ossimFilename theImageFile
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
bool valid() const
Definition: ossimRefPtr.h:75
static const ossimErrorCode OSSIM_ERROR
virtual void close()
Deletes the overview and clears the valid image vertices.
virtual bool isOpen() const
Derived classes must implement this method to be concrete.
virtual void initialize()
Initialize the data buffer.
static ossimImageDataFactory * instance()
bool parseCcfHeader(const char *ccf_file)
ossimRefPtr< ossimImageData > theTile
unsigned int ossim_uint32
virtual ossimRefPtr< ossimImageData > create(ossimSource *owner, ossimScalarType scalar, ossim_uint32 bands=1) const
virtual void completeOpen()
Will complete the opening process.
ossim_uint8 * theChipBuffer
ossim_uint32 bytesPerChip() const
Definition: ossimCcfHead.h:109
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
unsigned char ossim_uint8
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.

◆ operator=()

ossimCcfTileSource& ossimCcfTileSource::operator= ( const ossimCcfTileSource source)
protected

◆ saveState()

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

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

Return true if ok or false on error.

Reimplemented from ossimImageHandler.

Definition at line 635 of file ossimCcfTileSource.cpp.

References ossimImageHandler::saveState().

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

◆ setOutputBandList()

bool ossimCcfTileSource::setOutputBandList ( const vector< ossim_uint32 > &  outputBandList)

Set the output band list.

Use to set the number and order of output bands. Will set an error if out of range.

Definition at line 593 of file ossimCcfTileSource.cpp.

594 {
595  static const char MODULE[] = "ossimCcfTileSource::setOutputBandList";
596  if (traceExec()) CLOG << "entering..." << endl;
597 
598  if (outputBandList.size() != theOutputBandList.size())
599  {
600  //***
601  // Verify that each individual band does not bust the range of input
602  // bands.
603  //***
604  for (ossim_uint32 i=0; i<outputBandList.size(); i++)
605  {
606  if (outputBandList[i] > (getNumberOfInputBands() - 1))
607  {
608  setErrorStatus();
609 
610  cerr << MODULE << " ERROR:"
611  << "\nOutput band number in list is greater than the "
612  << "number of bands in the image source!"
613  << "\noutputBandList[" << i << "]: "
614  << "\nHighest availabe band: "
615  << (getNumberOfInputBands() - 1)
616  << "\nError status has been set! Returning..."
617  << endl;
618  return false;
619  }
620  }
621 
622  // Remove the old tiles and reallocate with the new size.
623  theTile = NULL;
624  }
625 
626  theOutputBandList = outputBandList; // Assign the new list.
627 
628  if (traceExec()) CLOG << "returning..." << endl;
629  return true;
630 }
vector< ossim_uint32 > theOutputBandList
#define CLOG
Definition: ossimTrace.h:23
ossimRefPtr< ossimImageData > theTile
unsigned int ossim_uint32
virtual ossim_uint32 getNumberOfInputBands() const
Returns the number of bands in the image.

Member Data Documentation

◆ theByteOrder

ossim_int32 ossimCcfTileSource::theByteOrder
protected

Definition at line 226 of file ossimCcfTileSource.h.

Referenced by fillUshortBuffer().

◆ theCcfHead

ossimCcfHead ossimCcfTileSource::theCcfHead
protected

◆ theChipBuffer

ossim_uint8* ossimCcfTileSource::theChipBuffer
protected

Definition at line 223 of file ossimCcfTileSource.h.

Referenced by close(), fillUcharBuffer(), and fillUshortBuffer().

◆ theFileStr

ifstream* ossimCcfTileSource::theFileStr
protected

Definition at line 224 of file ossimCcfTileSource.h.

Referenced by close(), fillUcharBuffer(), fillUshortBuffer(), and isOpen().

◆ theOutputBandList

vector<ossim_uint32> ossimCcfTileSource::theOutputBandList
protected

Definition at line 225 of file ossimCcfTileSource.h.

◆ theTile

ossimRefPtr<ossimImageData> ossimCcfTileSource::theTile
protected

Definition at line 222 of file ossimCcfTileSource.h.

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


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