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

#include <ossimKakaduJp2Writer.h>

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

Public Member Functions

 ossimKakaduJp2Writer ()
 default constructor More...
 
virtual ~ossimKakaduJp2Writer ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual void getImageTypeList (std::vector< ossimString > &imageTypeList) const
 Appends this writer image types to list "imageTypeList". More...
 
virtual bool isOpen () const
 
virtual bool open ()
 
virtual void close ()
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 saves the state of the object. More...
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 Will set the property whose name matches the argument "property->getName()". More...
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 Pushes this's names onto the list of property names. 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 bool getOutputHasInternalOverviews (void) const
 Examples of writers that always generate internal overviews are ossim_kakadu_jp2 and ossim_kakadu_nitf_j2k. More...
 
bool hasImageType (const ossimString &imageType) const
 bool hasImageType(const ossimString& imageType) const More...
 
virtual bool writeStream ()
 Method to write the image to a stream. More...
 
virtual bool setOutputStream (std::ostream &stream)
 Sets the output stream to write to. More...
 
- Public Member Functions inherited from ossimImageFileWriter
 ossimImageFileWriter (const ossimFilename &filename=ossimFilename(), ossimImageSource *inputSource=0, ossimObject *owner=0)
 The writer will own the sequencer. More...
 
virtual ~ossimImageFileWriter ()
 
virtual ossimObjectgetObject ()
 
virtual const ossimObjectgetObject () const
 
virtual void 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 setOutputStream (ossimRefPtr< ossimOStream > stream)
 Sets the output stream to write to. 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 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 ()
 Writes the file to disk or a stream. 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)
 

Private Member Functions

bool writeGeotiffBox (ossimKakaduCompressor *compressor)
 Writes geotiff box if input has good geometry. More...
 
bool writeGmlBox (ossimKakaduCompressor *compressor)
 Writes GML box if input has good geometry. More...
 

Private Attributes

ossimKakaduCompressorm_compressor
 
std::ostream * m_outputStream
 
bool m_ownsStreamFlag
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 
- Public Types inherited from ossimProcessInterface
enum  ossimProcessStatus {
  PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3,
  PROCESS_STATUS_NOT_EXECUTING = 4
}
 
- Protected Attributes inherited from ossimImageFileWriter
ossimRefPtr< ossimImageSourceSequencertheInputConnection
 
ossimRefPtr< ossimViewControllertheViewController
 
ossimListenertheProgressListener
 
ossimFilename theFilename
 
ossimString theOutputImageType
 
bool theWriteImageFlag
 
bool theWriteOverviewFlag
 
bool theWriteHistogramFlag
 
bool theScaleToEightBitFlag
 
ossim_uint16 theOverviewCompressType
 
ossim_int32 theOverviewJpegCompressQuality
 
bool theWriteEnviHeaderFlag
 External meta data writer flags. More...
 
bool theWriteErsHeaderFlag
 
bool theWriteExternalGeometryFlag
 
bool theWriteFgdcFlag
 
bool theWriteJpegWorldFileFlag
 
bool theWriteReadmeFlag
 
bool theWriteTiffWorldFileFlag
 
bool theWriteWorldFileFlag
 
bool theAutoCreateDirectoryFlag
 
ossimUnitType theLinearUnits
 If not a geographic projection this allows the user to set the linear units of the output tag to be: More...
 
ossimPixelType thePixelType
 OSSIM_PIXEL_IS_POINT = 0, OSSIM_PIXEL_IS_AREA = 1. More...
 
- Protected Attributes inherited from ossimImageWriter
ossimIrect theAreaOfInterest
 
- Protected Attributes inherited from ossimOutputSource
ossimString theOutputName
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 
- Protected Attributes inherited from ossimProcessInterface
double thePercentComplete
 
ossimProcessStatus theProcessStatus
 
ossimString theMessage
 
bool theEventFlag
 
