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

OSSIM nitf writer base class to hold methods common to all nitf writers. More...

#include <ossimNitfWriterBase.h>

Inheritance diagram for ossimNitfWriterBase:
ossimImageFileWriter ossimImageWriter ossimProcessInterface ossimConnectableObjectListener ossimOutputSource ossimListener ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced ossimKakaduNitfWriter ossimNitf20Writer ossimNitfWriter

Public Member Functions

 ossimNitfWriterBase ()
 default constructor More...
 
 ossimNitfWriterBase (const ossimFilename &filename, ossimImageSource *inputSource)
 Constructor that takes filename and input source. More...
 
virtual ~ossimNitfWriterBase ()
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 Set the properties. More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 Gets a property. More...
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Saves the state of the writer to kwl with prefix then calls base class ossimImageFileWriter::saveState. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Initializes the state of the writer from kwl with prefix then calls base class ossimImageFileWriter::loadState. More...
 
virtual ossimString getExtension () const
 Returns a 3-letter extension from the image type descriptor (theOutputImageType) that can be used for image file extensions. More...
 
virtual void addRegisteredTag (ossimRefPtr< ossimNitfRegisteredTag > registeredTag)
 
virtual void addRegisteredTag (ossimRefPtr< ossimNitfRegisteredTag > registeredTag, bool unique)
 
virtual void addRegisteredTag (ossimRefPtr< ossimNitfRegisteredTag > registeredTag, bool unique, const ossim_uint32 &ownerIndex, const ossimString &tagType)
 
virtual void setFileHeaderV2_1 (ossimRefPtr< ossimNitfFileHeaderV2_1 >, bool preferSource=false)
 
virtual void setImageHeaderV2_1 (ossimRefPtr< ossimNitfImageHeaderV2_1 >, bool preferSource=false)
 
- 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 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 isOpen () const =0
 
virtual bool open ()=0
 
virtual bool open (const ossimString &outputName)
 
virtual const ossimStringgetOutputName ()
 
virtual void close ()=0
 
- 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
 

Protected Member Functions

void writeGeometry (ossimNitfImageHeaderV2_X *hdr, ossimImageSourceSequencer *seq)
 Populates tags with geometry info from projection. More...
 
void addBlockaTag (ossimMapProjectionInfo &mapInfo, ossimNitfImageHeaderV2_X *hdr)
 Adds the BLOCKA tag. More...
 
void addGeolobTag (const ossimMapProjection *mapProj, ossimNitfImageHeaderV2_X *hdr)
 Adds the GEOLOB tag. More...
 
void addRpcbTag (const ossimIrect &rect, ossimProjection *proj, ossimNitfImageHeaderV2_X *hdr)
 Adds the RPC00B tag. More...
 
void setComplexityLevel (std::streamoff, ossimNitfFileHeaderV2_X *hdr)
 Sets the complexity level of theFileHeader. More...
 
void setComplexityLevel (ossimNitfFileHeaderV2_X *hdr, ossim_uint64 width=0, ossim_uint64 height=0)
 
virtual void initializeDefaultsFromConfigFile (ossimNitfFileHeaderV2_X *fileHdr, ossimNitfImageHeaderV2_X *imgHdr)
 Sets file header and image header defaults from config file if found in preferences. More...
 
- Protected Member Functions inherited from ossimImageFileWriter
bool writeWorldFile (const ossimFilename &file)
 Common world file writer method. More...
 
virtual bool writeFile ()=0
 Write out the file. 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

bool theEnableRpcbTagFlag
 If true user wants to set RPC00B tag. More...
 
bool theEnableBlockaTagFlag
 If true user wants to set BLOCKA tag. More...
 
bool theEnableGeolobTagFlag
 If true user wants to set GEOLOG tag. More...
 
- 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
 

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
}
 

Detailed Description

OSSIM nitf writer base class to hold methods common to all nitf writers.

Definition at line 31 of file ossimNitfWriterBase.h.

Constructor & Destructor Documentation

◆ ossimNitfWriterBase() [1/2]

ossimNitfWriterBase::ossimNitfWriterBase ( )

default constructor

Definition at line 46 of file ossimNitfWriterBase.cpp.

