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

ossimKakaduNitfOverviewBuilder Class to build overviews from the Kakadu library. More...

#include <ossimKakaduNitfOverviewBuilder.h>

Inheritance diagram for ossimKakaduNitfOverviewBuilder:
ossimOverviewBuilderBase ossimSource ossimProcessInterface ossimConnectableObjectListener ossimConnectableObject ossimErrorStatusInterface ossimListener ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimKakaduNitfOverviewBuilder ()
 default constructor More...
 
virtual ~ossimKakaduNitfOverviewBuilder ()
 virtual destructor More...
 
virtual bool execute ()
 Builds the overviews. More...
 
virtual void setOutputFile (const ossimFilename &file)
 Sets the output filename. More...
 
virtual ossimFilename getOutputFile () const
 Returns the output. More...
 
virtual bool setOverviewType (const ossimString &type)
 Sets the overview output type. More...
 
virtual ossimString getOverviewType () const
 Gets the overview type. More...
 
virtual void getTypeNameList (std::vector< ossimString > &typeList) const
 Method to populate class supported types. More...
 
virtual ossimObjectgetObject ()
 
virtual const ossimObjectgetObject () const
 
virtual bool canConnectMyInputTo (ossim_int32 index, const ossimConnectableObject *obj) const
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 Method to set properties. More...
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 Method to populate the list of property names. More...
 
virtual std::ostream & print (std::ostream &out) const
 print method. More...
 
- Public Member Functions inherited from ossimOverviewBuilderBase
 ossimOverviewBuilderBase ()
 default constructor More...
 
virtual bool setOutputWriter (ossimImageFileWriter *outputWriter)
 Sets an optional file writer to the builder. More...
 
virtual bool setInputSource (ossimImageHandler *imageSource)
 Sets the input to the builder. More...
 
virtual bool hasOverviewType (const ossimString &type) const
 Method to check if builder can handle type. More...
 
virtual ossim_uint32 getOverviewStopDimension () const
 Get the overview stop dimension. More...
 
virtual void setOverviewStopDimension (ossim_uint32 dim)
 Sets the overview stop dimension. More...
 
ossimHistogramMode getHistogramMode () const
 Gets the histogram accumulation mode. More...
 
void setHistogramMode (ossimHistogramMode mode)
 Sets the histogram accumulation mode. More...
 
virtual void finalize ()
 Finalize method. More...
 
void setBitMaskSpec (const ossimKeywordlist &bit_mask_spec)
 Specifies parameters (in KWL) for generation of an alpha (bit) mask such that any full or partial null pixels will be masked out. More...
 
void setScanForMinMax (bool flag)
 Turn on/off scan for min max flag. More...
 
bool getScanForMinMax () const
 
void setScanForMinMaxNull (bool flag)
 Turn on/off scan for min, max, null flag. More...
 
bool getScanForMinMaxNull () const
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual void initialize ()
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
- 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 addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 
- 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 void setPercentComplete (double percentComplete)
 
virtual ossimListenerManagergetManager ()
 
void enableEvents ()
 
void disableEvents ()
 
void setCurrentMessage (const ossimString &message)
 
- 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 disconnectInputEvent (ossimConnectionEvent &)
 
virtual void disconnectOutputEvent (ossimConnectionEvent &)
 
virtual void connectInputEvent (ossimConnectionEvent &)
 
virtual void connectOutputEvent (ossimConnectionEvent &)
 
virtual void propertyEvent (ossimPropertyEvent &)
 
virtual void addObjectEvent (ossimContainerEvent &)
 
virtual void removeObjectEvent (ossimContainerEvent &)
 
virtual void containerEvent (ossimContainerEvent &)
 
virtual void refreshEvent (ossimRefreshEvent &)
 
- Public Member Functions inherited from ossimListener
 ossimListener ()
 
virtual ~ossimListener ()
 
void enableListener ()
 
void disableListener ()
 
void setListenerEnableFlag (bool flag)
 
bool isListenerEnabled () const
 
bool getListenerEnableFlag () const
 

Private Member Functions

void setImagField (ossimNitfImageHeaderV2_1 *hdr, ossim_uint32 startingResLevel) const
 Set the Image Magnification (IMAG) field in the form of "/2 ". More...
 

Private Attributes

ossimFilename m_outputFile
 
ossimFilename m_outputFileTmp
 
ossimKakaduCompressorm_compressor
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 
- Public Types inherited from ossimProcessInterface
enum  ossimProcessStatus {
  PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3,
  PROCESS_STATUS_NOT_EXECUTING = 4
}
 
- Protected Member Functions inherited from ossimOverviewBuilderBase
virtual ~ossimOverviewBuilderBase ()
 virtual destructor More...
 
ossim_uint32 getRequiredResLevels (const ossimImageHandler *ih) const
 Gets the required number of res levels. More...
 
void initializePreferenceSettings ()
 Initializes preference settings. More...
 