- Protected Attributes inherited from ossimListener
bool theListenerEnableFlag
 

Detailed Description

Definition at line 24 of file ossimKakaduJp2Writer.h.

Constructor & Destructor Documentation

◆ ossimKakaduJp2Writer()

ossimKakaduJp2Writer::ossimKakaduJp2Writer ( )

default constructor

Definition at line 55 of file ossimKakaduJp2Writer.cpp.

58  m_outputStream(0),
59  m_ownsStreamFlag(false)
60 {
61  if (traceDebug())
62  {
64  << "ossimKakaduJp2Writer::ossimKakaduJp2Writer entered"
65  << std::endl;
66 #if OSSIM_ID_ENABLED
68  << "OSSIM_ID: "
69  << OSSIM_ID
70  << std::endl;
71 #endif
72  }
73 
74  // Set the output image type in the base class.
76 }
virtual void setOutputImageType(ossim_int32 type)
virtual ossimString getShortName() const
ossimImageFileWriter(const ossimFilename &filename=ossimFilename(), ossimImageSource *inputSource=0, ossimObject *owner=0)
The writer will own the sequencer.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossimKakaduCompressor * m_compressor

◆ ~ossimKakaduJp2Writer()

ossimKakaduJp2Writer::~ossimKakaduJp2Writer ( )
virtual

Definition at line 78 of file ossimKakaduJp2Writer.cpp.

References close(), and m_compressor.

79 {
80  // This will flush stream and delete it if we own it.
81  close();
82 
83  if (m_compressor)
84  {
85  delete m_compressor;
86  m_compressor = 0;
87  }
88 }
ossimKakaduCompressor * m_compressor

Member Function Documentation

◆ close()

void ossimKakaduJp2Writer::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 386 of file ossimKakaduJp2Writer.cpp.

References m_outputStream, and m_ownsStreamFlag.

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

387 {
388  if (m_outputStream)
389  {
390  m_outputStream->flush();
391  if (m_ownsStreamFlag)
392  {
393  delete m_outputStream;
394  m_outputStream = 0;
395  m_ownsStreamFlag = false;
396  }
397  }
398 }

◆ getClassName()

ossimString ossimKakaduJp2Writer::getClassName ( ) const
virtual
Returns
"ossimKakaduJp2Writer"

Reimplemented from ossimObject.

Definition at line 100 of file ossimKakaduJp2Writer.cpp.

101 {
102  return ossimString("ossimKakaduJp2Writer");
103 }

◆ getExtension()

ossimString ossimKakaduJp2Writer::getExtension ( ) const
virtual

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

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

Reimplemented from ossimImageFileWriter.

Definition at line 405 of file ossimKakaduJp2Writer.cpp.

406 {
407  return ossimString("jp2");
408 }

◆ getImageTypeList()

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

Appends this writer image types to list "imageTypeList".

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

Implements ossimImageFileWriter.

Definition at line 400 of file ossimKakaduJp2Writer.cpp.

References getShortName().

401 {
402  imageTypeList.push_back(getShortName());
403 }
virtual ossimString getShortName() const

◆ getLongName()

ossimString ossimKakaduJp2Writer::getLongName ( ) const
virtual
Returns
"ossim kakadu jp2 writer"

Reimplemented from ossimObject.

Definition at line 95 of file ossimKakaduJp2Writer.cpp.

96 {
97  return ossimString("ossim kakadu jp2 writer");
98 }

◆ getOutputHasInternalOverviews()

bool ossimKakaduJp2Writer::getOutputHasInternalOverviews ( void  ) const
virtual

Examples of writers that always generate internal overviews are ossim_kakadu_jp2 and ossim_kakadu_nitf_j2k.

Returns
true if the output of the writer will have internal overviews. The default is false.

Reimplemented from ossimImageFileWriter.

Definition at line 410 of file ossimKakaduJp2Writer.cpp.