48  theEnableRpcbTagFlag(false),
51 {
52 }
bool theEnableGeolobTagFlag
If true user wants to set GEOLOG tag.
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
ossimImageFileWriter(const ossimFilename &filename=ossimFilename(), ossimImageSource *inputSource=0, ossimObject *owner=0)
The writer will own the sequencer.
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.

◆ ossimNitfWriterBase() [2/2]

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

Constructor that takes filename and input source.

Parameters
filenameThe output file name.
inputSourceThe input source to write to file.

Definition at line 54 of file ossimNitfWriterBase.cpp.

56  : ossimImageFileWriter(filename, inputSource, 0),
57  theEnableRpcbTagFlag(false),
60 {
61 }
bool theEnableGeolobTagFlag
If true user wants to set GEOLOG tag.
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
ossimImageFileWriter(const ossimFilename &filename=ossimFilename(), ossimImageSource *inputSource=0, ossimObject *owner=0)
The writer will own the sequencer.
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.

◆ ~ossimNitfWriterBase()

ossimNitfWriterBase::~ossimNitfWriterBase ( )
virtual

Definition at line 63 of file ossimNitfWriterBase.cpp.

64 {
65 }

Member Function Documentation

◆ addBlockaTag()

void ossimNitfWriterBase::addBlockaTag ( ossimMapProjectionInfo mapInfo,
ossimNitfImageHeaderV2_X hdr 
)
protected

Adds the BLOCKA tag.

Parameters
mapInfoossimMapProjectionInfo to use to set tag with.
hdrThe header to write to.
Note
Currently only used with map projected images.

Definition at line 250 of file ossimNitfWriterBase.cpp.

References ossimMapProjectionInfo::getPixelType(), ossimMapProjectionInfo::linesPerImage(), ossimMapProjectionInfo::llGroundPt(), ossimMapProjectionInfo::lrGroundPt(), OSSIM_PIXEL_IS_AREA, ossimNitfBlockaTag::setBlockInstance(), ossimNitfBlockaTag::setFrfcLoc(), ossimNitfBlockaTag::setFrlcLoc(), ossimNitfBlockaTag::setLLines(), ossimNitfBlockaTag::setLrfcLoc(), ossimNitfBlockaTag::setLrlcLoc(), ossimMapProjectionInfo::setPixelType(), ossimMapProjectionInfo::ulGroundPt(), and ossimMapProjectionInfo::urGroundPt().

Referenced by writeGeometry().

252 {
253  if (hdr)
254  {
255  // Capture the current pixel type.
256  ossimPixelType originalPixelType = mapInfo.getPixelType();
257 
258  // This tag wants corners as area:
260 
261  // Stuff the blocka tag which has six digit precision.
263 
264  // Set the block number.
265  blockaTag->setBlockInstance(1);
266 
267  // Set the number of lines.
268  blockaTag->setLLines(mapInfo.linesPerImage());
269 
270  // Set first row, first column.
271  blockaTag->setFrfcLoc(ossimDpt(mapInfo.ulGroundPt()));
272 
273  // Set first row, last column.
274  blockaTag->setFrlcLoc(ossimDpt(mapInfo.urGroundPt()));
275 
276  // Set last row, last column.
277  blockaTag->setLrlcLoc(ossimDpt(mapInfo.lrGroundPt()));
278 
279  // Set last row, first column.
280  blockaTag->setLrfcLoc(ossimDpt(mapInfo.llGroundPt()));
281 
282  if (traceDebug())
283  {
285  << "ossimNitfWriterBase::addBlockaTag DEBUG:"
286  << "\nBLOCKA Tag:" << *((ossimObject*)(blockaTag.get()))
287  << std::endl;
288  }
289 
290  // Add the tag to the header.
291  ossimRefPtr<ossimNitfRegisteredTag> blockaTagRp = blockaTag.get();
292  ossimNitfTagInformation blockaTagInfo(blockaTagRp);
293  hdr->addTag(blockaTagInfo);
294 
295  // Reset the pixel type to original value
296  mapInfo.setPixelType(originalPixelType);
297 
298  } // matches: if (hdr)
299 }
void setFrlcLoc(const ossimDpt &pt)
Convert latitude and logitude to theFrlcLoc string.
ossimGpt urGroundPt() const
Returns the upper right ground point.
ossim_int32 linesPerImage() const
void setLrfcLoc(const ossimDpt &pt)
Convert latitude and logitude to theLrfcLoc string.
void setLrlcLoc(const ossimDpt &pt)
Convert latitude and logitude to theLrlcLoc string.
void setBlockInstance(ossim_uint32 block)
virtual void addTag(const ossimNitfTagInformation &tag, bool unique=true)
void setPixelType(ossimPixelType type)
Sets the data member "thePixelType".
ossimPixelType getPixelType() const
Returns data member "thePixelType".
void setFrfcLoc(const ossimDpt &pt)
Convert latitude and logitude to theFrfcLoc string.
ossimGpt lrGroundPt() const
Returns the lower right ground point.
ossimGpt ulGroundPt() const
Returns the upper left ground point.
void setLLines(ossim_uint32 lines)
ossimPixelType
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimGpt llGroundPt() const
Returns the lower left ground point.

