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

#include <ossimArcInfoGridWriter.h>

Inheritance diagram for ossimArcInfoGridWriter:
ossimImageFileWriter ossimImageWriter ossimProcessInterface ossimConnectableObjectListener ossimOutputSource ossimListener ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimArcInfoGridWriter ()
 
virtual ~ossimArcInfoGridWriter ()
 
 ossimArcInfoGridWriter (ossimImageSource *inputSource, const ossimFilename &filename)
 
virtual bool isOpen () const
 
virtual bool open ()
 
virtual void close ()
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual ossimString getExtension () const
 Returns a 3-letter extension from the image type descriptor (theOutputImageType) that can be used for image file extensions. More...
 
- Public Member Functions inherited from ossimImageFileWriter
 ossimImageFileWriter (const ossimFilename &filename=ossimFilename(), ossimImageSource *inputSource=0, ossimObject *owner=0)
 The writer will own the sequencer. More...
 
virtual ~ossimImageFileWriter ()
 
virtual ossimObjectgetObject ()
 
virtual const ossimObjectgetObject () const
 
virtual void getImageTypeList (std::vector< ossimString > &imageTypeList) const =0
 void getImageTypeList(std::vector<ossimString>& imageTypeList)const More...
 
virtual bool getOutputHasInternalOverviews (void) const
 Examples of writers that always generate internal overviews are ossim_kakadu_jp2 and ossim_kakadu_nitf_j2k. More...
 
virtual bool hasImageType (const ossimString &imageType) const
 bool hasImageType(const ossimString& imageType) const More...
 
virtual void setTileSize (const ossimIpt &tileSize)
 Sets the output image tiling size if supported by the writer. More...
 
virtual bool writeEnviHeaderFile ()
 Will write an envi header file. More...
 
virtual bool writeErsHeaderFile ()
 Will write an ER Mapper header file. More...
 
virtual bool writeExternalGeometryFile ()
 Will write an external geometry file. More...
 
virtual bool writeFgdcFile ()
 Will write an fgdc file. More...
 
virtual bool writeHistogramFile ()
 Returns true on success, false on error. More...
 
virtual bool writeJpegWorldFile ()
 Will write a jpeg world file. More...
 
virtual bool writeOverviewFile (ossim_uint16 tiff_compress_type=1, ossim_int32 jpeg_compress_quality=75, bool includeR0=false)
 Write out an ossim overview file from the source_file. More...
 
virtual bool writeReadmeFile ()
 Will write a readme file. More...
 
virtual bool writeTiffWorldFile ()
 Will write a world file. More...
 
virtual bool writeWorldFile ()
 Will write a world file. More...
 
virtual bool writeMetaDataFiles ()
 Convenience method that calls meta data write methods that are flagged to be called. More...
 
virtual void setAreaOfInterest (const ossimIrect &inputRect)
 
virtual void changeSequencer (ossimImageSourceSequencer *sequencer)
 Sets the sequencer and connects it to the input of this. More...
 
virtual ossimImageSourceSequencergetSequencer ()
 
virtual void initialize ()
 Initialize method. More...
 
virtual bool execute ()
 Calls: writeFile() writeMetaDataFiles() More...
 
virtual bool writeStream ()
 Method to write the image to a stream. More...
 
virtual bool setOutputStream (ossimRefPtr< ossimOStream > stream)
 Sets the output stream to write to. More...
 
virtual bool setOutputStream (std::ostream &str)
 tmp drb More...
 
virtual ossimRefPtr< ossimOStreamgetOutputStream () const
 Method to return the stream attached to output. More...
 
virtual void setPercentComplete (double percentComplete)
 
virtual void setOutputImageType (ossim_int32 type)
 
virtual void setOutputImageType (const ossimString &type)
 
virtual ossim_int32 getOutputImageType () const
 
virtual ossimString getOutputImageTypeString () const
 
virtual void setOutputName (const ossimString &outputName)
 
virtual void setFilename (const ossimFilename &file)
 
virtual const ossimFilenamegetFilename () const
 