411 {
412  return true;
413 }

◆ getProperty()

ossimRefPtr< ossimProperty > ossimKakaduJp2Writer::getProperty ( const ossimString name) const
virtual
Parameters
nameName of property to return.
Returns
A pointer to a property object which matches "name".

Reimplemented from ossimImageFileWriter.

Definition at line 438 of file ossimKakaduJp2Writer.cpp.

References ossimKakaduCompressor::getProperty(), ossimImageFileWriter::getProperty(), and m_compressor.

440 {
442 
443  if ( !p )
444  {
446  }
447 
448  return p;
449 }
ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
ossimKakaduCompressor * m_compressor

◆ getPropertyNames()

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

Pushes this's names onto the list of property names.

Parameters
propertyNamesarray to add this's property names to.

Reimplemented from ossimImageFileWriter.

Definition at line 451 of file ossimKakaduJp2Writer.cpp.

References ossimKakaduCompressor::getPropertyNames(), ossimImageFileWriter::getPropertyNames(), and m_compressor.

453 {
454  m_compressor->getPropertyNames(propertyNames);
455 
457 }
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Pushes this&#39;s names onto the list of property names.
ossimKakaduCompressor * m_compressor

◆ getShortName()

ossimString ossimKakaduJp2Writer::getShortName ( ) const
virtual
Returns
"ossim_kakadu_jp2_writer"

Reimplemented from ossimObject.

Definition at line 90 of file ossimKakaduJp2Writer.cpp.

Referenced by getImageTypeList(), and hasImageType().

91 {
92  return ossimString("ossim_kakadu_jp2");
93 }

◆ hasImageType()

bool ossimKakaduJp2Writer::hasImageType ( const ossimString imageType) const
virtual

bool hasImageType(const ossimString& imageType) const

Parameters
imageTypestring representing image type.
Returns
true if "imageType" is supported by writer.

Reimplemented from ossimImageFileWriter.

Definition at line 415 of file ossimKakaduJp2Writer.cpp.

References getShortName().

416 {
417  bool result = false;
418  if ( (imageType == getShortName()) ||
419  (imageType == "image/jp2") )
420  {
421  result = true;
422  }
423  return result;
424 }
virtual ossimString getShortName() const

◆ isOpen()

bool ossimKakaduJp2Writer::isOpen ( ) const
virtual

Implements ossimOutputSource.

Definition at line 346 of file ossimKakaduJp2Writer.cpp.

References m_outputStream.

347 {
348  return (m_outputStream?true:false);
349 }

◆ loadState()

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

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

Return true if ok or false on error.

Reimplemented from ossimImageFileWriter.

Definition at line 338 of file ossimKakaduJp2Writer.cpp.

References ossimKakaduCompressor::loadState(), ossimImageFileWriter::loadState(), and m_compressor.