◆ addGeolobTag()

void ossimNitfWriterBase::addGeolobTag ( const ossimMapProjection mapProj,
ossimNitfImageHeaderV2_X hdr 
)
protected

Adds the GEOLOB tag.

This will only be added if projection is geographic.

Parameters
mapInfoossimMapProjectionInfo to use to set tag with.
hdrThe header to write to.
Note
Currently only used with map projected images.

Definition at line 301 of file ossimNitfWriterBase.cpp.

References ossimNitfImageHeader::addTag(), ossimRefPtr< T >::get(), ossimMapProjection::getDecimalDegreesPerPixel(), ossimMapProjection::getUlGpt(), ossimDpt::hasNans(), ossimGpt::hasNans(), ossimMapProjection::isGeographic(), ossimGpt::lat, ossimGpt::lon, ossimNitfGeolobTag::setDegreesPerPixelLat(), ossimNitfGeolobTag::setDegreesPerPixelLon(), ossimNitfGeolobTag::setLso(), ossimNitfGeolobTag::setPso(), true, ossimDpt::x, and ossimDpt::y.

Referenced by writeGeometry().

303 {
304  if (hdr && mapProj)
305  {
306  if ( mapProj->isGeographic() == true )
307  {
309 
310  // Get the scale:
311  ossimDpt gsd = mapProj->getDecimalDegreesPerPixel();
312  if ( (gsd.hasNans() == false) && (gsd.x > 0.0) && (gsd.y > 0.0) )
313  {
314  ossimGpt tie = mapProj->getUlGpt();
315  if ( tie.hasNans() == false )
316  {
317  // Shift the tie to edge of pixel:
318  tie.lat = tie.lat + gsd.y*0.5;
319  tie.lon = tie.lon - gsd.x*0.5;
320  if ( (tie.lat <= 90.0) && (tie.lon >= -180.0) )
321  {
323  geolobTag->setDegreesPerPixelLon( gsd.x );
324  geolobTag->setDegreesPerPixelLat( gsd.y );
325  geolobTag->setLso( tie.lon ); // Origin Longitude
326  geolobTag->setPso( tie.lat ); // Origin Latitude
327 
328  // Add the tag to the header.
329  ossimRefPtr<ossimNitfRegisteredTag> geolobTagRp = geolobTag.get();
330  ossimNitfTagInformation geolobTagInfo(geolobTagRp);
331  hdr->addTag(geolobTagInfo);
332 
333  if (traceDebug())
334  {
336  << "ossimNitfWriterBase::addGeolobTag DEBUG:"
337  << "\nAdded GEOLOB Tag:\n" << *(geolobTag.get())
338  << "\n";
339  }
340  }
341  }
342  }
343  }
344  }
345 }
virtual const ossimDpt & getDecimalDegreesPerPixel() const
Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing...
double y
Definition: ossimDpt.h:165
virtual void addTag(const ossimNitfTagInformation &tag, bool unique=true)
virtual bool isGeographic() const
void setDegreesPerPixelLon(const ossim_float64 &deltaLon)
Sets the ARV field from decimal degrees per pixel longitude.
ossim_float64 lon
Definition: ossimGpt.h:266
void setLso(const ossim_float64 &lso)
Sets the LSO field(Longitude Origin).
bool hasNans() const
Definition: ossimDpt.h:67
virtual const ossimGpt & getUlGpt() const
bool hasNans() const
Definition: ossimGpt.h:135
void setPso(const ossim_float64 &pso)
Sets the PSO field(Latitude Origin).
double x
Definition: ossimDpt.h:164
void setDegreesPerPixelLat(const ossim_float64 &deltaLat)
Sets the BRV field from decimal degrees per pixel latitude.
ossim_float64 lat
Definition: ossimGpt.h:265
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ addRegisteredTag() [1/3]