void initializeScanOptions ()
 Checks scalar type and turns on scanning for min, max, nulls if needed. More...
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 
- Protected Attributes inherited from ossimOverviewBuilderBase
ossim_uint32 m_overviewStopDimension
 
ossimHistogramMode m_histoMode
 
ossimKeywordlist m_bitMaskSpec
 
ossimRefPtr< ossimImageHandlerm_imageHandler
 
std::vector< ossim_uint32m_originalBandList
 
ossimRefPtr< ossimBitMaskWriterm_maskWriter
 
ossimRefPtr< ossimMaskFilterm_maskFilter
 
ossimFilename m_outputFile
 
bool m_scanForMinMax
 
bool m_scanForMinMaxNull
 
bool m_scanFloatData
 
- 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

ossimKakaduNitfOverviewBuilder Class to build overviews from the Kakadu library.

Definition at line 32 of file ossimKakaduNitfOverviewBuilder.h.

Constructor & Destructor Documentation

◆ ossimKakaduNitfOverviewBuilder()

ossimKakaduNitfOverviewBuilder::ossimKakaduNitfOverviewBuilder ( )

default constructor

Definition at line 66 of file ossimKakaduNitfOverviewBuilder.cpp.

67  :
72 {
73  if (traceDebug())
74  {
76  << "ossimKakaduNitfOverviewBuilder::ossimKakaduNitfOverviewBuilder"
77  << " DEBUG:\n";
78 #ifdef OSSIM_ID_ENABLED
80  << "OSSIM_ID: "
81  << OSSIM_ID
82  << "\n";
83 #endif
85  << "overview stop dimension: " << m_overviewStopDimension
86  << std::endl;
87  }
88 }
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
Definition: ossimFilename.h:40
ossimOverviewBuilderBase()
default constructor
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ ~ossimKakaduNitfOverviewBuilder()

ossimKakaduNitfOverviewBuilder::~ossimKakaduNitfOverviewBuilder ( )
virtual

virtual destructor

Definition at line 90 of file ossimKakaduNitfOverviewBuilder.cpp.

References m_compressor, and ossimOverviewBuilderBase::m_imageHandler.

91 {
92  m_imageHandler = 0;
93 
94  if (m_compressor)
95  {
96  delete m_compressor;
97  m_compressor = 0;
98  }
99 }
ossimRefPtr< ossimImageHandler > m_imageHandler

Member Function Documentation

◆ canConnectMyInputTo()

bool ossimKakaduNitfOverviewBuilder::canConnectMyInputTo ( ossim_int32  index,
const ossimConnectableObject obj 
) const
virtual
Returns
true if input is an image handler. Satisfies pure virtual.

Implements ossimConnectableObject.

Definition at line 748 of file ossimKakaduNitfOverviewBuilder.cpp.

References PTR_CAST.

