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

#include <ossimNitf20Writer.h>

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

Public Member Functions

 ossimNitf20Writer (const ossimFilename &filename=ossimFilename(""), ossimImageSource *inputSource=(ossimImageSource *) NULL)
 
virtual ~ossimNitf20Writer ()
 
virtual bool isOpen () const
 
virtual bool open ()
 
virtual void close ()
 
virtual void getImageTypeList (std::vector< ossimString > &imageTypeList) const
 void getImageTypeList(std::vector<ossimString>& imageTypeList)const More...
 
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
 
void addRegisteredTag (ossimRefPtr< ossimNitfRegisteredTag > registeredTag)
 
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...
 
- Public Member Functions inherited from ossimNitfWriterBase
 ossimNitfWriterBase ()
 default constructor More...
 
 ossimNitfWriterBase (const ossimFilename &filename, ossimImageSource *inputSource)
 Constructor that takes filename and input source. More...
 
virtual ~ossimNitfWriterBase ()
 
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, 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 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 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
 

Protected Member Functions

virtual bool writeFile ()
 
virtual bool writeBlockBandSeparate ()
 write out block band separate More...
 
virtual bool writeBlockBandSequential ()
 Outputs in band sequential format. More...
 
void addTags ()
 
- Protected Member Functions inherited from ossimNitfWriterBase
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...
 
- 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

std::ofstream * theOutputStream
 
ossimRefPtr< ossimNitfFileHeaderV2_0theFileHeader
 
ossimRefPtr< ossimNitfImageHeaderV2_0theImageHeader
 
bool theEnableRpcbTagFlag
 If true user wants to set RPC00B tag. More...
 
bool theEnableBlockaTagFlag
 If true user wants to set BLOCKA tag. More...
 
bool theCopyFieldsFlag
 If true this will enable searching the input connnection for another NITF handler and bring the fields to this writers output fields and will maintin as many field values as possible. More...
 
- Protected Attributes inherited from ossimNitfWriterBase
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

Definition at line 26 of file ossimNitf20Writer.h.

Constructor & Destructor Documentation

◆ ossimNitf20Writer()

ossimNitf20Writer::ossimNitf20Writer ( const ossimFilename filename = ossimFilename(""),
ossimImageSource inputSource = (ossimImageSource*)NULL 
)

Definition at line 51 of file ossimNitf20Writer.cpp.

References ossimRefPtr< T >::get(), ossimNitfWriterBase::initializeDefaultsFromConfigFile(), ossimNitfFileHeaderV2_X::setEncryption(), ossimNitfImageHeaderV2_X::setJustification(), ossimImageFileWriter::setWriteExternalGeometryFlag(), theFileHeader, theImageHeader, and ossimImageFileWriter::theOutputImageType.

53  : ossimNitfWriterBase(filename, inputSource),
54  theOutputStream(0),
55  theFileHeader(),
57  theEnableRpcbTagFlag(false),
59  theCopyFieldsFlag(false)
60 {
61  //---
62  // Since the internal nitf tags are not very accurate, write an external
63  // geometry out as default behavior. Users can disable this via the
64  // property interface or keyword list.
65  //---
67 
70  theOutputImageType = "nitf20_block_band_separate";
71 
72  // These are always set:
75 
76  // Set any site defaults.
78  dynamic_cast<ossimNitfFileHeaderV2_X*>(theFileHeader.get()),
79  dynamic_cast<ossimNitfImageHeaderV2_X*>(theImageHeader.get()) );
80 }
ossimNitfWriterBase()
default constructor
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.
bool theCopyFieldsFlag
If true this will enable searching the input connnection for another NITF handler and bring the field...
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
void setEncryption(const ossimString &encryption)
virtual void initializeDefaultsFromConfigFile(ossimNitfFileHeaderV2_X *fileHdr, ossimNitfImageHeaderV2_X *imgHdr)
Sets file header and image header defaults from config file if found in preferences.
virtual void setWriteExternalGeometryFlag(bool flag)
std::ofstream * theOutputStream
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader
void setJustification(const ossimString &value)

◆ ~ossimNitf20Writer()

ossimNitf20Writer::~ossimNitf20Writer ( )
virtual

Definition at line 82 of file ossimNitf20Writer.cpp.

References close(), theFileHeader, and theImageHeader.

83 {
84  //---
85  // This looks like a leak but it's not as both of these are ossimRefPtr's.
86  //---
87  theFileHeader=0;
89 
90  close();
91 }
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader

Member Function Documentation

◆ addRegisteredTag()

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

Reimplemented from ossimNitfWriterBase.

Definition at line 624 of file ossimNitf20Writer.cpp.

References ossimNitfImageHeader::addTag(), ossimRefPtr< T >::get(), ossimNitfTagInformation::setTagData(), and theImageHeader.

626 {
627  ossimNitfTagInformation tagInfo;
628  tagInfo.setTagData(registeredTag.get());
629  theImageHeader->addTag(tagInfo);
630 }
virtual void addTag(const ossimNitfTagInformation &tag, bool unique=true)
void setTagData(ossimRefPtr< ossimNitfRegisteredTag > tagData)
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader

◆ addTags()

void ossimNitf20Writer::addTags ( )
protected

Definition at line 632 of file ossimNitf20Writer.cpp.

References ossimConnectableObject::accept(), ossimNitfFileHeader::addTag(), ossimString::begin(), ossimString::contains(), ossimRefPtr< T >::get(), ossimNitfTileSource::getCurrentImageHeader(), ossimNitfTileSource::getFileHeader(), ossimNitfFileHeader::getNumberOfTags(), ossimCollectionVisitor::getObjectAs(), ossimCollectionVisitor::getObjects(), ossimPropertyInterface::getPropertyValueAsString(), ossimNitfFileHeader::getTagInformation(), min, ossimNitfFileHeaderV2_X::setDate(), ossimPropertyInterface::setProperty(), ossimString::size(), theCopyFieldsFlag, theFileHeader, theImageHeader, ossimRefPtr< T >::valid(), ossimVisitor::VISIT_CHILDREN, and ossimVisitor::VISIT_INPUTS.