void ossimNitfWriterBase::addRegisteredTag ( ossimRefPtr< ossimNitfRegisteredTag registeredTag)
virtual

Reimplemented in ossimNitf20Writer.

Definition at line 442 of file ossimNitfWriterBase.cpp.

443 {
444 }

◆ addRegisteredTag() [2/3]

void ossimNitfWriterBase::addRegisteredTag ( ossimRefPtr< ossimNitfRegisteredTag registeredTag,
bool  unique 
)
virtual

Reimplemented in ossimNitfWriter.

Definition at line 446 of file ossimNitfWriterBase.cpp.

447 {
448 }

◆ addRegisteredTag() [3/3]

void ossimNitfWriterBase::addRegisteredTag ( ossimRefPtr< ossimNitfRegisteredTag registeredTag,
bool  unique,
const ossim_uint32 ownerIndex,
const ossimString tagType 
)
virtual

Reimplemented in ossimNitfWriter.

Definition at line 450 of file ossimNitfWriterBase.cpp.

451 {
452 }

◆ addRpcbTag()

void ossimNitfWriterBase::addRpcbTag ( const ossimIrect rect,
ossimProjection proj,
ossimNitfImageHeaderV2_X hdr 
)
protected

Adds the RPC00B tag.

Parameters
rectRequested rectangle of image to write.
projThe output projection.

Definition at line 347 of file ossimNitfWriterBase.cpp.

References ossimNitfImageHeader::addTag(), ossimRpcSolver::getNitfRpcBTag(), PTR_CAST, and ossimRpcSolver::solveCoefficients().

Referenced by writeGeometry().

350 {
351  if (proj && hdr)
352  {
353  bool useElevation = false;
354 
355  if (PTR_CAST(ossimMapProjection, proj))
356  {
357  // If we're already map projected turn the elevation off.
358  useElevation = false;
359  }
360 
361  // Make an rpc solver.
362  ossimRefPtr<ossimRpcSolver> rs = new ossimRpcSolver(useElevation);
363 
364  // Compute the coefficients.
365  rs->solveCoefficients(ossimDrect(rect), proj, 64, 64);
366 
367  // Add the tag.
369  ossimNitfTagInformation tagInfo(tag);
370  hdr->addTag(tagInfo);
371 
372  if (traceDebug())
373  {
375  << "ossimNitfWriterBase::addRpcbTag DEBUG:"
376  << "\nRPCB Tag:" << *((ossimObject*)(tag.get()))
377  << "\nProjection:\n";
378 
380 
382  << "\nRect: " << rect << std::endl;
383  }
384 
385  } // matches: if (proj && hdr)
386 }
ossimRefPtr< ossimNitfRegisteredTag > getNitfRpcBTag() const
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
virtual void addTag(const ossimNitfTagInformation &tag, bool unique=true)
void solveCoefficients(const ossimDrect &imageBounds, ossimProjection *imageProj, ossim_uint32 xSamples=8, ossim_uint32 ySamples=8)
This will convert any projector to an RPC model.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
This currently only support Rational poilynomial B format.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getExtension()

ossimString ossimNitfWriterBase::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.

Reimplemented in ossimKakaduNitfWriter.

Definition at line 437 of file ossimNitfWriterBase.cpp.

438 {
439  return ossimString("ntf");
440 }

◆ getProperty()

ossimRefPtr< ossimProperty > ossimNitfWriterBase::getProperty ( const ossimString name) const
virtual

Gets a property.

Parameters
Thename of the property to get.
Returns
The property if found.

Reimplemented from ossimImageFileWriter.

Reimplemented in ossimKakaduNitfWriter, ossimNitfWriter, and ossimNitf20Writer.