340 {
341  m_compressor->loadState(kwl, prefix);
342 
343  return ossimImageFileWriter::loadState(kwl, prefix);
344 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossimKakaduCompressor * m_compressor

◆ open()

bool ossimKakaduJp2Writer::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 351 of file ossimKakaduJp2Writer.cpp.

References ossimString::c_str(), close(), m_outputStream, m_ownsStreamFlag, ossimString::size(), and ossimImageFileWriter::theFilename.

352 {
353  bool result = false;
354 
355  close();
356 
357  // Check for empty filenames.
358  if (theFilename.size())
359  {
360  std::ofstream* os = new std::ofstream();
361  os->open(theFilename.c_str(), ios::out | ios::binary);
362  if(os->is_open())
363  {
364  m_outputStream = os;
365  m_ownsStreamFlag = true;
366  result = true;
367  }
368  else
369  {
370  delete os;
371  os = 0;
372  }
373  }
374 
375  if (traceDebug())
376  {
378  << "ossimKakaduJp2Writer::open()\n"
379  << "File " << theFilename << (result ? " opened" : " not opened")
380  << std::endl;
381  }
382 
383  return result;
384 }
std::string::size_type size() const
Definition: ossimString.h:405
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ saveState()

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

saves the state of the object.

Reimplemented from ossimImageFileWriter.

Definition at line 330 of file ossimKakaduJp2Writer.cpp.

References m_compressor, ossimKakaduCompressor::saveState(), and ossimImageFileWriter::saveState().

332 {
333  m_compressor->saveState(kwl, prefix);
334 
335  return ossimImageFileWriter::saveState(kwl, prefix);
336 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
saves the state of the object.
ossimKakaduCompressor * m_compressor

◆ setOutputStream()

bool ossimKakaduJp2Writer::setOutputStream ( std::ostream &  stream)
virtual

Sets the output stream to write to.

The stream will not be closed/deleted by this object.

Parameters
outputThe stream to write to.

Reimplemented from ossimImageFileWriter.

Definition at line 459 of file ossimKakaduJp2Writer.cpp.

References m_outputStream, and m_ownsStreamFlag.

460 {
462  {
463  delete m_outputStream;
464  }
465  m_outputStream = &stream;
466  m_ownsStreamFlag = false;
467  return true;
468 }

◆ setProperty()

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

Will set the property whose name matches the argument "property->getName()".

Parameters
propertyObject containing property to set.

Reimplemented from ossimImageFileWriter.

Definition at line 426 of file ossimKakaduJp2Writer.cpp.

References m_compressor, ossimKakaduCompressor::setProperty(), ossimImageFileWriter::setProperty(), and ossimRefPtr< T >::valid().

427 {
428  if ( property.valid() )
429  {
430  if ( m_compressor->setProperty(property) == false )
431  {
432  // Not a compressor property.
434  }
435  }
436 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool setProperty(ossimRefPtr< ossimProperty > property)
Will set the property whose name matches the argument "property->getName()".
virtual void setProperty(ossimRefPtr< ossimProperty > property)
ossimKakaduCompressor * m_compressor

◆ writeFile()

bool ossimKakaduJp2Writer::writeFile ( )
protectedvirtual

Writes the file to disk or a stream.

Returns
true on success, false on error.

Implements ossimImageFileWriter.

Definition at line 105 of file ossimKakaduJp2Writer.cpp.

References ossimErrorStatusInterface::getErrorStatus(), ossimErrorCodes::OSSIM_OK, ossimImageSourceSequencer::setTileSize(), ossimImageFileWriter::theInputConnection, and ossimRefPtr< T >::valid().

106 {
107  // This method is called from ossimImageFileWriter::execute().
108 
109  bool result = false;
110 
111  if( theInputConnection.valid() &&
113  {
114  // Set the tile size for all processes.
115  theInputConnection->setTileSize( DEFAULT_TILE_SIZE );
117 
118  //---
119  // Note only the master process used for writing...
120  //---
122  {
123  if (!isOpen())
124  {
125  open();
126  }
127 
128  if ( isOpen() )
129  {
130  result = writeStream();
131  }
132  }
133  else // Slave process.
134  {
135  // This will return after all tiles for this node have been processed.
137 
138  result = true;
139  }
140  }
141 
142  return result;
143 }
static const ossimErrorCode OSSIM_OK
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool writeStream()
Method to write the image to a stream.
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual bool isOpen() const
virtual ossimErrorCode getErrorStatus() const
virtual void setTileSize(const ossimIpt &tileSize)

◆ writeGeotiffBox()

bool ossimKakaduJp2Writer::writeGeotiffBox ( ossimKakaduCompressor compressor)
private

Writes geotiff box if input has good geometry.

Parameters
compressorWrites to this.
Returns
true on success, false on error.

Definition at line 283 of file ossimKakaduJp2Writer.cpp.

References ossimFilename::fileNoExtension(), ossimRefPtr< T >::get(), ossimImageSourceSequencer::getBoundingRect(), ossimImageSource::getImageGeometry(), ossimImageFileWriter::getPixelType(), ossimImageFileWriter::theFilename, ossimImageFileWriter::theInputConnection, ossimRefPtr< T >::valid(), and ossimKakaduCompressor::writeGeotiffBox().

284 {
285  bool result = false;
286 
287  if ( theInputConnection.valid() && compressor )
288  {
290  if ( geom.valid() )
291  {
292  //---
293  // Make a temp file. No means currently write a tiff straight to
294  // memory.
295  //---
297  tmpFile += "-tmp.tif";
298 
299  // Output rect.
301 
302  result = compressor->writeGeotiffBox(geom.get(), rect, tmpFile, getPixelType());
303  }
304  }
305 
306  return result;
307 
308 } // End: ossimKakaduJp2Writer::writeGeotffBox
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual ossimPixelType getPixelType() const
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...
bool writeGeotiffBox(const ossimImageGeometry *geom, const ossimIrect &rect, const ossimFilename &tmpFile, ossimPixelType pixelType)
Writes the geotiff box to the jp2.
ossimFilename fileNoExtension() const

◆ writeGmlBox()

bool ossimKakaduJp2Writer::writeGmlBox ( ossimKakaduCompressor compressor)
private

Writes GML box if input has good geometry.

Parameters
compressorWrites to this.
Returns
true on success, false on error.

Definition at line 310 of file ossimKakaduJp2Writer.cpp.

References ossimRefPtr< T >::get(), ossimImageSourceSequencer::getBoundingRect(), ossimImageSource::getImageGeometry(), ossimImageFileWriter::theInputConnection, ossimRefPtr< T >::valid(), and ossimKakaduCompressor::writeGmlBox().

311 {
312  bool result = false;
313 
314  if ( theInputConnection.valid() && compressor )
315  {
317  if ( geom.valid() )
318  {
319  // Output rect.
321 
322  result = compressor->writeGmlBox( geom.get(), rect );
323  }
324  }
325 
326  return result;
327 
328 } // End: ossimKakaduJp2Writer::writeGmlBox
bool writeGmlBox(const ossimImageGeometry *geom, const ossimIrect &rect)
Writes the GML box to the jp2.
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if not defined...

◆ writeStream()

bool ossimKakaduJp2Writer::writeStream ( )
virtual

Method to write the image to a stream.

Returns
true on success, false on error.

Reimplemented from ossimImageFileWriter.

Definition at line 145 of file ossimKakaduJp2Writer.cpp.

146 {
147  static const char MODULE[] = "ossimKakaduJp2Writer::writeStream";
148 
149  if (traceDebug())
150  {
152  << MODULE << " entered..." << endl;
153  }
154 
155  bool result = false;
156 
159  {
160  result = true; // Assuming good at this point...
161 
162  ossim_uint32 outputTilesWide =
164  ossim_uint32 outputTilesHigh =
166  ossim_uint32 numberOfTiles =
169 
170  if (traceDebug())
171  {
173  << MODULE << " DEBUG:"
174  << "\noutputTilesWide: " << outputTilesWide
175  << "\noutputTilesHigh: " << outputTilesHigh
176  << "\nnumberOfTiles: " << numberOfTiles
177  << "\nimageRect: " << theInputConnection->getAreaOfInterest()
178  << std::endl;
179  }
180 
182 
184 
185  // Create the compressor. Can through an exception.
186  try
187  {
189  scalarType,
190  BANDS,
192  DEFAULT_TILE_SIZE,
193  numberOfTiles,
194  true);
195  }
196  catch (const ossimException& e)
197  {
198  ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
199  return false;
200  }
201 
204 
206 
207  bool needAlpha = m_compressor->getAlphaChannelFlag();
208 
209  // Tile loop in the line direction.
210  for(ossim_uint32 y = 0; y < outputTilesHigh; ++y)
211  {
212  // Tile loop in the sample (width) direction.
213  for(ossim_uint32 x = 0; x < outputTilesWide; ++x)
214  {
215  // Grab the resampled tile.
217  if (t.valid() && ( t->getDataObjectStatus() != OSSIM_NULL ) )
218  {
219  if (needAlpha)
220  {
221  t->computeAlphaChannel();
222  }
223  if ( ! m_compressor->writeTile( *(t.get()) ) )
224  {
226  << MODULE << " ERROR:"
227  << "Error returned writing tile: "
228  << tileNumber
229  << std::endl;
230  result = false;
231  }
232  }
233  else
234  {
236  << MODULE << " ERROR:"
237  << "Error returned writing tile: " << tileNumber
238  << std::endl;
239  result = false;
240  }
241  if (result == false)
242  {
243  // This will bust out of both loops.
244  x = outputTilesWide;
245  y = outputTilesHigh;
246  }
247 
248  // Increment tile number for percent complete.
249  ++tileNumber;
250 
251  } // End of tile loop in the sample (width) direction.
252 
253  if (needsAborting())
254  {
255  setPercentComplete(100.0);
256  break;
257  }
258  else
259  {
260  ossim_float64 tile = tileNumber;
261  ossim_float64 numTiles = numberOfTiles;
262  setPercentComplete(tile / numTiles * 100.0);
263  }
264 
265  } // End of tile loop in the line (height) direction.
266 
267  m_compressor->finish();
268 
269  close();
270 
271  } // matches: if (theInputConnection.valid() ...
272 
273  if (traceDebug())
274  {
276  << MODULE << " exit status = " << (result?"true":"false\n")
277  << std::endl;
278  }
279 
280  return result;
281 }
ossim_uint32 x
virtual void create(ossim::ostream *os, ossimScalarType scalar, ossim_uint32 bands, const ossimIrect &imageRect, const ossimIpt &tileSize, ossim_uint32 tilesToWrite, bool jp2)
Create method.
virtual void computeAlphaChannel()
Computes the alpha channel.
ossim_uint32 tileNumber
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
virtual void finish()
Finish method.
virtual ossimRefPtr< ossimImageData > getNextTile(ossim_uint32 resLevel=0)
virtual ossimDataObjectStatus getDataObjectStatus() const
double ossim_float64
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
virtual const char * what() const
Returns the error message.
ossimRefPtr< ossimImageSourceSequencer > theInputConnection
unsigned int ossim_uint32
void openJp2Codestream()
Calls "open_codestream" on the m_jp2Target.
bool getAlphaChannelFlag() const
Retrieve the writer&#39;s setting for whether or not to add an alpha channel to the output png image...
ossimScalarType
virtual bool writeTile(ossimImageData &srcTile)
Write tile method.
ossim_int64 getNumberOfTilesHorizontal() const
bool writeGeotiffBox(ossimKakaduCompressor *compressor)
Writes geotiff box if input has good geometry.
const ossimIrect & getAreaOfInterest() const
virtual void setPercentComplete(double percentComplete)
bool writeGmlBox(ossimKakaduCompressor *compressor)
Writes GML box if input has good geometry.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
ossim_int64 getNumberOfTilesVertical() const
ossimKakaduCompressor * m_compressor

Member Data Documentation

◆ m_compressor

ossimKakaduCompressor* ossimKakaduJp2Writer::m_compressor
private

◆ m_outputStream

std::ostream* ossimKakaduJp2Writer::m_outputStream
private

Definition at line 152 of file ossimKakaduJp2Writer.h.

Referenced by close(), isOpen(), open(), and setOutputStream().

◆ m_ownsStreamFlag

bool ossimKakaduJp2Writer::m_ownsStreamFlag
private

Definition at line 153 of file ossimKakaduJp2Writer.h.

Referenced by close(), open(), and setOutputStream().


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