633 {
634  ossimDate currentDate;
635  theFileHeader->setDate(currentDate);
636 
638  {
639  ossimTypeNameVisitor visitor(ossimString("ossimNitfTileSource"),
640  true,
642  accept(visitor);
643 
644  // If there are multiple image handlers, e.g. a mosaic do not uses.
646  if ( visitor.getObjects().size() == 1 )
647  {
648  nitf = visitor.getObjectAs<ossimNitfTileSource>( 0 );
649  }
650 
651  if( nitf.valid() )
652  {
653  ossimString value;
654  ossimPropertyInterface* fileHeaderProperties = dynamic_cast<ossimPropertyInterface*>(theFileHeader.get());
655  ossimPropertyInterface* imageHeaderProperties = dynamic_cast<ossimPropertyInterface*>(theImageHeader.get());
656  bool nitf21Flag = false;
657  const ossimNitfFileHeader* header = nitf->getFileHeader();
658  const ossimNitfImageHeader* imageHeader = nitf->getCurrentImageHeader();
659  if(header)
660  {
661  ossimString version = header->getPropertyValueAsString("fhdr");
662  nitf21Flag = version.contains("2.1");
663  value = header->getPropertyValueAsString("stype");
664  if(value.size())
665  {
666  fileHeaderProperties->setProperty("stype", value);
667  }
668  value = header->getPropertyValueAsString("ostaid");
669  if(value.size())
670  {
671  fileHeaderProperties->setProperty("ostaid", value);
672  }
673  value = header->getPropertyValueAsString("ftitle");
674  if(value.size())
675  {
676  fileHeaderProperties->setProperty("ftitle", value);
677  }
678  value = header->getPropertyValueAsString("fsclas");
679  if(value.size())
680  {
681  fileHeaderProperties->setProperty("fsclas", value);
682  }
683  value = header->getPropertyValueAsString("oname");
684  if(value.size())
685  {
686  fileHeaderProperties->setProperty("oname", value);
687  }
688  value = header->getPropertyValueAsString("ophone");
689  if(value.size())
690  {
691  fileHeaderProperties->setProperty("ophone", value);
692  }
693  int idx = 0;
694  for(idx = 0; idx < header->getNumberOfTags(); ++idx)
695  {
697  header->getTagInformation(info,
698  idx);
699  theFileHeader->addTag(info);
700  }
701  value = header->getPropertyValueAsString("");
702  if(value.size())
703  {
704  fileHeaderProperties->setProperty("", value);
705  }
706  value = header->getPropertyValueAsString("fdt");
707  if(value.size()==14)
708  {
709  if(nitf21Flag)
710  {
711  ossimString year(value.begin()+2, value.begin()+4);
712  ossimString mon(value.begin()+4, value.begin()+6);
713  ossimString day(value.begin()+6, value.begin()+8);
714  ossimString hour(value.begin()+8, value.begin()+10);
715  ossimString min(value.begin()+10, value.begin()+12);
716  ossimString sec(value.begin()+12, value.begin()+14);
717  if(mon.toUInt32() < 13)
718  {
719  mon = monthConversionTable[mon.toUInt32()];
720  }
721  fileHeaderProperties->setProperty("fdt", day+hour+min+sec+"Z"+mon+year);
722  }
723  else
724  {
725  fileHeaderProperties->setProperty("fdt", value);
726  }
727  }
728  }
729  if(imageHeader)
730  {
731  ossim_uint32 idx = 0;
732  for(idx = 0; idx < imageHeader->getNumberOfTags(); ++idx)
733  {
735  imageHeader->getTagInformation(info,
736  idx);
737  theImageHeader->addTag(info);
738  }
739  value = imageHeader->getPropertyValueAsString("tgtid");
740  if(value.size())
741  {
742  imageHeaderProperties->setProperty("tgtid", value);
743  }
744  value = imageHeader->getPropertyValueAsString("isclas");
745  if(value.size())
746  {
747  imageHeaderProperties->setProperty("isclas", value);
748  }
749  value = imageHeader->getPropertyValueAsString("igeolo");
750  if(value.size())
751  {
752  imageHeaderProperties->setProperty("igeolo", value);
753  }
754  value = imageHeader->getPropertyValueAsString("ititle");
755  if(nitf21Flag)
756  {
757  value = imageHeader->getPropertyValueAsString("iid2");
758  }
759  if(value.size())
760  {
761  imageHeaderProperties->setProperty("ititle", value);
762  }
763  if(!nitf21Flag)
764  {
765  value = imageHeader->getPropertyValueAsString("iscaut");
766  if(value.size())
767  {
768  imageHeaderProperties->setProperty("iscaut", value);
769  }
770  value = imageHeader->getPropertyValueAsString("iscode");
771  if(value.size())
772  {
773  imageHeaderProperties->setProperty("iscode", value);
774  }
775  value = imageHeader->getPropertyValueAsString("isctlh");
776  if(value.size())
777  {
778  imageHeaderProperties->setProperty("isctlh", value);
779  }
780  value = imageHeader->getPropertyValueAsString("isrel");
781  if(value.size())
782  {
783  imageHeaderProperties->setProperty("isrel", value);
784  }
785  value = imageHeader->getPropertyValueAsString("isctln");
786  if(value.size())
787  {
788  imageHeaderProperties->setProperty("isctln", value);
789  }
790  value = imageHeader->getPropertyValueAsString("isdwng");
791  if(value.size())
792  {
793  imageHeaderProperties->setProperty("isdevt", value);
794  }
795  value = imageHeader->getPropertyValueAsString("isorce");
796  if(value.size())
797  {
798  imageHeaderProperties->setProperty("isorce", value);
799  }
800  }
801  value = imageHeader->getPropertyValueAsString("idatim");
802  if(value.size()==14)
803  {
804  if(nitf21Flag)
805  {
806  ossimString year(value.begin()+2, value.begin()+4);
807  ossimString mon(value.begin()+4, value.begin()+6);
808  ossimString day(value.begin()+6, value.begin()+8);
809  ossimString hour(value.begin()+8, value.begin()+10);
810  ossimString min(value.begin()+10, value.begin()+12);
811  ossimString sec(value.begin()+12, value.begin()+14);
812  if(mon.toUInt32() < 13)
813  {
814  mon = monthConversionTable[mon.toUInt32()];
815  }
816  imageHeaderProperties->setProperty("idatim", day+hour+min+sec+"Z"+mon+year);
817  }
818  else
819  {
820  imageHeaderProperties->setProperty("idatim", value);
821  }
822  }
823  }
824 
825  // we will port over only a selected few
826  }
827  }
828 }
void setDate(const ossimLocalTm &d)
Sets field FDT.
bool valid() const
Definition: ossimRefPtr.h:75
bool contains(char aChar) const
Definition: ossimString.h:58
bool theCopyFieldsFlag
If true this will enable searching the input connnection for another NITF handler and bring the field...
virtual void addTag(const ossimNitfTagInformation &tag, bool unique=true)
virtual ossim_uint32 getNumberOfTags() const
virtual bool getTagInformation(ossimNitfTagInformation &tag, int idx) const
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
std::string::size_type size() const
Definition: ossimString.h:405
std::string::iterator begin()
Definition: ossimString.h:420
unsigned int ossim_uint32
const ossimNitfImageHeader * getCurrentImageHeader() const
const ossimNitfFileHeader * getFileHeader() const
virtual bool getTagInformation(ossimNitfTagInformation &tagInfo, ossim_uint32 idx) const
virtual void setProperty(const ossimString &name, const ossimString &value)
virtual void accept(ossimVisitor &visitor)
We will add a visitor interface for all connectable objects.
virtual int getNumberOfTags() const
virtual ossimString getPropertyValueAsString(const ossimString &name) const
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader
void addTag(const ossimNitfTagInformation &tag, bool unique=true)
#define min(a, b)
Definition: auxiliary.h:75

◆ close()

void ossimNitf20Writer::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 110 of file ossimNitf20Writer.cpp.

References theOutputStream.

Referenced by open(), and ~ossimNitf20Writer().

111 {
112  if(theOutputStream)
113  {
114  theOutputStream->close();
115  delete theOutputStream;
117  }
118 }
std::ofstream * theOutputStream
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47

◆ getImageTypeList()

void ossimNitf20Writer::getImageTypeList ( std::vector< ossimString > &  imageTypeList) const
virtual

void getImageTypeList(std::vector<ossimString>& imageTypeList)const

Appends this writer image types to list "imageTypeList".

This writer has the following types: nitf_block_band_separate nitf_block_band_sequential

Parameters
imageTypeListstl::vector<ossimString> list to append to.

Implements ossimImageFileWriter.

Definition at line 165 of file ossimNitf20Writer.cpp.

166 {
167  imageTypeList.push_back(ossimString("nitf20_block_band_separate"));
168  imageTypeList.push_back(ossimString("nitf20_block_band_sequential"));
169 }

◆ getProperty()

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

Gets a property.

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

Reimplemented from ossimNitfWriterBase.

Definition at line 220 of file ossimNitf20Writer.cpp.

References ossimContainerProperty::addChildren(), ossimImageFileWriter::getProperty(), ossimPropertyInterface::getPropertyList(), theCopyFieldsFlag, theEnableBlockaTagFlag, theEnableRpcbTagFlag, theFileHeader, and theImageHeader.

221 {
222  ossimRefPtr<ossimProperty> result = 0;
223 
224  if(name == "file_header")
225  {
226  ossimContainerProperty* container = new ossimContainerProperty(name);
227  std::vector<ossimRefPtr<ossimProperty> > propertyList;
228 
229  theFileHeader->getPropertyList(propertyList);
230  container->addChildren(propertyList);
231 
232  result = container;
233  }
234  else if(name == "image_header")
235  {
236  ossimContainerProperty* container = new ossimContainerProperty(name);
237  std::vector<ossimRefPtr<ossimProperty> > propertyList;
238 
239  theImageHeader->getPropertyList(propertyList);
240  container->addChildren(propertyList);
241 
242  result = container;
243  }
244  else if(name == "enable_rpcb_tag")
245  {
246  ossimBooleanProperty* boolProperty =
248 
249  result = boolProperty;
250  }
251  else if(name == "enable_blocka_tag")
252  {
253  ossimBooleanProperty* boolProperty =
255 
256  result = boolProperty;
257  }
258  else if(name == "copy_fields_flag")
259  {
260  ossimBooleanProperty* boolProperty =
262 
263  result = boolProperty;
264  }
265  else
266  {
268  }
269 
270  return result;
271 }
void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.
bool theCopyFieldsFlag
If true this will enable searching the input connnection for another NITF handler and bring the field...
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual void addChildren(std::vector< ossimRefPtr< ossimProperty > > &propertyList)
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader

◆ getPropertyNames()

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

Reimplemented from ossimNitfWriterBase.

Definition at line 273 of file ossimNitf20Writer.cpp.

References ossimImageFileWriter::getPropertyNames().

274 {
276 
277  propertyNames.push_back("file_header");
278  propertyNames.push_back("image_header");
279  propertyNames.push_back("enable_rpcb_tag");
280  propertyNames.push_back("enable_blocka_tag");
281  propertyNames.push_back("copy_fields_flag");
282 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const

◆ isOpen()

bool ossimNitf20Writer::isOpen ( ) const
virtual

Implements ossimOutputSource.

Definition at line 93 of file ossimNitf20Writer.cpp.

References theOutputStream.

Referenced by open(), and writeFile().

94 {
95  return (theOutputStream != 0);
96 }
std::ofstream * theOutputStream

◆ loadState()

bool ossimNitf20Writer::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.

Reimplemented from ossimNitfWriterBase.

Definition at line 836 of file ossimNitf20Writer.cpp.

References ossimNitfWriterBase::loadState().

838 {
839  return ossimNitfWriterBase::loadState(kwl, prefix);
840 }
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::...

◆ open()

bool ossimNitf20Writer::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 98 of file ossimNitf20Writer.cpp.

References ossimString::c_str(), close(), isOpen(), ossimImageFileWriter::theFilename, and theOutputStream.

Referenced by writeFile().

99 {
100  if(isOpen())
101  {
102  close();
103  }
105  theOutputStream->open(theFilename.c_str(), ios::out|ios::binary);
106 
107  return theOutputStream->good();
108 }
virtual bool isOpen() 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
std::ofstream * theOutputStream
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47

◆ saveState()

bool ossimNitf20Writer::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.

Reimplemented from ossimNitfWriterBase.

Definition at line 830 of file ossimNitf20Writer.cpp.

References ossimNitfWriterBase::saveState().

832 {
833  return ossimNitfWriterBase::saveState(kwl, prefix);
834 }
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::saveStat...

◆ setProperty()

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

Set the properties.

Parameters
propertyThe property to set.

Reimplemented from ossimNitfWriterBase.

Definition at line 171 of file ossimNitf20Writer.cpp.

References ossimRefPtr< T >::get(), ossimContainerProperty::getPropertyList(), PTR_CAST, ossimPropertyInterface::setProperties(), ossimNitfImageHeaderV2_0::setProperty(), ossimNitfFileHeaderV2_0::setProperty(), ossimImageFileWriter::setProperty(), theCopyFieldsFlag, theEnableBlockaTagFlag, theEnableRpcbTagFlag, theFileHeader, and theImageHeader.

172 {
173  if(!property) return;
174 
175  ossimString name = property->getName();
176 
177  if(name == "file_header")
178  {
180  property.get());
181  if(containerProperty)
182  {
183  std::vector<ossimRefPtr<ossimProperty> > propertyList;
184  containerProperty->getPropertyList(propertyList);
185  theFileHeader->setProperties(propertyList);
186  }
187  }
188  else if(name == "image_header")
189  {
191  property.get());
192  if(containerProperty)
193  {
194  std::vector<ossimRefPtr<ossimProperty> > propertyList;
195  containerProperty->getPropertyList(propertyList);
196  theImageHeader->setProperties(propertyList);
197  }
198  }
199  else if (name == "enable_rpcb_tag")
200  {
201  theEnableRpcbTagFlag = property->valueToString().toBool();
202  }
203  else if (name == "enable_blocka_tag")
204  {
205  theEnableBlockaTagFlag = property->valueToString().toBool();
206  }
207  else if(name == "copy_fields_flag")
208  {
209  theCopyFieldsFlag = property->valueToString().toBool();
210  }
211  else
212  {
213  // just in case it was an nitf specific tag we can pass it safely like this
214  theFileHeader->setProperty(property);
215  theImageHeader->setProperty(property);
217  }
218 }
void setProperties(std::vector< ossimRefPtr< ossimProperty > > &propertyList)
virtual void getPropertyList(std::vector< ossimRefPtr< ossimProperty > > &children) const
bool theEnableRpcbTagFlag
If true user wants to set RPC00B tag.
bool theCopyFieldsFlag
If true this will enable searching the input connnection for another NITF handler and bring the field...
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
bool theEnableBlockaTagFlag
If true user wants to set BLOCKA tag.
virtual void setProperty(ossimRefPtr< ossimProperty > property)
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader

◆ writeBlockBandSeparate()

bool ossimNitf20Writer::writeBlockBandSeparate ( )
protectedvirtual

write out block band separate

Returns
true on success and false on error

Definition at line 284 of file ossimNitf20Writer.cpp.

References ossimNitfFileHeaderV2_0::addImageInfoRecord(), ossimRefPtr< T >::get(), ossim::getActualBitsPerPixel(), ossim::getBitsPerPixel(), ossimImageSourceSequencer::getBoundingRect(), ossimImageData::getBuf(), ossimImageData::getHeight(), ossimImageSourceSequencer::getNextTile(), ossimNitfCommon::getNitfPixelType(), ossimImageData::getNumberOfBands(), ossimImageSource::getNumberOfOutputBands(), ossimImageSourceSequencer::getNumberOfTiles(), ossimImageSourceSequencer::getOutputScalarType(), ossimRectilinearDataObject::getScalarType(), ossimImageData::getSizeInBytes(), ossimEndian::getSystemEndianType(), ossimImageData::getWidth(), ossimIrect::height(), ossimProcessInterface::needsAborting(), OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_LITTLE_ENDIAN, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, ossimNitfFileHeaderV2_0::replaceImageInfoRecord(), ossim::scalarSizeInBytes(), ossimNitfImageHeaderV2_X::setActualBitsPerPixel(), ossimNitfImageHeaderV2_0::setBandInfo(), ossimNitfImageBandV2_0::setBandRepresentation(), ossimNitfImageHeaderV2_X::setBitsPerPixel(), ossimNitfImageHeaderV2_X::setBlocksPerCol(), ossimNitfImageHeaderV2_X::setBlocksPerRow(), ossimNitfImageHeaderV2_X::setCategory(), ossimNitfWriterBase::setComplexityLevel(), ossimNitfFileHeaderV2_0::setFileLength(), ossimNitfFileHeaderV2_0::setHeaderLength(), ossimNitfImageInfoRecordV2_0::setImageLength(), ossimNitfImageHeaderV2_X::setImageMode(), ossimNitfImageHeaderV2_0::setNumberOfBands(), ossimNitfImageHeaderV2_0::setNumberOfCols(), ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockCol(), ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockRow(), ossimNitfImageHeaderV2_0::setNumberOfRows(), ossimImageFileWriter::setPercentComplete(), ossimNitfImageHeaderV2_X::setPixelType(), ossimNitfImageHeaderV2_X::setRepresentation(), ossimNitfImageInfoRecordV2_0::setSubheaderLength(), ossimImageSourceSequencer::setTileSize(), ossimImageSourceSequencer::setToStartOfSequence(), ossimEndian::swap(), theFileHeader, theImageHeader, ossimImageFileWriter::theInputConnection, theOutputStream, tileNumber, ossimRefPtr< T >::valid(), ossimIrect::width(), ossimNitfImageHeaderV2_0::writeStream(), ossimNitfFileHeaderV2_0::writeStream(), ossimIpt::x, and ossimIpt::y.