Definition at line 92 of file ossimNitfWriterBase.cpp.

Referenced by ossimNitfWriter::getProperty(), and ossimKakaduNitfWriter::getProperty().

94 {
95  ossimRefPtr<ossimProperty> result = 0;
96 
97  if(name == ENABLE_BLOCKA_KW)
98  {
99  result = new ossimBooleanProperty(name, theEnableBlockaTagFlag);
100  }
101  else if (name == ENABLE_GEOLOB_KW)
102  {
103  result = new ossimBooleanProperty(name, theEnableGeolobTagFlag);
104  }
105  else if(name == ENABLE_RPCB_KW)
106  {
107  result = new ossimBooleanProperty(name, theEnableRpcbTagFlag);
108  }
109  else
110  {
111  result = ossimImageFileWriter::getProperty(name);
112  }
113 
114  return result;
115 }
bool theEnableGeolobTagFlag
If true user wants to set GEOLOG tag.
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.

◆ getPropertyNames()

void ossimNitfWriterBase::getPropertyNames ( std::vector< ossimString > &  propertyNames) const
virtual
Parameters
propertyNamesArray to populate with property names.
Note
The following names are handled: enable_rpcb_tag enable_blocka_tag

Reimplemented from ossimImageFileWriter.

Reimplemented in ossimKakaduNitfWriter, ossimNitfWriter, and ossimNitf20Writer.

Definition at line 117 of file ossimNitfWriterBase.cpp.

References ossimImageFileWriter::getPropertyNames().

Referenced by ossimNitfWriter::getPropertyNames(), and ossimKakaduNitfWriter::getPropertyNames().