virtual bool canConnectMyInputTo (ossim_int32 inputIndex, const ossimConnectableObject *object) const
 required to be overriden by derived classes More...
 
virtual void disconnectInputEvent (ossimConnectionEvent &event)
 
virtual void connectInputEvent (ossimConnectionEvent &event)
 
virtual void propertyEvent (ossimPropertyEvent &event)
 
virtual bool getWriteImageFlag () const
 Control flags... More...
 
virtual bool getWriteHistogramFlag () const
 
virtual bool getWriteOverviewFlag () const
 
virtual bool getScaleToEightBitFlag () const
 
virtual bool getWriteEnviHeaderFlag () const
 
virtual bool getWriteErsHeaderFlag () const
 
virtual bool getWriteExternalGeometryFlag () const
 
virtual bool getWriteFgdcFlag () const
 
virtual bool getWriteJpegWorldFileFlag () const
 
virtual bool getWriteReadmeFlag () const
 
virtual bool getWriteTiffWorldFileFlag () const
 
virtual bool getWriteWorldFileFlag () const
 
virtual void setWriteImageFlag (bool flag)
 
virtual void setWriteOverviewFlag (bool flag)
 
virtual void setWriteHistogramFlag (bool flag)
 
virtual void setScaleToEightBitFlag (bool flag)
 
virtual void setWriteEnviHeaderFlag (bool flag)
 
virtual void setWriteErsHeaderFlag (bool flag)
 
virtual void setWriteExternalGeometryFlag (bool flag)
 
virtual void setWriteFgdcFlag (bool flag)
 
virtual void setWriteJpegWorldFile (bool flag)
 
virtual void setWriteReadme (bool flag)
 
virtual void setWriteTiffWorldFile (bool flag)
 
virtual void setWriteWorldFile (bool flag)
 
virtual ossim_uint16 getOverviewCompressType () const
 
virtual ossim_int32 getOverviewJpegCompressQuality () const
 
virtual void setOverviewCompressType (ossim_uint16 type)
 
virtual void setOverviewJpegCompressQuality (ossim_int32 quality)
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool addListener (ossimListener *listener)
 Overrides base "addListener" this will capture the pointer and then call the base class "addListener". More...
 
virtual bool removeListener (ossimListener *listener)
 Overrides base "removeListener". More...
 
virtual void setPixelType (ossimPixelType type)
 If "point" the coordinate tie points are relative to the center of the pixel. More...
 
virtual void setPixelType (const ossimString &type)
 If "point" the coordinate tie points are relative to the center of the pixel. More...
 
virtual ossimPixelType getPixelType () const
 
virtual void getPixelTypeString (ossimString &type) const
 
- Public Member Functions inherited from ossimImageWriter
 ossimImageWriter (ossimObject *owner=NULL)
 
 ossimImageWriter (ossimObject *owner, ossim_uint32 numberOfInputs, ossim_uint32 numberOfOutputs, bool inputListIsFixed, bool outputListIsFixed)
 
virtual ~ossimImageWriter ()
 
virtual bool setViewingRect (const ossimIrect &aRect)
 
virtual ossimIrect getAreaOfInterest () const
 
- Public Member Functions inherited from ossimOutputSource
 ossimOutputSource (ossimObject *owner=NULL)
 
 ossimOutputSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimOutputSource ()
 
virtual bool open (const ossimString &outputName)
 
virtual const ossimStringgetOutputName ()
 
- 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 getShortName () const
 
virtual ossimString getLongName () 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 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
 
- Public Member Functions inherited from ossimProcessInterface
 ossimProcessInterface ()
 
virtual ~ossimProcessInterface ()
 
virtual void abort ()
 
bool needsAborting () const
 
bool isAbortRequested () const
 
bool isAborted () const
 
bool isExecuting () const
 
ossimProcessStatus getProcessStatus () const
 
virtual void setProcessStatus (ossimProcessStatus processStatus)
 
virtual double getPercentComplete () const
 
virtual ossimListenerManagergetManager ()
 