285 {
287  ossim_uint64 byteSize = ossim::scalarSizeInBytes(scalarType);
290  ossim_uint64 idx = 0;
291  ossim_uint64 headerStart = (ossim_uint64)theOutputStream->tellp();
292 
293  ossimIpt blockSize(64, 64);
294  ossim_uint64 blocksHorizontal = (ossim_uint32)ceil(((double)rect.width()/(double)blockSize.x));
295  ossim_uint64 blocksVertical = (ossim_uint32)ceil(((double)rect.height()/(double)blockSize.y));
296 
297  ossimNitfImageInfoRecordV2_0 imageInfoRecord;
298  //imageInfoRecord.setSubheaderLength(439); // ok if no tags
299  imageInfoRecord.setImageLength(bands*byteSize*blocksVertical*blockSize.y*blocksHorizontal*blockSize.x);
300 
301  theFileHeader->addImageInfoRecord(imageInfoRecord);
302 
303  //---
304  // This makes space for the file header; it is written again at the end of
305  // this method with updated values
306  // need a better way to get the length. This should be queried on the
307  // header before writing
308  //---
310  ossim_uint64 headerLength = ((ossim_uint64)theOutputStream->tellp() - headerStart) /* + 1 */;
311 
312  ossimString representation;
314  ossim::getActualBitsPerPixel(scalarType));
318  theImageHeader->setImageMode('B');// blocked
319 
320  if((bands == 3)&&
321  (scalarType == OSSIM_UCHAR))
322  {
324  theImageHeader->setCategory("VIS");
325  }
326  else if(bands == 1)
327  {
330  }
331  else
332  {
335  }
336 
337  theImageHeader->setBlocksPerRow(blocksHorizontal);
338  theImageHeader->setBlocksPerCol(blocksVertical);
343 
344  ossimNitfImageBandV2_0 bandInfo;
345  for(idx = 0; idx < bands; ++idx)
346  {
347  std::ostringstream out;
348 
349  out << std::setfill('0')
350  << std::setw(2)
351  << idx;
352 
353  bandInfo.setBandRepresentation(out.str().c_str());
355  bandInfo);
356  }
357 
358  ossim_uint64 imageHeaderStart = theOutputStream->tellp();
360  ossim_uint64 imageHeaderEnd = theOutputStream->tellp();
361  ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
362 
363  theInputConnection->setTileSize(blockSize);
368  ossimEndian endian;
369 
370 
371  while( data.valid() && !needsAborting())
372  {
374  {
375  switch(data->getScalarType())
376  {
377  case OSSIM_USHORT16:
378  case OSSIM_USHORT11:
379  case OSSIM_USHORT12:
380  case OSSIM_USHORT13:
381  case OSSIM_USHORT14:
382  case OSSIM_USHORT15:
383  {
384  endian.swap((ossim_uint16*)data->getBuf(),
385  data->getWidth()*data->getHeight()*data->getNumberOfBands());
386  break;
387  }
388  case OSSIM_SSHORT16:
389  {
390  endian.swap((ossim_sint16*)data->getBuf(),
391  data->getWidth()*data->getHeight()*data->getNumberOfBands());
392  break;
393  }
394  case OSSIM_FLOAT:
396  {
397  endian.swap((ossim_float32*)data->getBuf(),
398  data->getWidth()*data->getHeight()*data->getNumberOfBands());
399  break;
400  }
401  case OSSIM_DOUBLE:
403  {
404  endian.swap((ossim_float64*)data->getBuf(),
405  data->getWidth()*data->getHeight()*data->getNumberOfBands());
406  break;
407  }
408  default:
409  break;
410  }
411  }
412 
413  theOutputStream->write((char*)(data->getBuf()),
414  data->getSizeInBytes());
415 
416  setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
417 
418  if(!needsAborting())
419  {
421  }
422  ++tileNumber;
423  }
424 
425  std::streamoff pos = theOutputStream->tellp();
426 
428 
429  /*
430  * Need to change the way I compute file length and header length later
431  * We need to figure out a better way to compute.
432  */
433  theFileHeader->setFileLength(static_cast<ossim_uint64>(pos));
434  theFileHeader->setHeaderLength(headerLength);
435  theOutputStream->seekp(0, ios::beg);
436  imageInfoRecord.setSubheaderLength(imageHeaderSize);
437  theFileHeader->replaceImageInfoRecord(0, imageInfoRecord);
439 
440  return true;
441 }
16 bit unsigned integer (15 bits used)
virtual ossim_uint32 getWidth() const
virtual void setNumberOfCols(ossim_uint32 cols)
void setPixelType(const ossimString &pixelType=ossimString("INT"))
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual ossim_uint32 getNumberOfBands() const
virtual void writeStream(ossim::ostream &out)
void setNumberOfPixelsPerBlockRow(ossim_uint32 pixels)
void setActualBitsPerPixel(ossim_uint32 bitsPerPixel)
ossim_uint32 tileNumber
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
virtual void replaceImageInfoRecord(ossim_uint32 i, const ossimNitfImageInfoRecordV2_0 &recordInfo)
float ossim_float32
ossim_uint32 height() const
Definition: ossimIrect.h:487
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 resLevel=0)
static ossimString getNitfPixelType(ossimScalarType scalarType)
Get the nitf pixel type string from scalar type.
void setSubheaderLength(ossim_uint32 length)
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType)
Get actual bits per pixel for a given scalar type.
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
virtual void setHeaderLength(ossim_uint64 headerLength)
Sets header length (HL) field.
virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_0 &recordInfo)
void setBitsPerPixel(ossim_uint32 bitsPerPixel)
double ossim_float64
void setBlocksPerRow(ossim_uint32 blocks)
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
virtual void setNumberOfBands(ossim_uint32 nbands)
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.
virtual void setBandInfo(ossim_uint32 idx, const ossimNitfImageBandV2_0 &info)
signed short ossim_sint16
void setCategory(const ossimString &category)
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
unsigned long long ossim_uint64
unsigned int ossim_uint32
32 bit normalized floating point
virtual void setFileLength(ossim_uint64 fileLength)
Sets file length (FL) field.
OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType)
void setNumberOfPixelsPerBlockCol(ossim_uint32 pixels)
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
virtual void writeStream(ossim::ostream &out)
ossimScalarType
OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType)
Get bits per pixel for a given scalar type.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
void setBlocksPerCol(ossim_uint32 blocks)
void setRepresentation(const ossimString &rep)
virtual void setNumberOfRows(ossim_uint32 rows)
void setImageLength(ossim_uint64 length)
virtual const void * getBuf() const
void setComplexityLevel(std::streamoff, ossimNitfFileHeaderV2_X *hdr)
Sets the complexity level of theFileHeader.
std::ofstream * theOutputStream
virtual void setBandRepresentation(const ossimString &rep)
Sets the band representation.
virtual void setPercentComplete(double percentComplete)
virtual void setTileSize(const ossimIpt &tileSize)
32 bit floating point
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader
8 bit unsigned iteger
16 bit unsigned integer (12 bits used)