751 {
752  if ( (index == 0) &&
754  {
755  return true;
756  }
757 
758  return false;
759 }
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
This class defines an abstract Handler which all image handlers(loaders) should derive from...

◆ execute()

bool ossimKakaduNitfOverviewBuilder::execute ( )
virtual

Builds the overviews.

Returns
true on success, false on error.
Note
If setOutputFile was not called the output name will be derived from the image name. If image was "foo.tif" the overview file will be "foo.rrd" or "foo.ovr".

Implements ossimOverviewBuilderBase.

Definition at line 149 of file ossimKakaduNitfOverviewBuilder.cpp.

150 {
151  static const char MODULE[] = "ossimKakaduNitfOverviewBuilder::execute";
152 
153  if (traceDebug())
154  {
155  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
156  }
157 
158  bool result = false;
159 
160  if ( m_imageHandler.valid() ) // Make sure there is a source.
161  {
162  // Get the output filename.
163  ossimFilename outputFile = getOutputFile();
164 
165  if (outputFile != m_imageHandler->getFilename())
166  {
167  //---
168  // Add .tmp in case process gets aborted to avoid leaving bad .ovr
169  // file.
170  //---
171  ossimFilename outputFileTemp = outputFile + ".tmp";
172 
173  // Required number of levels needed including r0.
174  ossim_uint32 requiedResLevels =
176 
177  // Zero based starting resLevel.
178  ossim_uint32 startingResLevel =
180 
181  if (traceDebug())
182  {
184  << MODULE
185  << "\nCurrent number of reduced res sets: "
187  << "\nNumber of required reduced res sets: "
188  << requiedResLevels
189  << "\nStarting reduced res set: " << startingResLevel
190  << "\nHistogram mode: " << getHistogramMode()
191  << std::endl;
192  }
193 
194  if ( startingResLevel < requiedResLevels )
195  {
196  //---
197  // If image handler is band selector, start with all bands.
198  // Some sources, e.g. ossimEnviTileSource can pick up default
199  // bands and filter out all other bands.
200  //---
202 
203  // If alpha bit mask generation was requested, then need to instantiate the mask writer
204  // object. This is simply a "transparent" tile source placed after to the right of the
205  // image handler that scans the pixels being pulled and accumulates alpha bit mask for
206  // writing at the end:
207  if (m_bitMaskSpec.getSize() > 0)
208  {
216  }
217 
218  //---
219  // Set up the sequencer. This will be one of three depending
220  // on if we're running mpi and if we are a master process or
221  // a slave process.
222  //---
224 
226  {
227  if ( ossimMpi::instance()->getRank() == 0 )
228  {
229  sequencer = new ossimMpiMasterOverviewSequencer();
230  }
231  else
232  {
233  sequencer = new ossimMpiSlaveOverviewSequencer();
234  }
235  }
236  else
237  {
238  sequencer = new ossimOverviewSequencer();
239  }
240 
241  if( ossimMpi::instance()->getNumberOfProcessors() == 1)
242  {
243  //---
244  // Pass the histogram mode to the sequencer.
245  // Can't do with mpi/multi-process.
246  //---
247  sequencer->setHistogramMode( getHistogramMode() );
248 
249  if ( getScanForMinMaxNull() == true )
250  {
251  sequencer->setScanForMinMaxNull(true);
252  }
253  else if ( getScanForMinMax() == true )
254  {
255  sequencer->setScanForMinMax(true);
256  }
257  }
258 
259  sequencer->setImageHandler( m_imageHandler.get() );
260 
261  ossim_uint32 sourceResLevel = 0;
262  if ( startingResLevel > 1)
263  {
264  sourceResLevel = startingResLevel - 1;
265  }
266 
267  if (traceDebug())
268  {
270  << MODULE
271  << "\nSource starting reduced res set: " << sourceResLevel
272  << std::endl;
273  }
274 
275  sequencer->setSourceLevel(sourceResLevel);
276 
277  // Tmp hard coded to BOX:
278  sequencer->setResampleType(
280 
281  sequencer->setTileSize( DEFAULT_TILE_SIZE );
282 
283  sequencer->initialize();
284 
285  //---
286  // If we are a slave process start the resampling of tiles.
287  //---
288  if (ossimMpi::instance()->getRank() != 0 )
289  {
290  sequencer->slaveProcessTiles();
291  return true; // End of slave process.
292  }
293 
294  ossim_uint32 outputTilesWide =
295  sequencer->getNumberOfTilesHorizontal();
296  ossim_uint32 outputTilesHigh =
297  sequencer->getNumberOfTilesVertical();
298  ossim_uint32 numberOfTiles =
299  sequencer->getNumberOfTiles();
301  ossimIrect imageRect;
302  sequencer->getOutputImageRectangle(imageRect);
303 
304  //---
305  // From here on out master process only.
306  //---
307  ossimNitfFileHeaderV2_1* fHdr = 0;
308  ossimNitfImageHeaderV2_1* iHdr = 0;
309  ossimStdOutProgress* progressListener = 0;
310  std::ofstream* os = 0;
311  std::streampos endOfFileHdrPos;
312  std::streampos endOfImgHdrPos;
313  std::streampos endOfFilePos;
314  ossimNitfImageInfoRecordV2_1 imageInfoRecord;
315 
316  // Open the output file.
317  os = new std::ofstream;
318  os->open(outputFileTemp.chars(), std::ios_base::out|std::ios_base::binary);
319  if ( os->good() )
320  {
321  result = true; // Assuming we are good from this point.
322 
323  // Get an info dump to a keyword list.
324  ossimKeywordlist kwl;
325  std::shared_ptr<ossimInfoBase> info =
327  create(m_imageHandler->getFilename());
328  if ( info )
329  {
330  info->getKeywordlist(kwl);
331  info.reset();
332  }
333 
334  fHdr = new ossimNitfFileHeaderV2_1();
335 
336  fHdr->addImageInfoRecord(imageInfoRecord);
337 
338  fHdr->setDate(ossimDate());
339  fHdr->setTitle(ossimString("ossim_nitf_j2k_overview"));
340 
341  const char* lookup = kwl.find("nitf.FSCLAS");
342  if (lookup)
343  {
345  }
346  fHdr->writeStream(*os);
347  endOfFileHdrPos = os->tellp();
348 
349  iHdr = new ossimNitfImageHeaderV2_1();
350 
351  // Set the compression type:
352  iHdr->setCompression(ossimString("C8"));
353 
354  // Set the Image Magnification (IMAG) field.
355  setImagField(iHdr, startingResLevel);
356 
358 
359  // Set the pixel type (PVTYPE field).
360  iHdr->setPixelType(
362 
363  // Set the actual bits per pixel (ABPP field).
364  iHdr->setActualBitsPerPixel(
365  ossim::getActualBitsPerPixel(scalarType));
366  iHdr->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
367 
368  const ossim_uint64 BANDS =
370 
371  iHdr->setNumberOfBands(BANDS);
372  iHdr->setImageMode('B');// blocked
373 
374  if((BANDS == 3)&&
375  (scalarType == OSSIM_UCHAR))
376  {
377  iHdr->setRepresentation("RGB");
378  iHdr->setCategory("VIS");
379  }
380  else if(BANDS == 1)
381  {
382  iHdr->setRepresentation("MONO");
383  iHdr->setCategory("MS");
384  }
385  else
386  {
387  iHdr->setRepresentation("MULTI");
388  iHdr->setCategory("MS");
389  }
390 
391  iHdr->setBlocksPerRow(outputTilesWide);
392  iHdr->setBlocksPerCol(outputTilesHigh);
393  iHdr->setNumberOfPixelsPerBlockRow(DEFAULT_TILE_SIZE.y);
394  iHdr->setNumberOfPixelsPerBlockCol(DEFAULT_TILE_SIZE.x);
395  iHdr->setNumberOfRows(imageRect.height());
396  iHdr->setNumberOfCols(imageRect.width());
397 
398  ossimNitfImageBandV2_1 bandInfo;
399  for(ossim_uint32 band = 0; band < BANDS; ++band)
400  {
401  std::ostringstream out;
402 
403  out << std::setfill('0')
404  << std::setw(2)
405  << band;
406 
407  bandInfo.setBandRepresentation(out.str().c_str());
408  iHdr->setBandInfo(band, bandInfo);
409  }
410 
411  iHdr->writeStream(*os);
412  endOfImgHdrPos = os->tellp();
413 
414  //---
415  // Check for a listeners. If the list is empty, add a
416  // standard out listener so that command line apps like
417  // img2rr will get some progress.
418  //---
419  ossimStdOutProgress* progressListener = 0;
420  if (theListenerList.empty())
421  {
422  progressListener = new ossimStdOutProgress(0, true);
423  addListener(progressListener);
424  }
427  setPercentComplete(0.0);
428 
429  if (traceDebug())
430  {
432  << MODULE << " DEBUG:"
433  << "\noutputTilesWide: " << outputTilesWide
434  << "\noutputTilesHigh: " << outputTilesHigh
435  << "\nnumberOfTiles: " << numberOfTiles
436  << "\nimageRect: " << imageRect
437  << std::endl;
438  }
439 
441  {
442  //---
443  // Someone can set this through the generic setProperty
444  // interface. Unset, currently only supported in jp2 writer.
445  // Could be used here but I think we would have to update the
446  // nitf tags.
447  //---
449  }
450 
451  if ( ossim::getActualBitsPerPixel(scalarType) > 31 )
452  {
454  }
455 
456  try
457  {
458  // Make a compressor
459  m_compressor->create(os,
460  scalarType,
461  BANDS,
462  imageRect,
463  DEFAULT_TILE_SIZE,
464  numberOfTiles,
465  false);
466 
468  << "Generating " << (m_compressor->getLevels()+1)
469  << " levels..." << endl;
470  }
471  catch (const ossimException& e)
472  {
473  setErrorStatus();
474  ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
475  result = false;
476  }
477 
478  if ( result )
479  {
480  // Tile loop in the line direction.
481  for(ossim_uint32 y = 0; y < outputTilesHigh; ++y)
482  {
483  // Tile loop in the sample (width) direction.
484  for(ossim_uint32 x = 0; x < outputTilesWide; ++x)
485  {
486  // Grab the resampled tile.
487  ossimRefPtr<ossimImageData> t = sequencer->getNextTile();
488 
489  // Check for errors reading tile:
490  if ( sequencer->hasError() )
491  {
492  setErrorStatus();
494  << MODULE << " ERROR: reading tile: "
495  << tileNumber << std::endl;
496  result = false;
497  }
498 
499  if ( result && t.valid() )
500  {
501  //---
502  // If masking was enabled, pass the tile onto that object for
503  // processing:
504  //---
505  if ( m_maskWriter.valid())
506  {
507  m_maskWriter->generateMask(t, 0);
508  }
509 
510  if ( t->getDataObjectStatus() != OSSIM_NULL )
511  {
512  if ( ! m_compressor->writeTile( *(t.get()) ) )
513  {
514  setErrorStatus();
516  << MODULE << " ERROR:\nWriting tile: "
517  << tileNumber << std::endl;
518  result = false;
519  }
520  }
521  else
522  {
523  setErrorStatus();
525  << MODULE << " ERROR:\nNull tile returned: " << tileNumber
526  << std::endl;
527  result = false;
528  }
529  }
530 
531  if ( !result )
532  {
533  // Bust out of sample loop.
534  break;
535  }
536 
537  // Increment tile number for percent complete.
538  ++tileNumber;
539 
540  } // End of tile loop in the sample (width) direction.
541 
542  if ( !result )
543  {
544  // Bust out of line loop.
545  break;
546  }
547 
548  if ( needsAborting() )
549  {
550  setPercentComplete(100.0);
551  break;
552  }
553  else
554  {
555  double tile = tileNumber;
556  double numTiles = numberOfTiles;
557  setPercentComplete(tile / numTiles * 100.0);
558  }
559 
560  } // End of tile loop in the line (height) direction.
561 
562  if ( result )
563  {
564  m_compressor->finish();
565 
566  // Get the file length.
567  endOfFilePos = os->tellp();
568 
569  //---
570  // Seek back to set some things that were not know until now and
571  // rewrite the nitf file and image header.
572  //---
573  os->seekp(0, std::ios_base::beg);
574 
575  // Set the file length.
576  std::streamoff length = endOfFilePos;
577  fHdr->setFileLength(static_cast<ossim_uint64>(length));
578 
579  // Set the file header length.
580  length = endOfFileHdrPos;
581  fHdr->setHeaderLength(static_cast<ossim_uint64>(length));
582  // Set the image sub header length.
583  length = endOfImgHdrPos - endOfFileHdrPos;
584 
585  imageInfoRecord.setSubheaderLength(
586  static_cast<ossim_uint64>(length));
587 
588  // Set the image length.
589  length = endOfFilePos - endOfImgHdrPos;
590  imageInfoRecord.setImageLength(
591  static_cast<ossim_uint64>(length));
592 
593  fHdr->replaceImageInfoRecord(0, imageInfoRecord);
594 
595  // Rewrite the header.
596  fHdr->writeStream(*os);
597 
598  // Set the compression rate now that the image size is known.
600  imageRect,
601  BANDS,
602  scalarType,
603  static_cast<ossim_uint64>(length));
604  iHdr->setCompressionRateCode(comrat);
605 
606  // Rewrite the image header.
607  iHdr->writeStream(*os);
608 
609  if (progressListener)
610  {
611  removeListener(progressListener);
612  delete progressListener;
613  progressListener = 0;
614  }
615 
616  if ( ossimMpi::instance()->getNumberOfProcessors() == 1 )
617  {
619  {
620  // Write the histogram.
621  ossimFilename histoFilename = getOutputFile();
622  histoFilename.setExtension("his");
623  sequencer->writeHistogram(histoFilename);
624  }
625 
626  if ( ( getScanForMinMaxNull() == true ) || ( getScanForMinMax() == true ) )
627  {
628  // Write the omd file:
630  file = file.setExtension("omd");
631  sequencer->writeOmdFile(file);
632  }
633  }
634 
635  // If masking was enabled, then only R0 was processed, need to process
636  // remaining levels:
637  if (m_maskWriter.valid())
638  {
639  ossim_uint32 num_rlevels = m_compressor->getLevels() + 1;
640  m_maskWriter->buildOverviews(num_rlevels);
644  << MODULE << "Writing alpha bit mask file..." << std::endl;
645  m_maskWriter->close();
646  }
647 
648  } // if ( result ) *** after end of tile loop ***
649 
650  } // End: if ( result ) from m_compressor->create
651 
652  } // End: if (os->good())
653 
654  if (fHdr)
655  {
656  delete fHdr;
657  fHdr = 0;
658  }
659 
660  if (iHdr)
661  {
662  delete iHdr;
663  iHdr = 0;
664  }
665 
666  if (progressListener)
667  {
668  delete progressListener;
669  progressListener = 0;
670  }
671 
672  if (os->is_open())
673  {
674  os->close();
675  if ( result )
676  {
677  outputFileTemp.rename(outputFile);
678  }
679  else
680  {
681  ossimFilename::remove( outputFileTemp );
682  }
683  }
684  delete os;
685  os = 0;
686 
687  }
688  else
689  {
690  ossimNotify(ossimNotifyLevel_INFO)<< MODULE << " NOTICE:"
691  <<" Image has required reduced resolution data sets.\n"<< std::endl;
692  }
693  }
694  else
695  {
697  << "Source image file and overview file cannot be the same!"
698  << std::endl;
699  }
700 
701  } // matches: if (m_imageHandler)
702 
703  if (traceDebug())
704  {
706  << MODULE << " exit status = " << (result?"true":"false\n")
707  << std::endl;
708  }
709 
710  finalize(); // Reset band list if a band selector.
711 
712  return result;
713 
714 } // End: ossimKakaduNitfOverviewBuilder::execute()
ossim_uint32 x
virtual ossimRefPtr< ossimConnectableObject > disconnectMyInput(ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
Will disconnect the object at the given input index and generate a connection event.
virtual bool addListener(ossimListener *listener)
void setScanForMinMaxNull(bool flag)
Turn on/off scan for min, max, null flag.
ossim_uint32 getRequiredResLevels(const ossimImageHandler *ih) const
Gets the required number of res levels.
virtual void create(ossim::ostream *os, ossimScalarType scalar, ossim_uint32 bands, const ossimIrect &imageRect, const ossimIpt &tileSize, ossim_uint32 tilesToWrite, bool jp2)
Create method.
ossim_uint32 getNumberOfTilesHorizontal() const
void setPixelType(const ossimString &pixelType=ossimString("INT"))
virtual void setFileLength(ossim_uint64 fileLength)
Sets file length (FL) field.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
Definition: ossimIosFwd.h:35
void setNumberOfPixelsPerBlockRow(ossim_uint32 pixels)
bool buildOverviews(ossim_uint32 total_num_rlevels)
For imagery that already has overviews built, but with artifact edge pixels (such as JP2- compressed ...
void setActualBitsPerPixel(ossim_uint32 bitsPerPixel)
virtual void setNumberOfBands(ossim_uint32 nbands)
ossim_uint32 tileNumber
Represents serializable keyword/value map.
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.
ossim_uint32 y
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
virtual void finish()
Finish method.
std::list< ossimListener * > theListenerList
virtual void writeStream(std::ostream &out)
void setSubheaderLength(ossim_uint32 length)
ossim_uint32 height() const
Definition: ossimIrect.h:487
static ossimString getNitfPixelType(ossimScalarType scalarType)
Get the nitf pixel type string from scalar type.
virtual void getOutputImageRectangle(ossimIrect &rect) const
Gets the zero-based image rectangle for the output reduced resolution data set (rrds).
virtual void setPercentComplete(double percentComplete)
virtual void setHeaderLength(ossim_uint64 headerLength)
Sets header length (HL) field.
virtual void replaceImageInfoRecord(int i, const ossimNitfImageInfoRecordV2_1 &recordInfo)
virtual ossimDataObjectStatus getDataObjectStatus() const
ossim_uint32 getNumberOfTilesVertical() const
ossim_uint32 getNumberOfTiles() const
OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType)
Get actual bits per pixel for a given scalar type.
virtual bool loadState(const ossimKeywordlist &spec, const char *prefix=0)
Computes and writes the mask file according to the specification in the KWL.
virtual void setProcessStatus(ossimProcessStatus processStatus)
void setImagField(ossimNitfImageHeaderV2_1 *hdr, ossim_uint32 startingResLevel) const
Set the Image Magnification (IMAG) field in the form of "/2 ".
static ossimString getCompressionRate(const ossimIrect &rect, ossim_uint32 bands, ossimScalarType scalar, ossim_uint64 lengthInBytes)
Get compression rate (COMRAT) which is bits perpixel per band.
void setTitle(const ossimString &title)
virtual ossim_uint32 getNumberOfDecimationLevels() const
This returns the total number of decimation levels.
void setBitsPerPixel(ossim_uint32 bitsPerPixel)
void setBlocksPerRow(ossim_uint32 blocks)
void writeHistogram()
Write histogram method.
void setTileSize(const ossimIpt &pt)
updated the tile size.
virtual const ossimFilename & getFilename() const
Returns the filename.
virtual const char * what() const
Returns the error message.
void setCategory(const ossimString &category)
virtual bool setOutputToInputBandList()
If the image handler "isBandSeletor()" then the band selection of the output are set to input or iden...
unsigned long long ossim_uint64
void setImageLength(ossim_uint64 length)
ossimRefPtr< ossimBitMaskWriter > m_maskWriter
unsigned int ossim_uint32
const char * chars() const
For backward compatibility.
Definition: ossimString.h:77
This is the image handler for providing mask pixels to an ossimMaskFilter object. ...
void setAssociatedMaskWriter(ossimBitMaskWriter *maskWriter)
This class can be used during overview generation, in which case there will be a simultaneous mask wr...
void setCompressionRateCode(const ossimString &value)
ossimHistogramMode getHistogramMode() const
Gets the histogram accumulation mode.
virtual ossimRefPtr< ossimImageData > getNextTile()
Will allow you to get the next tile in the sequence.
bool getAlphaChannelFlag() const
Retrieve the writer&#39;s setting for whether or not to add an alpha channel to the output png image...
Class for computing a mask from an input image source and writing the mask file to disk...
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
void setNumberOfPixelsPerBlockCol(ossim_uint32 pixels)
virtual void setAlphaChannelFlag(bool flag)
Set the writer to add an alpha channel to the output.
ossim_uint32 width() const
Definition: ossimIrect.h:500
virtual void setQualityType(ossimKakaduCompressionQuality type)
Sets the quality type.
virtual void setNumberOfRows(ossim_uint32 rows)
ossimScalarType
ossimRefPtr< ossimImageHandler > m_imageHandler
OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType)
Get bits per pixel for a given scalar type.
int getNumberOfProcessors() const
Definition: ossimMpi.cpp:154
virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_1 &recordInfo)
void setImageHandler(ossimImageHandler *input)
Sets the input source or connection.
virtual bool writeTile(ossimImageData &srcTile)
Write tile method.
void generateMask(ossimRefPtr< ossimImageData > tile, ossim_uint32 rLevel)
Given a source&#39;s tile, derives the alpha mask and saves it in buffer for later writing to disk...
virtual void setNumberOfCols(ossim_uint32 cols)
virtual void finalize()
Finalize method.
void setBlocksPerCol(ossim_uint32 blocks)
ossimRefPtr< ossimMaskFilter > m_maskFilter
void setRepresentation(const ossimString &rep)
int getRank() const
Definition: ossimMpi.cpp:140
virtual ossimFilename getOutputFile() const
Returns the output.
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
static ossimInfoFactoryRegistry * instance()
instance method
bool remove() const
ossim_int32 y
Definition: ossimIpt.h:142
void setScanForMinMax(bool flag)
Turn on/off scan for min max flag.
virtual void setSecurityClassificationSys(const ossimString &value)
void setSourceLevel(ossim_uint32 level)
Sets the input source resolution to decimate from.
virtual void slaveProcessTiles()
This implementation does nothing.
virtual void writeStream(ossim::ostream &out)
ossim_uint32 getSize() const
virtual void close()
Writes the mask file to path specified. Returns TRUE if successful.
void setHistogramMode(ossimHistogramMode mode)
Sets the histogram accumulation mode.
ossim_int32 x
Definition: ossimIpt.h:141
std::basic_ofstream< char > ofstream
Class for char output file streams.
Definition: ossimIosFwd.h:47
bool writeOmdFile(const std::string &file)
Writes an ossim metadata(omd) file with min, max, null values.
virtual void setBandRepresentation(const ossimString &rep)
Sets the band representation.
void setCompression(const ossimString &value)
virtual void disconnectAllInputs()
Will disconnect all of the input objects.
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
void setStartingResLevel(ossim_uint32 res_level)
Sets the starting resolution level for the mask.
static ossimMpi * instance()
Definition: ossimMpi.cpp:27
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void setResampleType(ossimFilterResampler::ossimFilterResamplerType resampleType)
Sets the resampling type.
virtual void initialize()
This must be called.
bool rename(const ossimFilename &destFile, bool overwriteDestinationFlag=true) const
8 bit unsigned iteger
void setMaskSource(ossimImageSource *maskSource)
This set method is necessary when this object is being added to an ossimImageChain because ossimImage...
virtual void setBandInfo(ossim_uint32 idx, const ossimNitfImageBandV2_1 &info)
virtual bool removeListener(ossimListener *listener)

◆ getObject() [1/2]

ossimObject * ossimKakaduNitfOverviewBuilder::getObject ( )
virtual
Returns
ossimObject* to this object. Satisfies pure virtual.

Implements ossimProcessInterface.

Definition at line 738 of file ossimKakaduNitfOverviewBuilder.cpp.

739 {
740  return this;
741 }

◆ getObject() [2/2]

const ossimObject * ossimKakaduNitfOverviewBuilder::getObject ( ) const
virtual
Returns
const ossimObject* to this object. Satisfies pure virtual.

Implements ossimProcessInterface.

Definition at line 743 of file ossimKakaduNitfOverviewBuilder.cpp.

744 {
745  return this;
746 }

◆ getOutputFile()

ossimFilename ossimKakaduNitfOverviewBuilder::getOutputFile ( ) const
virtual

Returns the output.

This will be derived from the input file if not explicitly set.

Returns
The output filename.

Implements ossimOverviewBuilderBase.

Definition at line 106 of file ossimKakaduNitfOverviewBuilder.cpp.

References ossimImageHandler::getNumberOfEntries(), ossimOverviewBuilderBase::m_imageHandler, m_outputFile, ossimFilename::NIL, and ossimRefPtr< T >::valid().

107 {
108  ossimFilename result = m_outputFile;
110  {
111  if ( m_imageHandler.valid() )
112  {
113  bool usePrefix = (m_imageHandler->getNumberOfEntries()>1?true:false);
114  result = m_imageHandler->
115  getFilenameWithThisExtension(ossimString("ovr"), usePrefix);
116  }
117  }
118  return result;
119 }
static const ossimFilename NIL
This was taken from Wx widgets for performing touch and access date stamps.
Definition: ossimFilename.h:40
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossim_uint32 getNumberOfEntries() const
ossimRefPtr< ossimImageHandler > m_imageHandler

◆ getOverviewType()

ossimString ossimKakaduNitfOverviewBuilder::getOverviewType ( ) const
virtual

Gets the overview type.

Satisfies pure virtual from ossimOverviewBuilderInterface.

Returns
The overview output type as a string.

Implements ossimOverviewBuilderBase.

Definition at line 137 of file ossimKakaduNitfOverviewBuilder.cpp.

138 {
139  return OVERVIEW_TYPE;
140 }

◆ getPropertyNames()

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

Method to populate the list of property names.

Parameters
propertyNamesList to populate. This does not clear the list just adds to it.

Reimplemented from ossimSource.

Definition at line 725 of file ossimKakaduNitfOverviewBuilder.cpp.

References ossimKakaduCompressor::getPropertyNames(), and m_compressor.

727 {
728  m_compressor->getPropertyNames(propertyNames);
729 }
void getPropertyNames(std::vector< ossimString > &propertyNames) const
Pushes this&#39;s names onto the list of property names.

◆ getTypeNameList()

void ossimKakaduNitfOverviewBuilder::getTypeNameList ( std::vector< ossimString > &  typeList) const
virtual

Method to populate class supported types.

Satisfies pure virtual from ossimOverviewBuilderInterface.

Parameters
typeListList of ossimStrings to add to.

Implements ossimOverviewBuilderBase.

Definition at line 142 of file ossimKakaduNitfOverviewBuilder.cpp.

144 {
145  typeList.push_back(OVERVIEW_TYPE);
146  typeList.push_back(OVERVIEW_TYPE_ALIAS);
147 }

◆ print()

std::ostream & ossimKakaduNitfOverviewBuilder::print ( std::ostream &  out) const
virtual

print method.

Returns
std::ostream&

Reimplemented from ossimProcessInterface.

Definition at line 731 of file ossimKakaduNitfOverviewBuilder.cpp.

732 {
733  out << "ossimKakaduNitfOverviewBuilder::print"
734  << std::endl;
735  return out;
736 }

◆ setImagField()

void ossimKakaduNitfOverviewBuilder::setImagField ( ossimNitfImageHeaderV2_1 hdr,
ossim_uint32  startingResLevel 
) const
private

Set the Image Magnification (IMAG) field in the form of "/2 ".

Parameters
hdrThe nitf image header.
startingresolution level.

Definition at line 761 of file ossimKakaduNitfOverviewBuilder.cpp.

References ossimNitfImageHeaderV2_1::setImageMagnification(), ossimString::size(), and ossimString::toString().

763 {
764  //---
765  // This assumes res level 0 is 1.0 magnification.
766  //---
767  if (hdr)
768  {
769  ossimString imagString;
770 
771  if (startingResLevel == 0)
772  {
773  imagString = "1.0 ";
774  }
775  else
776  {
777  //---
778  // Assumes power of 2 decimation.
779  //---
780  ossim_uint32 decimation = 1<<startingResLevel;
781 
782  //---
783  // Using slash '/' format. "/2" = 1/2, /
784  imagString = "/";
785  imagString += ossimString::toString(decimation);
786  if (imagString.size() <= 4)
787  {
788  if (imagString.size() == 2)
789  {
790  imagString += " "; // two spaces
791  }
792  else if (imagString.size() == 3)
793  {
794  imagString += " "; // one space
795  }
796  }
797  }
798  if (imagString.size())
799  {
800  hdr->setImageMagnification(imagString);
801  }
802  }
803 }
static ossimString toString(bool aValue)
Numeric to string methods.
std::string::size_type size() const
Definition: ossimString.h:405
unsigned int ossim_uint32
virtual void setImageMagnification(const ossimString &value)

◆ setOutputFile()

void ossimKakaduNitfOverviewBuilder::setOutputFile ( const ossimFilename file)
virtual

Sets the output filename.

Satisfies pure virtual from ossimOverviewBuilderInterface.

Parameters
fileThe output file name.

Implements ossimOverviewBuilderBase.

Definition at line 101 of file ossimKakaduNitfOverviewBuilder.cpp.

References m_outputFile.

102 {
103  m_outputFile = file;
104 }

◆ setOverviewType()

bool ossimKakaduNitfOverviewBuilder::setOverviewType ( const ossimString type)
virtual

Sets the overview output type.

Satisfies pure virtual from ossimOverviewBuilderInterface.

Currently handled types are: "ossim_tiff_nearest" and "ossim_tiff_box"

Parameters
typeThis should be the string representing the type. This method will do nothing if type is not handled and return false.
Returns
true if type is handled, false if not.

Implements ossimOverviewBuilderBase.

Definition at line 121 of file ossimKakaduNitfOverviewBuilder.cpp.

122 {
123  bool result = false;
124 
125  //---
126  // Only have one type right now. These are the same:
127  // "ossim_kakadu_nitf_j2k" or "j2k"
128  //---
129  if ( (type == OVERVIEW_TYPE) || (type == OVERVIEW_TYPE_ALIAS) )
130  {
131  result = true;
132  }
133 
134  return result;
135 }

◆ setProperty()

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

Method to set properties.

Parameters
propertyProperty to set.
Note
Currently supported property:

Reimplemented from ossimSource.

Definition at line 716 of file ossimKakaduNitfOverviewBuilder.cpp.

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

718 {
719  if ( property.valid() )
720  {
721  m_compressor->setProperty(property);
722  }
723 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool setProperty(ossimRefPtr< ossimProperty > property)
Will set the property whose name matches the argument "property->getName()".

Member Data Documentation

◆ m_compressor

ossimKakaduCompressor* ossimKakaduNitfOverviewBuilder::m_compressor
private

◆ m_outputFile

ossimFilename ossimKakaduNitfOverviewBuilder::m_outputFile
private

Definition at line 148 of file ossimKakaduNitfOverviewBuilder.h.

Referenced by getOutputFile(), and setOutputFile().

◆ m_outputFileTmp

ossimFilename ossimKakaduNitfOverviewBuilder::m_outputFileTmp
private

Definition at line 149 of file ossimKakaduNitfOverviewBuilder.h.


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