void enableEvents ()
 
void disableEvents ()
 
void setCurrentMessage (const ossimString &message)
 
virtual std::ostream & print (std::ostream &out) const
 
- Public Member Functions inherited from ossimConnectableObjectListener
 ossimConnectableObjectListener ()
 
virtual ~ossimConnectableObjectListener ()
 
virtual void processEvent (ossimEvent &event)
 ProcessEvent. More...
 
virtual void objectDestructingEvent (ossimObjectDestructingEvent &)
 
virtual void connectionEvent (ossimConnectionEvent &)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &)
 
virtual void connectOutputEvent (ossimConnectionEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
virtual void refreshEvent (ossimRefreshEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 

Private Member Functions

virtual bool writeFile ()
 Write out the file. More...
 
virtual bool writeBinaryAigHeader ()
 
virtual bool writeBinaryAigBounds ()
 
virtual bool writeBinaryAigStats ()
 

Private Attributes

ossimIpt theOutputTileSize
 

Additional Inherited Members

- 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 Types inherited from ossimProcessInterface
enum  ossimProcessStatus {
  PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3,
  PROCESS_STATUS_NOT_EXECUTING = 4
}
 
- Protected Member Functions inherited from ossimImageFileWriter
bool writeWorldFile (const ossimFilename &file)
 Common world file writer method. More...
 
- 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 inherited from ossimImageFileWriter
ossimRefPtr< ossimImageSourceSequencertheInputConnection
 
ossimRefPtr< ossimViewControllertheViewController
 
ossimListenertheProgressListener
 
ossimFilename theFilename
 
ossimString theOutputImageType
 
bool theWriteImageFlag
 
bool theWriteOverviewFlag
 
bool theWriteHistogramFlag
 
bool theScaleToEightBitFlag
 
ossim_uint16 theOverviewCompressType
 
ossim_int32 theOverviewJpegCompressQuality
 
bool theWriteEnviHeaderFlag
 External meta data writer flags. More...
 
bool theWriteErsHeaderFlag
 
bool theWriteExternalGeometryFlag
 
bool theWriteFgdcFlag
 
bool theWriteJpegWorldFileFlag
 
bool theWriteReadmeFlag
 
bool theWriteTiffWorldFileFlag
 
bool theWriteWorldFileFlag
 
bool theAutoCreateDirectoryFlag
 
ossimUnitType theLinearUnits
 If not a geographic projection this allows the user to set the linear units of the output tag to be: More...
 
ossimPixelType thePixelType
 OSSIM_PIXEL_IS_POINT = 0, OSSIM_PIXEL_IS_AREA = 1. More...
 
- Protected Attributes inherited from ossimImageWriter
ossimIrect theAreaOfInterest
 
- Protected Attributes inherited from ossimOutputSource
ossimString theOutputName
 
- 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
 
- Protected Attributes inherited from ossimProcessInterface
double thePercentComplete
 
ossimProcessStatus theProcessStatus
 
ossimString theMessage
 
bool theEventFlag
 
- Protected Attributes inherited from ossimListener
bool theListenerEnableFlag
 

Detailed Description

Definition at line 20 of file ossimArcInfoGridWriter.h.

Constructor & Destructor Documentation

◆ ossimArcInfoGridWriter() [1/2]

ossimArcInfoGridWriter::ossimArcInfoGridWriter ( )

Definition at line 45 of file ossimArcInfoGridWriter.cpp.

47  theOutputTileSize(256, 4)
48 {
49 }
ossimImageFileWriter(const ossimFilename &filename=ossimFilename(), ossimImageSource *inputSource=0, ossimObject *owner=0)
The writer will own the sequencer.

◆ ~ossimArcInfoGridWriter()

ossimArcInfoGridWriter::~ossimArcInfoGridWriter ( )
virtual

Definition at line 60 of file ossimArcInfoGridWriter.cpp.

References close().

61 {
62  close();
63 }

◆ ossimArcInfoGridWriter() [2/2]

ossimArcInfoGridWriter::ossimArcInfoGridWriter ( ossimImageSource inputSource,
const ossimFilename filename 
)

Definition at line 51 of file ossimArcInfoGridWriter.cpp.

53  :ossimImageFileWriter(filename, inputSource)
54 {
55 }
ossimImageFileWriter(const ossimFilename &filename=ossimFilename(), ossimImageSource *inputSource=0, ossimObject *owner=0)
The writer will own the sequencer.

Member Function Documentation

◆ close()

void ossimArcInfoGridWriter::close ( )
virtual

Generic interface to allow one to close a consumer. For displays this might minimize the window and free up internal pointers for file writers it will make sure the file stream is closed and flushed.

Implements ossimOutputSource.

Definition at line 236 of file ossimArcInfoGridWriter.cpp.

Referenced by ~ossimArcInfoGridWriter().

237 {
238 }

◆ getExtension()

ossimString ossimArcInfoGridWriter::getExtension ( ) const
virtual

Returns a 3-letter extension from the image type descriptor (theOutputImageType) that can be used for image file extensions.

Parameters
imageTypestring representing image type.
Returns
the 3-letter string extension.

Reimplemented from ossimImageFileWriter.

Definition at line 371 of file ossimArcInfoGridWriter.cpp.

372 {
373  return ossimString("aig");
374 }

◆ isOpen()

bool ossimArcInfoGridWriter::isOpen ( ) const
virtual

◆ loadState()

bool ossimArcInfoGridWriter::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 ossimImageFileWriter.

Definition at line 198 of file ossimArcInfoGridWriter.cpp.

References ossimImageFileWriter::loadState().

200 {
201 
202  return ossimImageFileWriter::loadState(kwl, prefix);
203 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)

◆ open()

bool ossimArcInfoGridWriter::open ( )
virtual

Allows a generic interface to open a consumer for writing. If you are a display writer then you would probably show the window or init the device context for writing.

Implements ossimOutputSource.

Definition at line 210 of file ossimArcInfoGridWriter.cpp.

References ossimFilename::exists(), ossimFilename::isDir(), ossimNotify(), ossimNotifyLevel_WARN, ossimFilename::path(), and ossimImageFileWriter::theFilename.

Referenced by writeFile().

211 {
212  if(theFilename.isDir()&&
214  {
215  return true;
216  }
217  else
218  {
220  if(theFilename.isDir()&&
222  {
223  return true;
224  }
225  else
226  {
228  << "ossimArcInfoGridWriter::open(): Directory "
229  << theFilename << " doesn't exist" << std::endl;
230  }
231 
232  }
233  return false;
234 }
bool isDir() const
bool exists() const
ossimFilename path() const
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveState()

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

saves the state of the object.

Reimplemented from ossimImageFileWriter.

Definition at line 192 of file ossimArcInfoGridWriter.cpp.

References ossimImageFileWriter::saveState().

194 {
195  return ossimImageFileWriter::saveState(kwl, prefix);
196 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const

◆ writeBinaryAigBounds()

bool ossimArcInfoGridWriter::writeBinaryAigBounds ( )
privatevirtual

Definition at line 307 of file ossimArcInfoGridWriter.cpp.

References ossimString::c_str(), ossimImageSourceSequencer::getBoundingRect(), ossimIrect::hasNans(), ossimIrect::height(), isOpen(), ossimAigBounds::ll_x, ossimAigBounds::ll_y, ossimImageFileWriter::theFilename, ossimImageFileWriter::theInputConnection, ossimAigBounds::ur_x, ossimAigBounds::ur_y, and ossimIrect::width().

Referenced by writeFile().

308 {
309  const char* MODULE = "ossimArcInfoGridWriter::writeBinaryAigBounds";
310  ossimAigBounds aigBounds;
311 
312 
313  // setup bounds
315  if(!bounds.hasNans())
316  {
317  aigBounds.ll_x = -.5;
318  aigBounds.ll_y = -.5;
319  aigBounds.ur_x = bounds.width()-.5;
320  aigBounds.ur_y = bounds.height()-.5;
321 
322  //
323  ossimFilename file=ossimFilename(theFilename+"/"+"dblbnd.adf");
324 
325  if(isOpen())
326  {
327  std::ofstream out;
328  out.open(file.c_str(), ios::out|ios::binary);
329 
330  if(out)
331  {
332  if(traceDebug())
333  {
334  CLOG << "AIG BOUNDS =\n" <<aigBounds << std::endl;
335  }
336  return aigBounds.writeStream(out);
337  }
338  }
339  }
340 
341  return false;
342 }
#define CLOG
Definition: ossimTrace.h:23
bool writeStream(std::ostream &out)
ossim_uint32 height() const
Definition: ossimIrect.h:487
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
ossim_uint32 width() const
Definition: ossimIrect.h:500
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
bool hasNans() const
Definition: ossimIrect.h:337
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47

◆ writeBinaryAigHeader()

bool ossimArcInfoGridWriter::writeBinaryAigHeader ( )
privatevirtual

Definition at line 241 of file ossimArcInfoGridWriter.cpp.

References ossimString::c_str(), ossimImageSourceSequencer::getNumberOfTilesHorizontal(), ossimImageSourceSequencer::getNumberOfTilesVertical(), ossimImageSourceSequencer::getOutputScalarType(), ossimImageSourceSequencer::getTileHeight(), ossimImageSourceSequencer::getTileWidth(), isOpen(), OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, ossimNotify(), ossimNotifyLevel_WARN, ossimAigHeader::setFloatCoverage(), ossimImageFileWriter::theFilename, ossimAigHeader::theHeightOfTileInPixels, ossimImageFileWriter::theInputConnection, ossimAigHeader::theNumberOfTilesPerColumn, ossimAigHeader::theNumberOfTilesPerRow, and ossimAigHeader::theWidthOfTileInPixels.

Referenced by writeFile().

242 {
243  const char* MODULE = "ossimArcInfoGridWriter::writeBinaryAigHeader";
244  ossimAigHeader aigHeader;
245 
246  ossimFilename file=ossimFilename(theFilename+"/"+"hdr.adf");
247 
248  if(isOpen())
249  {
251  {
252  case OSSIM_UCHAR:
253  case OSSIM_SSHORT16:
254  case OSSIM_USHORT11:
255  case OSSIM_USHORT12:
256  case OSSIM_USHORT13:
257  case OSSIM_USHORT14:
258  case OSSIM_USHORT15:
259  case OSSIM_USHORT16:
260 // {
261 // aigHeader.setIntCoverage();
262 // break;
263 // }
264  case OSSIM_DOUBLE:
265  case OSSIM_FLOAT:
268  {
269  aigHeader.setFloatCoverage();
270  break;
271  }
272  default:
273  {
275  << "ossimArcInfoGridWriter::writeBinaryAigHeader: "
276  << "unknown scalar type" << std::endl;
277  }
278  }
279 
280  // need to set pixel size
281  //
282 
283  // code goes here
284 
285  // now setting number of tiles per row
290 
291  std::ofstream out;
292  out.open(file.c_str(), ios::out|ios::binary);
293 
294  if(out)
295  {
296  if(traceDebug())
297  {
298  CLOG << "AIG_HEADER = \n" << aigHeader << std::endl;
299  }
300  return aigHeader.writeStream(out);
301  }
302  }
303 
304  return false;
305 }
16 bit unsigned integer (15 bits used)
#define CLOG
Definition: ossimTrace.h:23
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
16 bit unsigned integer (14 bits used)
16 bit unsigned integer (13 bits used)
int theNumberOfTilesPerColumn
bool writeStream(std::ostream &out)
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
int theNumberOfTilesPerRow
32 bit normalized floating point
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
ossim_int64 getNumberOfTilesHorizontal() const
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
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
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
void setFloatCoverage()
32 bit floating point
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_int64 getNumberOfTilesVertical() const
8 bit unsigned iteger
16 bit unsigned integer (12 bits used)

◆ writeBinaryAigStats()

bool ossimArcInfoGridWriter::writeBinaryAigStats ( )
privatevirtual

Definition at line 344 of file ossimArcInfoGridWriter.cpp.

References ossimString::c_str(), ossimImageSourceSequencer::getMaxPixelValue(), ossimImageSourceSequencer::getMinPixelValue(), isOpen(), ossimImageFileWriter::theFilename, ossimImageFileWriter::theInputConnection, ossimAigStatistics::theMax, ossimAigStatistics::theMean, ossimAigStatistics::theMin, and ossimAigStatistics::writeStream().

Referenced by writeFile().

345 {
346  ossimAigStatistics aigStats;
347 
348 
349  // setup bounds
352  aigStats.theMean = (aigStats.theMax-aigStats.theMin)/2.0;
353 
354  //
355  ossimFilename file=ossimFilename(theFilename+"/"+"sta.adf");
356 
357  if(isOpen())
358  {
359  std::ofstream out;
360  out.open(file.c_str(), ios::out|ios::binary);
361 
362  if(out)
363  {
364  return aigStats.writeStream(out);
365  }
366  }
367 
368  return false;
369 }
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
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
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
bool writeStream(std::ostream &out)

◆ writeFile()

bool ossimArcInfoGridWriter::writeFile ( )
privatevirtual

Write out the file.

Returns
true on success, false on error.

Implements ossimImageFileWriter.

Definition at line 65 of file ossimArcInfoGridWriter.cpp.

References ossimString::c_str(), ossimConnectableObject::connectMyInputTo(), ossimRefPtr< T >::get(), ossimImageSourceSequencer::getAreaOfInterest(), ossimImageSourceSequencer::getNextTile(), ossimImageSourceSequencer::getNumberOfTiles(), ossimImageSourceSequencer::getTileHeight(), ossimImageSourceSequencer::getTileWidth(), ossimIrect::hasNans(), ossimCastTileSourceFilter::initialize(), ossimImageSourceSequencer::initialize(), open(), OSSIM_FLOAT, ossimNotify(), ossimNotifyLevel_NOTICE, ossimImageSourceSequencer::setAreaOfInterest(), ossimCastTileSourceFilter::setOutputScalarType(), ossimImageSourceSequencer::setTileSize(), ossimImageSourceSequencer::setToStartOfSequence(), ossimImageWriter::theAreaOfInterest, ossimImageFileWriter::theFilename, ossimAigDataFileHeader::theFileSize, ossimAigIndexFileHeader::theFileSize, ossimImageFileWriter::theInputConnection, theOutputTileSize, ossimAigDataFileHeader::theTileSize, tileNumber, writeBinaryAigBounds(), writeBinaryAigHeader(), writeBinaryAigStats(), ossimAigDataFileHeader::writeStream(), and ossimAigIndexFileHeader::writeStream().

66 {
67  const char* MODULE = "ossimArcInfoGridWriter::writeFile";
69  {
70  return false;
71  }
72 
76  filter->initialize();
77 
78  open();
79 
80  // make sure we have a region of interest
82  {
85  }
86  else
87  {
89  }
90 
91  if(theAreaOfInterest.hasNans()) return false;
92 
95 
96  bool result = writeBinaryAigHeader()&&
99  if(result)
100  {
101  ossimFilename indexFile=ossimFilename(theFilename+"/"+"w001001x.adf");
102  ossimFilename dataFile=ossimFilename(theFilename+"/"+"w001001.adf");
103 
104  std::ofstream indexFileStream(indexFile.c_str(),
105  ios::out|ios::binary);
106  std::ofstream dataFileStream(dataFile.c_str(),
107  ios::out|ios::binary);
108  ossimEndian endian;
109 
110  if(indexFileStream&&dataFileStream)
111  {
112  ossimAigIndexFileHeader aigIndexHeader;
113  ossimAigDataFileHeader aigDataFileHeader;
114 
115  ossimRefPtr<ossimImageData> currentTile =
117  long tileNumber = 0;
118  long totalNumberOfTiles = theInputConnection->getNumberOfTiles();
119  ossim_int32 tileOffsetShorts = 0;
120  ossim_int32 tileSizeShorts = 0;
121 
123  << "Tile height = " << theInputConnection->getTileHeight()
124  << std::endl
125  << "Tile width = " << theInputConnection->getTileWidth()
126  << std::endl;
127  ossim_int32 tileSizeInShorts = 2*(theInputConnection->getTileHeight()*
129  // Note: this is in shorts
130  //
131  aigIndexHeader.theFileSize += (4*totalNumberOfTiles);
132 
133  // Note this is in shorts
134  //
135 
136  aigDataFileHeader.theFileSize = 50+
137  (tileSizeInShorts*totalNumberOfTiles) +
138  totalNumberOfTiles;
139  aigDataFileHeader.theTileSize = tileSizeInShorts;
140 
141  aigIndexHeader.writeStream(indexFileStream);
142  aigDataFileHeader.writeStream(dataFileStream);
143 
144  if(traceDebug())
145  {
146  CLOG << "AIG INDEX HEADER = \n" << aigIndexHeader << std::endl;
147  CLOG << "AIG DATA FILE HEADER\n"
148  << "file size = " << aigDataFileHeader.theFileSize
149  << std::endl;
150  }
151 
152  while(currentTile.valid())
153  {
154  currentTile = filter->applyCast(currentTile);
155 
156  if(!currentTile->getBuf())
157  {
158  currentTile->initialize();
159  }
160 
161  tileOffsetShorts = dataFileStream.tellp()/2;
162  tileSizeShorts = 2*currentTile->getHeight()*currentTile->getWidth();
163  ossim_int16 tileSizeShorts16 = 2*currentTile->getHeight()*currentTile->getWidth();
164  if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
165  {
166  endian.swap(tileOffsetShorts);
167  endian.swap(tileSizeShorts);
168  endian.swap(tileSizeShorts16);
169  endian.swap((ossim_float32*)currentTile->getBuf(),
170  currentTile->getWidth()*
171  currentTile->getHeight());
172  }
173 
174  indexFileStream.write((char*)(&tileOffsetShorts), 4);
175  indexFileStream.write((char*)(&tileSizeShorts), 4);
176  dataFileStream.write((char*)(&tileSizeShorts16),
177  2);
178  dataFileStream.write((char*)(currentTile->getBuf()),
179  currentTile->getWidth()*currentTile->getHeight()*4);
180 
181  currentTile = theInputConnection->getNextTile();
182  ++tileNumber;
183  }
184  }
185  }
186 
187  close();
188  filter = 0;
189  return result;
190 }
virtual ossim_uint32 getWidth() const
#define CLOG
Definition: ossimTrace.h:23
virtual ossim_uint32 getTileWidth() const
Returns the default processing tile width.
ossim_uint32 tileNumber
bool valid() const
Definition: ossimRefPtr.h:75
float ossim_float32
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 resLevel=0)
ossimIrect theAreaOfInterest
virtual ossim_uint32 getHeight() const
virtual void initialize()
Initialize the data buffer.
virtual void setAreaOfInterest(const ossimIrect &areaOfInterest)
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual void setOutputScalarType(ossimScalarType scalarType)
Sets the output scalar type.
bool writeStream(std::ostream &out) const
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
short ossim_int16
virtual ossim_uint32 getTileHeight() const
Returns the default processing tile height.
bool writeStream(std::ostream &out)
virtual const void * getBuf() 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
bool hasNans() const
Definition: ossimIrect.h:337
const ossimIrect & getAreaOfInterest() const
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
ossimRefPtr< ossimImageData > applyCast(ossimRefPtr< ossimImageData > input)
virtual void setTileSize(const ossimIpt &tileSize)
32 bit floating point
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
int ossim_int32

Member Data Documentation

◆ theOutputTileSize

ossimIpt ossimArcInfoGridWriter::theOutputTileSize
private

Definition at line 63 of file ossimArcInfoGridWriter.h.

Referenced by writeFile().


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