◆ writeBlockBandSequential()

bool ossimNitf20Writer::writeBlockBandSequential ( )
protectedvirtual

Outputs in band sequential format.

Band 1 is followed by band 2, ... etc.

Definition at line 443 of file ossimNitf20Writer.cpp.

References ossimNitfFileHeaderV2_0::addImageInfoRecord(), ossimRefPtr< T >::get(), ossim::getActualBitsPerPixel(), ossim::getBitsPerPixel(), ossimImageSourceSequencer::getBoundingRect(), ossimImageData::getBuf(), ossimImageData::getHeight(), ossimImageSourceSequencer::getNextTile(), ossimNitfCommon::getNitfPixelType(), ossimImageData::getNumberOfBands(), ossimImageSource::getNumberOfOutputBands(), ossimImageSourceSequencer::getNumberOfTiles(), ossimImageSourceSequencer::getNumberOfTilesHorizontal(), ossimImageSourceSequencer::getNumberOfTilesVertical(), ossimImageSourceSequencer::getOutputScalarType(), ossimRectilinearDataObject::getScalarType(), ossimEndian::getSystemEndianType(), ossimImageData::getWidth(), ossimIrect::height(), ossimProcessInterface::needsAborting(), OSSIM_DOUBLE, OSSIM_FLOAT, OSSIM_LITTLE_ENDIAN, OSSIM_NORMALIZED_DOUBLE, OSSIM_NORMALIZED_FLOAT, OSSIM_SSHORT16, OSSIM_UCHAR, OSSIM_USHORT11, OSSIM_USHORT12, OSSIM_USHORT13, OSSIM_USHORT14, OSSIM_USHORT15, OSSIM_USHORT16, ossimNitfFileHeaderV2_0::replaceImageInfoRecord(), ossim::scalarSizeInBytes(), ossimNitfImageHeaderV2_X::setActualBitsPerPixel(), ossimNitfImageHeaderV2_0::setBandInfo(), ossimNitfImageBandV2_0::setBandRepresentation(), ossimNitfImageHeaderV2_X::setBitsPerPixel(), ossimNitfImageHeaderV2_X::setBlocksPerCol(), ossimNitfImageHeaderV2_X::setBlocksPerRow(), ossimNitfImageHeaderV2_X::setCategory(), ossimNitfWriterBase::setComplexityLevel(), ossimNitfFileHeaderV2_X::setDate(), ossimNitfFileHeaderV2_0::setFileLength(), ossimNitfFileHeaderV2_0::setHeaderLength(), ossimNitfImageInfoRecordV2_0::setImageLength(), ossimNitfImageHeaderV2_X::setImageMode(), ossimNitfImageHeaderV2_0::setNumberOfBands(), ossimNitfImageHeaderV2_0::setNumberOfCols(), ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockCol(), ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockRow(), ossimNitfImageHeaderV2_0::setNumberOfRows(), ossimImageFileWriter::setPercentComplete(), ossimNitfImageHeaderV2_X::setPixelType(), ossimNitfImageHeaderV2_X::setRepresentation(), ossimNitfImageInfoRecordV2_0::setSubheaderLength(), ossimImageSourceSequencer::setTileSize(), ossimImageSourceSequencer::setToStartOfSequence(), ossimEndian::swap(), theFileHeader, theImageHeader, ossimImageFileWriter::theInputConnection, theOutputStream, tileNumber, ossimRefPtr< T >::valid(), ossimIrect::width(), ossimNitfImageHeaderV2_0::writeStream(), ossimNitfFileHeaderV2_0::writeStream(), ossimIpt::x, and ossimIpt::y.