119 {
121 
122  propertyNames.push_back(ENABLE_BLOCKA_KW);
123  propertyNames.push_back(ENABLE_GEOLOB_KW);
124  propertyNames.push_back(ENABLE_RPCB_KW);
125 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const

◆ initializeDefaultsFromConfigFile()

void ossimNitfWriterBase::initializeDefaultsFromConfigFile ( ossimNitfFileHeaderV2_X fileHdr,
ossimNitfImageHeaderV2_X imgHdr 
)
protectedvirtual

Sets file header and image header defaults from config file if found in preferences.

Definition at line 462 of file ossimNitfWriterBase.cpp.

References ossimKeywordlist::addFile(), ossimPreferences::instance(), ossimNitfFileHeaderV2_X::loadState(), and ossimNitfImageHeaderV2_X::loadState().

Referenced by ossimNitf20Writer::ossimNitf20Writer(), and ossimNitfWriter::ossimNitfWriter().

464 {
465  // Look in prefs for site configuration file:
466  const char* lookup = ossimPreferences::instance()->
467  findPreference("nitf_writer.site_configuration_file");
468  if ( lookup && fileHdr && imgHdr )
469  {
470  ossimKeywordlist kwl;
471  if ( kwl.addFile( lookup ) )
472  {
473  fileHdr->loadState( kwl, "nitf.file." );
474  imgHdr->loadState( kwl, "nitf.image." );
475  }
476  }
477 }
Represents serializable keyword/value map.
bool addFile(const char *file)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to set fields from a keyword list.
static ossimPreferences * instance()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to set fields from a keyword list.

◆ loadState()

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

Initializes the state of the writer from kwl with prefix then calls base class ossimImageFileWriter::loadState.

Parameters
kwlKeyword list to initialize from.
prefixUsually something like: "object2."
Returns
true on success, false on failure.

Keywords picked up by loadState:

enable_rpcb_tag: true

enable_blocka_tag: true

Reimplemented from ossimImageFileWriter.

Reimplemented in ossimNitfWriter, ossimNitf20Writer, and ossimKakaduNitfWriter.

Definition at line 138 of file ossimNitfWriterBase.cpp.

References ossimKeywordlist::find().

Referenced by ossimKakaduNitfWriter::loadState(), ossimNitf20Writer::loadState(), and ossimNitfWriter::loadState().

140 {
141  // Look for the rpcb enable flag keyword.
142 
143 
144  // Look for the blocka enable flag keyword.
145  const char* lookup = kwl.find(prefix, ENABLE_BLOCKA_KW);
146  if(lookup)
147  {
148  ossimString os = lookup;
150  }
151 
152  // Look for the geolob enable flag keyword.
153  lookup = kwl.find(prefix, ENABLE_GEOLOB_KW);
154  if(lookup)
155  {
156  ossimString os = lookup;
158  }
159 
160  lookup = kwl.find(prefix, ENABLE_RPCB_KW);
161  if(lookup)
162  {
163  ossimString os = lookup;
165  }
166 
167  return ossimImageFileWriter::loadState(kwl, prefix);
168 }
bool theEnableGeolobTagFlag
If true user wants to set GEOLOG tag.
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
bool toBool() const
String to numeric methods.
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.

◆ saveState()

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

Saves the state of the writer to kwl with prefix then calls base class ossimImageFileWriter::saveState.

Parameters
kwlKeyword list to save to.
prefixUsually something like: "object2."
Returns
true on success, false on failure.

Keywords saved by saveState:

enable_rpcb_tag: true

enable_blocka_tag: true

Reimplemented from ossimImageFileWriter.

Reimplemented in ossimNitfWriter, ossimNitf20Writer, and ossimKakaduNitfWriter.

Definition at line 128 of file ossimNitfWriterBase.cpp.

References ossimKeywordlist::add().

Referenced by ossimKakaduNitfWriter::saveState(), ossimNitf20Writer::saveState(), and ossimNitfWriter::saveState().

130 {
131  kwl.add(prefix, ENABLE_BLOCKA_KW, theEnableBlockaTagFlag, true);
132  kwl.add(prefix, ENABLE_GEOLOB_KW, theEnableGeolobTagFlag, true);
133  kwl.add(prefix, ENABLE_RPCB_KW, theEnableRpcbTagFlag, true);
134 
135  return ossimImageFileWriter::saveState(kwl, prefix);
136 }
bool theEnableGeolobTagFlag
If true user wants to set GEOLOG tag.
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.

◆ setComplexityLevel() [1/2]

void ossimNitfWriterBase::setComplexityLevel ( std::streamoff  endPosition,
ossimNitfFileHeaderV2_X hdr 
)
protected

Sets the complexity level of theFileHeader.

Parameters
endPositionThis should be the end seek position of the file.

Definition at line 388 of file ossimNitfWriterBase.cpp.

Referenced by ossimNitf20Writer::writeBlockBandSeparate(), ossimNitfWriter::writeBlockBandSeparate(), ossimNitf20Writer::writeBlockBandSequential(), and ossimNitfWriter::writeBlockBandSequential().

390 {
391  if (hdr)
392  {
393  //---
394  // See MIL-STD-2500C, Table A-10:
395  //
396  // Lots of rules here, but for now we will key off of file size.
397  //---
398  const std::streamoff MB = 1024 * 1024;
399  const std::streamoff MB50 = 50 * MB;
400  const std::streamoff GIG = 1000 * MB;
401  const std::streamoff GIG2 = 2 * GIG;
402 
403  ossimString complexity = "03"; // Less than 50 mb.
404 
405  if ( (endPosition >= MB50) && (endPosition < GIG) )
406  {
407  complexity = "05";
408  }
409  else if ( (endPosition >= GIG) && (endPosition < GIG2) )
410  {
411  complexity = "06";
412  }
413  else if (endPosition >= GIG2)
414  {
415  complexity = "07";
416  }
417 
418  hdr->setComplexityLevel(complexity);
419  }
420 }
void setComplexityLevel(const ossimString &level)

◆ setComplexityLevel() [2/2]

void ossimNitfWriterBase::setComplexityLevel ( ossimNitfFileHeaderV2_X hdr,
ossim_uint64  width = 0,
ossim_uint64  height = 0 
)
protected

Definition at line 423 of file ossimNitfWriterBase.cpp.

References max, and ossimNitfFileHeaderV2_X::setComplexityLevel().

424 {
425  if (hdr)
426  {
427  ossim_uint64 max = (width > height) ? width : height;
428  ossimString complexity = "03";
429  if (max > 65536) complexity = "07";
430  else if (max > 8192) complexity = "06";
431  else if (max > 2048) complexity = "05";
432 
433  hdr->setComplexityLevel(complexity);
434  }
435 }
unsigned long long ossim_uint64
void setComplexityLevel(const ossimString &level)
#define max(a, b)
Definition: auxiliary.h:76

◆ setFileHeaderV2_1()

void ossimNitfWriterBase::setFileHeaderV2_1 ( ossimRefPtr< ossimNitfFileHeaderV2_1 ,
bool  preferSource = false 
)
virtual

Definition at line 454 of file ossimNitfWriterBase.cpp.

455 {
456 }

◆ setImageHeaderV2_1()

void ossimNitfWriterBase::setImageHeaderV2_1 ( ossimRefPtr< ossimNitfImageHeaderV2_1 ,
bool  preferSource = false 
)
virtual

Definition at line 458 of file ossimNitfWriterBase.cpp.

459 {
460 }

◆ setProperty()

void ossimNitfWriterBase::setProperty ( ossimRefPtr< ossimProperty property)
virtual

Set the properties.

Parameters
propertyThe property to set.

Reimplemented from ossimImageFileWriter.

Reimplemented in ossimKakaduNitfWriter, ossimNitfWriter, and ossimNitf20Writer.

Definition at line 67 of file ossimNitfWriterBase.cpp.

References ossimRefPtr< T >::valid().

Referenced by ossimNitfWriter::setProperty(), and ossimKakaduNitfWriter::setProperty().

68 {
69  if(property.valid())
70  {
71  ossimString name = property->getName();
72 
73  if (name == ENABLE_RPCB_KW)
74  {
75  theEnableRpcbTagFlag = property->valueToString().toBool();
76  }
77  else if (name == ENABLE_BLOCKA_KW)
78  {
79  theEnableBlockaTagFlag = property->valueToString().toBool();
80  }
81  else if (name == ENABLE_GEOLOB_KW)
82  {
83  theEnableGeolobTagFlag = property->valueToString().toBool();
84  }
85  else
86  {
88  }
89  }
90 }
bool theEnableGeolobTagFlag
If true user wants to set GEOLOG tag.
bool valid() const
Definition: ossimRefPtr.h:75
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
virtual void setProperty(ossimRefPtr< ossimProperty > property)
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.

◆ writeGeometry()

void ossimNitfWriterBase::writeGeometry ( ossimNitfImageHeaderV2_X hdr,
ossimImageSourceSequencer seq 
)
protected

Populates tags with geometry info from projection.

Will write an rpcb tag if theEnableRpcbTagFlag if set to true.

Parameters
hdrThe header to write to.
seqThe input connection or image source.

Definition at line 170 of file ossimNitfWriterBase.cpp.

References addBlockaTag(), addGeolobTag(), addRpcbTag(), ossimImageSourceSequencer::getBoundingRect(), ossimImageGeometry::getCornerGpts(), ossimUtmProjection::getHemisphere(), ossimImageSource::getImageGeometry(), ossimImageGeometry::getProjection(), ossimUtmProjection::getZone(), ossimImageGeometry::hasProjection(), ossimMapProjectionInfo::llEastingNorthingPt(), ossimMapProjectionInfo::llGroundPt(), ossimMapProjectionInfo::lrEastingNorthingPt(), ossimMapProjectionInfo::lrGroundPt(), OSSIM_PIXEL_IS_AREA, PTR_CAST, ossimNitfImageHeaderV2_X::setGeographicLocationDms(), ossimMapProjectionInfo::setPixelType(), ossimNitfImageHeaderV2_X::setUtmNorth(), ossimNitfImageHeaderV2_X::setUtmSouth(), status, theEnableBlockaTagFlag, theEnableGeolobTagFlag, theEnableRpcbTagFlag, ossimImageFileWriter::theInputConnection, ossimMapProjectionInfo::ulEastingNorthingPt(), ossimMapProjectionInfo::ulGroundPt(), ossimMapProjectionInfo::urEastingNorthingPt(), ossimMapProjectionInfo::urGroundPt(), and ossimRefPtr< T >::valid().

172 {
173  if (hdr && seq)
174  {
176  ossimKeywordlist kwl;
177 
178  if (geom.valid()&&geom->hasProjection())
179  {
180  // Get the requested bounding rectangles.
181  ossimIrect rect = seq->getBoundingRect();
182 
183  // See if it's a map projection; else, a sensor model.
184  ossimMapProjection* mapProj =
186  if (mapProj)
187  {
188  // Use map info to get the corners.
189  ossimMapProjectionInfo mapInfo(mapProj, rect);
190  mapInfo.setPixelType(OSSIM_PIXEL_IS_AREA);
191 
192  // See if it's utm.
194  mapProj);
195  if(utmProj)
196  {
197  ossimDpt ul = mapInfo.ulEastingNorthingPt();
198  ossimDpt ur = mapInfo.urEastingNorthingPt();
199  ossimDpt lr = mapInfo.lrEastingNorthingPt();
200  ossimDpt ll = mapInfo.llEastingNorthingPt();
201 
202  if(utmProj->getHemisphere() == 'N')
203  {
204  hdr->setUtmNorth(utmProj->getZone(), ul, ur, lr, ll);
205  }
206  else
207  {
208  hdr->setUtmSouth(utmProj->getZone(), ul, ur, lr, ll);
209  }
210  }
211  else
212  {
213  ossimGpt ul = mapInfo.ulGroundPt();
214  ossimGpt ur = mapInfo.urGroundPt();
215  ossimGpt lr = mapInfo.lrGroundPt();
216  ossimGpt ll = mapInfo.llGroundPt();
217  hdr->setGeographicLocationDms(ul, ur, lr, ll);
218  }
219 
221  {
222  addBlockaTag(mapInfo, hdr);
223  }
224 
226  {
227  addGeolobTag( mapProj, hdr );
228  }
229  }
230  else
231  {
232  ossimGpt ul, ur, lr, ll;
233  bool status = geom->getCornerGpts(ul, ur, lr, ll);
234  if (status)
235  {
236  hdr->setGeographicLocationDms(ul, ur, lr, ll);
237  }
238  }
239 
241  {
242  addRpcbTag(rect, geom->getProjection(), hdr);
243  }
244 
245  } // matches: if (proj.valid())
246 
247  } // matches: if (hdr && seq)
248 }
bool theEnableGeolobTagFlag
If true user wants to set GEOLOG tag.
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
virtual void setUtmNorth(ossim_uint32 zone, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
bool getCornerGpts(ossimGpt &ul, ossimGpt &ur, ossimGpt &lr, ossimGpt &ll) const
Assigns the ossimGpts with the ground coordinates of the four corresponding image corner points...
void addBlockaTag(ossimMapProjectionInfo &mapInfo, ossimNitfImageHeaderV2_X *hdr)
Adds the BLOCKA tag.
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
void addRpcbTag(const ossimIrect &rect, ossimProjection *proj, ossimNitfImageHeaderV2_X *hdr)
Adds the RPC00B tag.
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
void addGeolobTag(const ossimMapProjection *mapProj, ossimNitfImageHeaderV2_X *hdr)
Adds the GEOLOB tag.
return status
const ossimProjection * getProjection() const
Access methods for projection (may be NULL pointer).
virtual void setUtmSouth(ossim_uint32 zone, const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
ossim_int32 getZone() const
bool hasProjection() const
Returns TRUE if valid projection defined.
virtual void setGeographicLocationDms(const ossimDpt &ul, const ossimDpt &ur, const ossimDpt &lr, const ossimDpt &ll)
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.

Member Data Documentation

◆ theEnableBlockaTagFlag

bool ossimNitfWriterBase::theEnableBlockaTagFlag
protected

If true user wants to set BLOCKA tag.

(DEFAULT = true) Currently only valid for map projected images.

Definition at line 197 of file ossimNitfWriterBase.h.

Referenced by writeGeometry().

◆ theEnableGeolobTagFlag

bool ossimNitfWriterBase::theEnableGeolobTagFlag
protected

If true user wants to set GEOLOG tag.

(DEFAULT = true) This will only be set if a geographic projection.

Definition at line 203 of file ossimNitfWriterBase.h.

Referenced by writeGeometry().

◆ theEnableRpcbTagFlag

bool ossimNitfWriterBase::theEnableRpcbTagFlag
protected

If true user wants to set RPC00B tag.

(DEFAULT = false)

Definition at line 191 of file ossimNitfWriterBase.h.

Referenced by writeGeometry().


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