444 {
446  ossim_uint64 byteSize = ossim::scalarSizeInBytes(scalarType);
449  ossim_uint64 idx = 0;
450  ossim_uint64 headerStart = (ossim_uint64)theOutputStream->tellp();
451 
452  ossimIpt blockSize(64, 64);
453 
456  theInputConnection->setTileSize(blockSize);
459 
460  ossimNitfImageInfoRecordV2_0 imageInfoRecord;
461  // imageInfoRecord.setSubheaderLength(439);
462  imageInfoRecord.setImageLength(bands*byteSize*blocksHorizontal*blocksVertical*blockSize.x*blockSize.y);
463 
464  ossimDate currentDate;
465 
466  theFileHeader->setDate(currentDate);
467  theFileHeader->addImageInfoRecord(imageInfoRecord);
468 
469  //---
470  // This makes space for the file header; it is written again at the end of
471  // this method with updated values
472  // need a better way to get the length. This should be queried on the
473  // header before writing
474  //---
476  ossim_uint64 headerLength = ((ossim_uint64)theOutputStream->tellp() - headerStart) /* + 1 */;
477 
478  ossimString representation;
480  ossim::getActualBitsPerPixel(scalarType));
484  theImageHeader->setImageMode('S');// blocked
485 
486  if((bands == 3)&&
487  (scalarType == OSSIM_UCHAR))
488  {
490  theImageHeader->setCategory("VIS");
491  }
492  else if(bands == 1)
493  {
496  }
497  else
498  {
501  }
502  theImageHeader->setBlocksPerRow(blocksHorizontal);
503  theImageHeader->setBlocksPerCol(blocksVertical);
508 
509  ossimNitfImageBandV2_0 bandInfo;
510  for(idx = 0; idx < bands; ++idx)
511  {
512  std::ostringstream out;
513 
514  out << std::setfill('0')
515  << std::setw(2)
516  << idx;
517 
518  bandInfo.setBandRepresentation(out.str().c_str());
520  bandInfo);
521  }
522 
523  int imageHeaderStart = theOutputStream->tellp();
525  int imageHeaderEnd = theOutputStream->tellp();
526  int imageHeaderSize = imageHeaderEnd - imageHeaderStart;
527 
528  // ossimIpt ul = rect.ul();
531  ossimEndian endian;
532 
533  // get the start to the first band of data block
534  //
535  ossim_uint64 streamOffset = theOutputStream->tellp();
536 
537  // holds the total pixels to the next band
538 
539  ossim_uint64 blockSizeInBytes = blockSize.x*blockSize.y*ossim::scalarSizeInBytes(data->getScalarType());
540  ossim_uint64 bandOffsetInBytes = (blockSizeInBytes*blocksHorizontal*blocksVertical);
541 
542  bool needSwapping = endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN;
543  while(data.valid() && !needsAborting())
544  {
545  if(needSwapping)
546  {
547  switch(data->getScalarType())
548  {
549  case OSSIM_USHORT16:
550  case OSSIM_USHORT11:
551  case OSSIM_USHORT12:
552  case OSSIM_USHORT13:
553  case OSSIM_USHORT14:
554  case OSSIM_USHORT15:
555  {
556  endian.swap((ossim_uint16*)data->getBuf(),
557  data->getWidth()*data->getHeight()*data->getNumberOfBands());
558  break;
559  }
560  case OSSIM_SSHORT16:
561  {
562  endian.swap((ossim_sint16*)data->getBuf(),
563  data->getWidth()*data->getHeight()*data->getNumberOfBands());
564  break;
565  }
566  case OSSIM_FLOAT:
568  {
569  endian.swap((ossim_float32*)data->getBuf(),
570  data->getWidth()*data->getHeight()*data->getNumberOfBands());
571  break;
572  }
573  case OSSIM_DOUBLE:
575  {
576  endian.swap((ossim_float64*)data->getBuf(),
577  data->getWidth()*data->getHeight()*data->getNumberOfBands());
578  break;
579  }
580  default:
581  break;
582  }
583  }
584 
585  for(idx = 0; idx < bands; ++idx)
586  {
587  theOutputStream->seekp(streamOffset+ // start of image stream
588  tileNumber*blockSizeInBytes + // start of block for band separate output
589  bandOffsetInBytes*idx, // which band offset is it
590  ios::beg);
591 
592  theOutputStream->write((char*)(data->getBuf(idx)),
593  blockSizeInBytes);
594  }
595  ++tileNumber;
596 
597  setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
598 
599  if(!needsAborting())
600  {
602  }
603  }
604 
605  std::streamoff pos = theOutputStream->tellp();
606 
608 
609  /*
610  * Need to change the way I compute file length and header length later
611  * We need to figure out a better way to compute.
612  */
613  theFileHeader->setFileLength(static_cast<ossim_uint64>(pos));
614  theFileHeader->setHeaderLength(headerLength);
615  theOutputStream->seekp(0, ios::beg);
616  imageInfoRecord.setSubheaderLength(imageHeaderSize);
617  theFileHeader->replaceImageInfoRecord(0, imageInfoRecord);
619 
620  return true;
621 }
16 bit unsigned integer (15 bits used)
virtual ossim_uint32 getWidth() const
virtual void setNumberOfCols(ossim_uint32 cols)
void setPixelType(const ossimString &pixelType=ossimString("INT"))
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
virtual ossim_uint32 getNumberOfBands() const
virtual void writeStream(ossim::ostream &out)
void setNumberOfPixelsPerBlockRow(ossim_uint32 pixels)
void setActualBitsPerPixel(ossim_uint32 bitsPerPixel)
ossim_uint32 tileNumber
void setDate(const ossimLocalTm &d)
Sets field FDT.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
bool valid() const
Definition: ossimRefPtr.h:75
virtual void replaceImageInfoRecord(ossim_uint32 i, const ossimNitfImageInfoRecordV2_0 &recordInfo)
float ossim_float32
ossim_uint32 height() const
Definition: ossimIrect.h:487
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 resLevel=0)
static ossimString getNitfPixelType(ossimScalarType scalarType)
Get the nitf pixel type string from scalar type.
void setSubheaderLength(ossim_uint32 length)
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType)
Get actual bits per pixel for a given scalar type.
16 bit unsigned integer (13 bits used)
unsigned short ossim_uint16
virtual void setHeaderLength(ossim_uint64 headerLength)
Sets header length (HL) field.
virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_0 &recordInfo)
void setBitsPerPixel(ossim_uint32 bitsPerPixel)
double ossim_float64
void setBlocksPerRow(ossim_uint32 blocks)
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossimRefPtr< ossimNitfFileHeaderV2_0 > theFileHeader
virtual void setNumberOfBands(ossim_uint32 nbands)
virtual void setBandInfo(ossim_uint32 idx, const ossimNitfImageBandV2_0 &info)
signed short ossim_sint16
void setCategory(const ossimString &category)
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
unsigned long long ossim_uint64
32 bit normalized floating point
virtual void setFileLength(ossim_uint64 fileLength)
Sets file length (FL) field.
OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType)
void setNumberOfPixelsPerBlockCol(ossim_uint32 pixels)
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossimByteOrder getSystemEndianType() const
Definition: ossimEndian.h:78
virtual void writeStream(ossim::ostream &out)
ossimScalarType
OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType)
Get bits per pixel for a given scalar type.
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
ossim_int64 getNumberOfTilesHorizontal() const
void setBlocksPerCol(ossim_uint32 blocks)
void setRepresentation(const ossimString &rep)
virtual void setNumberOfRows(ossim_uint32 rows)
void setImageLength(ossim_uint64 length)
virtual const void * getBuf() const
void setComplexityLevel(std::streamoff, ossimNitfFileHeaderV2_X *hdr)
Sets the complexity level of theFileHeader.
std::ofstream * theOutputStream
virtual void setBandRepresentation(const ossimString &rep)
Sets the band representation.
virtual void setPercentComplete(double percentComplete)
virtual void setTileSize(const ossimIpt &tileSize)
32 bit floating point
void swap(ossim_sint8 &)
Definition: ossimEndian.h:26
16 bit unsigned iteger
64 bit floating point
16 bit signed integer
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader
ossim_int64 getNumberOfTilesVertical() const
8 bit unsigned iteger
16 bit unsigned integer (12 bits used)

◆ writeFile()

bool ossimNitf20Writer::writeFile ( )
protectedvirtual
Returns
true on success false on error.

Implements ossimImageFileWriter.

Definition at line 120 of file ossimNitf20Writer.cpp.

References ossimImageSourceSequencer::isMaster(), isOpen(), open(), ossimImageSourceSequencer::slaveProcessTiles(), and ossimImageFileWriter::theInputConnection.

121 {
123  {
125 
126  return true;
127  }
128 
129  open();
130 
131  if (!isOpen())
132  {
133  if (traceDebug())
134  {
136  << "ossimNitf20Writer::writeFile ERROR:"
137  << " Could not open! Returning..."
138  << std::endl;
139  }
140 
141  return false;
142  }
143 
144  // Write out the geometry info.
146 
147  addTags();
148 
149  bool result = false;
150  if((theOutputImageType == "nitf20_block_band_separate")||
151  (theOutputImageType == "image/nitf20"))
152  {
153  result = writeBlockBandSeparate();
154  }
155  else if(theOutputImageType == "nitf20_block_band_sequential")
156  {
157  result = writeBlockBandSequential();
158  }
159 
160  close();
161 
162  return result;
163 }
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual bool isOpen() const
void writeGeometry(ossimNitfImageHeaderV2_X *hdr, ossimImageSourceSequencer *seq)
Populates tags with geometry info from projection.
virtual bool writeBlockBandSequential()
Outputs in band sequential format.
ossimRefPtr< ossimNitfImageHeaderV2_0 > theImageHeader
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
virtual bool writeBlockBandSeparate()
write out block band separate

Member Data Documentation

◆ theCopyFieldsFlag

bool ossimNitf20Writer::theCopyFieldsFlag
protected

If true this will enable searching the input connnection for another NITF handler and bring the fields to this writers output fields and will maintin as many field values as possible.

Definition at line 130 of file ossimNitf20Writer.h.

Referenced by addTags(), getProperty(), and setProperty().

◆ theEnableBlockaTagFlag

bool ossimNitf20Writer::theEnableBlockaTagFlag
protected

If true user wants to set BLOCKA tag.

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

Definition at line 122 of file ossimNitf20Writer.h.

Referenced by getProperty(), and setProperty().

◆ theEnableRpcbTagFlag

bool ossimNitf20Writer::theEnableRpcbTagFlag
protected

If true user wants to set RPC00B tag.

(DEFAULT = false)

Definition at line 116 of file ossimNitf20Writer.h.

Referenced by getProperty(), and setProperty().

◆ theFileHeader

ossimRefPtr<ossimNitfFileHeaderV2_0> ossimNitf20Writer::theFileHeader
protected

◆ theImageHeader

ossimRefPtr<ossimNitfImageHeaderV2_0> ossimNitf20Writer::theImageHeader
protected

◆ theOutputStream

std::ofstream* ossimNitf20Writer::theOutputStream
protected

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