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

#include <ossimAtbController.h>

Inheritance diagram for ossimAtbController:
ossimConnectableObject ossimProcessInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimAtbController ()
 
 ossimAtbController (ossimImageCombiner *combiner, ossimGridRemapEngine *engine=0)
 
 ossimAtbController (ossimGridRemapEngine *engine)
 
 ~ossimAtbController ()
 
virtual ossimObjectgetObject ()
 
virtual const ossimObjectgetObject () const
 
void initializeWithCombiner (ossimImageCombiner *combiner, ossimGridRemapEngine *engine=0)
 
bool enableImage (unsigned int index)
 
bool disableImage (unsigned int index)
 
bool lockImage (unsigned int index)
 
bool unlockImage (unsigned int index)
 
virtual bool execute ()
 
virtual void abort ()
 
void setKernelSize (int side_size)
 
void setGridSpacing (const ossimIpt &spacing)
 
void setGridRemapEngine (ossimGridRemapEngine *engine)
 
virtual bool saveState (ossimKeywordlist &kwl) const
 
virtual bool loadState (const ossimKeywordlist &kwl)
 
virtual bool canConnectMyInputTo (ossim_int32 myInputIndex, const ossimConnectableObject *object) const
 
- 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 (ossimRefPtr< ossimProperty > property)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
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 std::ostream & print (std::ostream &out) const
 Generic print method. More...
 
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 ossimProcessInterface
 ossimProcessInterface ()
 
virtual ~ossimProcessInterface ()
 
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)
 
virtual std::ostream & print (std::ostream &out) const
 

Protected Member Functions

void initializeRemappers ()
 
- 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

ossimDrect theBoundingRect
 
ossimRefPtr< ossimConnectableContainertheContainer
 
ossimGridRemapEnginetheGridRemapEngine
 
std::vector< ossimRefPtr< ossimAtbMatchPoint > > theMatchPoints
 
ossimIpt theGridSpacing
 
- 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 ossimProcessInterface
double thePercentComplete
 
ossimProcessStatus theProcessStatus
 
ossimString theMessage
 
bool theEventFlag
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 
- Public Types inherited from ossimProcessInterface
enum  ossimProcessStatus {
  PROCESS_STATUS_UNKNOWN = 0, PROCESS_STATUS_EXECUTING = 1, PROCESS_STATUS_ABORTED = 2, PROCESS_STATUS_ABORT_REQUEST = 3,
  PROCESS_STATUS_NOT_EXECUTING = 4
}
 

Detailed Description

Definition at line 37 of file ossimAtbController.h.

Constructor & Destructor Documentation

◆ ossimAtbController() [1/3]

ossimAtbController::ossimAtbController ( )

default Constructor initializes the member combiner pointer to NULL.

Definition at line 43 of file ossimAtbController.cpp.

44  :
45  ossimConnectableObject(NULL, 0, 0, false, true),
46  theContainer (0),
48  theGridSpacing (DEFAULT_GRID_SPACING)
49 {
50  static const char MODULE[] = "ossimAtbController Default Constructor";
51  if (traceExec()) CLOG << "entering..." << endl;
52 
53  //***
54  // Instantiate a default remap engine:
55  //***
57  = ossimGridRemapEngineFactory::create(DEFAULT_ATB_REMAP_ENGINE);
58 
59  if (traceExec()) CLOG << "returning..." << endl;
60 }
static ossimGridRemapEngine * create(const char *spec)
ossimGridRemapEngine * theGridRemapEngine
ossimRefPtr< ossimConnectableContainer > theContainer
#define CLOG
Definition: ossimTrace.h:23
ossimConnectableObject(ossimObject *owner=0)
Base constructor of this object.

◆ ossimAtbController() [2/3]

ossimAtbController::ossimAtbController ( ossimImageCombiner combiner,
ossimGridRemapEngine engine = 0 
)

Constructor with Combiner reference. This combiner is used for the ATB.

Definition at line 66 of file ossimAtbController.cpp.

68  :
69  ossimConnectableObject(NULL, 0, 0, false, true),
70  theContainer (0),
72  theGridSpacing (DEFAULT_GRID_SPACING)
73 {
74  static const char MODULE[] = "ossimAtbController Constructor #1";
75  if (traceExec()) CLOG << "entering..." << endl;
76 
77  initializeWithCombiner(combiner, engine);
78 
79  if (traceExec()) CLOG << "returning..." << endl;
80 }
ossimGridRemapEngine * theGridRemapEngine
ossimRefPtr< ossimConnectableContainer > theContainer
#define CLOG
Definition: ossimTrace.h:23
ossimConnectableObject(ossimObject *owner=0)
Base constructor of this object.
void initializeWithCombiner(ossimImageCombiner *combiner, ossimGridRemapEngine *engine=0)

◆ ossimAtbController() [3/3]

ossimAtbController::ossimAtbController ( ossimGridRemapEngine engine)

Constructor with a specified remap engine.

Definition at line 86 of file ossimAtbController.cpp.

87  :
88  theContainer (0),
90  theGridSpacing (DEFAULT_GRID_SPACING)
91 {
92  static const char MODULE[] = "ossimAtbController Constructor #1";
93  if (traceExec()) CLOG << "entering..." << endl;
94 
95  //***
96  // Assign default engine if non provided:
97  //***
98  if (engine)
99  {
100  theGridRemapEngine = engine;
101  }
102  else
103  {
105  = ossimGridRemapEngineFactory::create(DEFAULT_ATB_REMAP_ENGINE);
106  }
107 
108  if (traceExec()) CLOG << "returning..." << endl;
109 }
static ossimGridRemapEngine * create(const char *spec)
ossimGridRemapEngine * theGridRemapEngine
ossimRefPtr< ossimConnectableContainer > theContainer
#define CLOG
Definition: ossimTrace.h:23

◆ ~ossimAtbController()

ossimAtbController::~ossimAtbController ( )

Definition at line 120 of file ossimAtbController.cpp.

References theContainer, and theGridRemapEngine.

121 {
122  theContainer = 0;
123  theGridRemapEngine = 0;;
124 }
ossimGridRemapEngine * theGridRemapEngine
ossimRefPtr< ossimConnectableContainer > theContainer

Member Function Documentation

◆ abort()

void ossimAtbController::abort ( )
virtual

Reimplemented from ossimProcessInterface.

Definition at line 401 of file ossimAtbController.cpp.

402 {
403  static const char MODULE[] = "ossimAtbController::abort()";
404  if (traceExec()) CLOG << "entering..." << endl;
405 
406  CLOG << "NOTICE: this method not yet implemented." << endl;
407 
408  if (traceExec()) CLOG << "returning..." << endl;
409 }
#define CLOG
Definition: ossimTrace.h:23

◆ canConnectMyInputTo()

bool ossimAtbController::canConnectMyInputTo ( ossim_int32  myInputIndex,
const ossimConnectableObject object 
) const
virtual

Implementation of ossimConnectableObject pure virtual.

Implements ossimConnectableObject.

Definition at line 564 of file ossimAtbController.cpp.

References PTR_CAST.

566 {
567  return (object&& PTR_CAST(ossimGridRemapSource, object));
568 }
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321

◆ disableImage()

bool ossimAtbController::disableImage ( unsigned int  index)

Disnable an image in the mosaic from the tonal balancing process

Definition at line 239 of file ossimAtbController.cpp.

References ossimSource::disableSource(), ossimConnectableObject::getInput(), ossimConnectableObject::getNumberOfInputs(), and PTR_CAST.

240 {
241  if (index >= getNumberOfInputs())
242  return false;
243 
244  ossimSource* remapper = PTR_CAST(ossimSource,
245  getInput(index));
246  if (remapper)
247  remapper->disableSource();
248 
249  return true;
250 }
virtual void disableSource()
Definition: ossimSource.cpp:89
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.

◆ enableImage()

bool ossimAtbController::enableImage ( unsigned int  index)

Enable an image in the mosaic for the tonal balancing process

Definition at line 220 of file ossimAtbController.cpp.

References ossimSource::enableSource(), ossimConnectableObject::getInput(), ossimConnectableObject::getNumberOfInputs(), and PTR_CAST.

221 {
222  if (index >= getNumberOfInputs())
223  return false;
224 
225  ossimSource* remapper = PTR_CAST(ossimSource,
226  getInput(index));
227  if (remapper)
228  remapper->enableSource();
229 
230  return true;
231 }
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual void enableSource()
Definition: ossimSource.cpp:84
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.

◆ execute()

bool ossimAtbController::execute ( )
virtual

Implementation of ossimProcessInterface pure virtual method.

Implements ossimProcessInterface.

Definition at line 297 of file ossimAtbController.cpp.

298 {
299  static const char MODULE[] = "ossimAtbController::execute()";
300  if (traceExec()) CLOG << "entering..." << endl;
301 
302  setPercentComplete(0.0);
303 
304  ossimGridRemapSource* source;
305 
306  //***
307  // First verify that all objects needed are initialized:
308  //***
309  int num_images = getNumberOfInputs();
310  if ((!theGridRemapEngine) || (num_images < 2))
311  {
312  CLOG << "WARNING: execute method was called but the controller has not "
313  << "been properly initialized. Ignoring request..." << endl;
314  if (traceExec()) CLOG << "returning..." << endl;
315  return false;
316  }
317 
318  //***
319  // establish the remap grids:
320  //***
322  setPercentComplete(10.0);
323 
324  //***
325  // Establish grid of matchpoints:
326  //***
327  int numPoints = 0;
328  ossimDpt mp_view_pt;
329  theMatchPoints.clear();
330  for (mp_view_pt.line = theBoundingRect.ul().line;
331  mp_view_pt.line <= theBoundingRect.lr().line;
332  mp_view_pt.line += theGridSpacing.line)
333  {
334  for (mp_view_pt.samp = theBoundingRect.ul().samp;
335  mp_view_pt.samp <= theBoundingRect.lr().samp;
336  mp_view_pt.samp += theGridSpacing.samp)
337  {
338  ossimAtbMatchPoint* mp = new ossimAtbMatchPoint(mp_view_pt,
340  theMatchPoints.push_back(mp);
341  numPoints++;
342  }
343  }
344 
345  //***
346  // Loop over each matchpoint to determine which images contribute statistics:
347  //***
348  setPercentComplete(20.0);
349  for (int mp=0; mp<numPoints; mp++)
350  {
351  ossimDpt view_point (theMatchPoints[mp]->viewPoint());
352 
353  //***
354  // Loop over each image source to check if point lies inside its bounding
355  // rectangle, and add its contribution to the matchpoint's collection:
356  //***
357  for (int src=0; src<num_images; src++)
358  {
359  source = PTR_CAST(ossimGridRemapSource, getInput(src));
360  if (source)
361  {
362  ossimDrect image_rect (source->getBoundingRect());
363  if (image_rect.pointWithin(view_point))
364  theMatchPoints[mp]->addImage(source);
365  }
366  }
367 
368  setPercentComplete(20.0 + 50.0*(mp/numPoints));
369  }
370 
371  //***
372  // All contributors have been included in all matchpoints' collections.
373  // Compute the target pixel value for each matchpoint and communicate it
374  // to the corresponding remappers:
375  //***
376  for (int mp=0; mp<numPoints; mp++)
377  {
378  setPercentComplete(70.0 + 30.0*(mp/numPoints));
379  theMatchPoints[mp]->assignRemapValues();
380  }
381 
382  //***
383  // Finally, enable the remappers:
384  //***
385  for (int src=0; src<num_images; src++)
386  {
387  source = PTR_CAST(ossimGridRemapSource, getInput(src));
388  if (source)
389  source->enableSource();
390  }
391  setPercentComplete(100.0);
392 
393  if (traceExec()) CLOG << "returning..." << endl;
394  return true;
395 }
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
ossimGridRemapEngine * theGridRemapEngine
#define CLOG
Definition: ossimTrace.h:23
double samp
Definition: ossimDpt.h:164
const ossimDpt & ul() const
Definition: ossimDrect.h:339
virtual void setPercentComplete(double percentComplete)
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
double line
Definition: ossimDpt.h:165
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual void enableSource()
Definition: ossimSource.cpp:84
ossim_int32 samp
Definition: ossimIpt.h:141
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
ossim_int32 line
Definition: ossimIpt.h:142
std::vector< ossimRefPtr< ossimAtbMatchPoint > > theMatchPoints
const ossimDpt & lr() const
Definition: ossimDrect.h:341

◆ getObject() [1/2]

virtual ossimObject* ossimAtbController::getObject ( )
inlinevirtual

Implements ossimProcessInterface.

Definition at line 60 of file ossimAtbController.h.

61  {
62  return this;
63  }

◆ getObject() [2/2]

virtual const ossimObject* ossimAtbController::getObject ( ) const
inlinevirtual

Implements ossimProcessInterface.

Definition at line 64 of file ossimAtbController.h.

65  {
66  return this;
67  }

◆ initializeRemappers()

void ossimAtbController::initializeRemappers ( )
protected

Definition at line 467 of file ossimAtbController.cpp.

468 {
469  static const char MODULE[] = "ossimAtbController::initializeRemappers()";
470  if (traceExec()) CLOG << "entering..." << endl;
471 
472  int num_images = getNumberOfInputs();
473 
474  //***
475  // Fetch the overall mosaic bounding rect:
476  //***
478  getInput(0));
479  theBoundingRect = remapper->getBoundingRect();
480  for (int src=1; src<num_images; src++)
481  {
483  }
484 
485  //***
486  // Loop over each contribution image source chain to fetch each image
487  // bounding rect:
488  //***
489  double dx_ul, dy_ul, dx_lr, dy_lr;
490  double grid_ul_x, grid_ul_y, grid_lr_x, grid_lr_y;
491  for (int src=0; src<num_images; src++)
492  {
493  remapper = PTR_CAST(ossimGridRemapSource, getInput(src));
494  ossimDrect image_rect (remapper->getBoundingRect());
495 
496  //***
497  // Arrive at the number of grid posts from mosaic origin to image's grid
498  // UL and LR corners:
499  //***
500  dx_ul = (image_rect.ul().x - theBoundingRect.ul().x)/theGridSpacing.x;
501  dy_ul = (image_rect.ul().y - theBoundingRect.ul().y)/theGridSpacing.y;
502  dx_lr = (image_rect.lr().x - theBoundingRect.lr().x)/theGridSpacing.x;
503  dy_lr = (image_rect.lr().y - theBoundingRect.lr().y)/theGridSpacing.y;
504 
505  //***
506  // Establish the view coordinates for the adjusted image grid:
507  //***
508  grid_ul_x = theBoundingRect.ul().x + ceil(dx_ul)*theGridSpacing.x;
509  grid_ul_y = theBoundingRect.ul().y + ceil(dy_ul)*theGridSpacing.y;
510  grid_lr_x = theBoundingRect.lr().x + floor(dx_lr)*theGridSpacing.x;
511  grid_lr_y = theBoundingRect.lr().y + floor(dy_lr)*theGridSpacing.y;
512 
513  //***
514  // Have the remapper initialize a new grid with the given rectangle and
515  // spacing:
516  //***
517  ossimDrect grid_rect (grid_ul_x, grid_ul_y, grid_lr_x, grid_lr_y);
518  remapper->initialize(grid_rect, theGridSpacing);
519  }
520 
521  if (traceExec()) CLOG << "returning..." << endl;
522  return;
523 }
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
#define CLOG
Definition: ossimTrace.h:23
const ossimDpt & ul() const
Definition: ossimDrect.h:339
double y
Definition: ossimDpt.h:165
ossimDrect combine(const ossimDrect &rect) const
Definition: ossimDrect.h:826
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
ossim_int32 y
Definition: ossimIpt.h:142
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.
double x
Definition: ossimDpt.h:164
ossim_int32 x
Definition: ossimIpt.h:141
virtual void initialize(const ossimDrect &uv_rect, const ossimDpt &grid_spacing)
const ossimDpt & lr() const
Definition: ossimDrect.h:341

◆ initializeWithCombiner()

void ossimAtbController::initializeWithCombiner ( ossimImageCombiner combiner,
ossimGridRemapEngine engine = 0 
)

Provide alternate means of initialization in case default constructor used.

Definition at line 130 of file ossimAtbController.cpp.

132 {
133  static const char MODULE[] = "ossimAtbController::initializeWithCombiner()";
134  if (traceExec()) CLOG << "entering..." << endl;
135 
136  //***
137  // Assign default engine if non provided:
138  //***
139  if (engine)
141  else
143  = ossimGridRemapEngineFactory::create(DEFAULT_ATB_REMAP_ENGINE);
144 
145  //***
146  // This is the first combiner initializing the controller. The combiner
147  // will have all of the input sources connected already. We attach to
148  // these:
149  //***
151 
152  //***
153  // Need to scan the input connections of the combiner and insert a
154  // remapper if there is not one already at the end of the input chain:
155  //***
156  vector<ossimConnectableObject*> del_list;
157  vector<ossimConnectableObject*> add_list;
158  int numInputs = combiner->getNumberOfInputs();
159  for(int i=0; i<numInputs; i++)
160  {
162  combiner->getInput(i));
163 
164  if (input_image)
165  {
167  input_image);
168  if (remapper)
169  {
170  //***
171  // Remapper already present, set its remap engine to this
172  // controller's remap engine:
173  //***
175  }
176 
177  else
178  {
179  //***
180  // Need to instantiate remapper:
181  //***
182  remapper = new ossimGridRemapSource(input_image,
184  if (theContainer.valid())
185  theContainer->addChild(remapper);
186 
187  add_list.push_back(remapper);
188  del_list.push_back(input_image);
189  }
190 
191  connectMyInputTo(remapper);
192  }
193  }
194 
195  //***
196  // Need to delete the old inputs and add the new remappers to the
197  // combiner's input list:
198  //***
199  vector<ossimConnectableObject*>::iterator add_iter = add_list.begin();
200  vector<ossimConnectableObject*>::iterator del_iter = del_list.begin();
201  while (add_iter != add_list.end())
202  {
203  (*add_iter)->connectMyInputTo(*del_iter);
204  combiner->disconnect(*del_iter);
205  combiner->connectMyInputTo(*add_iter);
206  add_iter++;
207  del_iter++;
208  }
209  combiner->initialize();
210 
211  if (traceExec()) CLOG << "returning..." << endl;
212 }
static ossimGridRemapEngine * create(const char *spec)
virtual ossimObject * dup() const =0
void setRemapEngine(ossimGridRemapEngine *engine)
const ossimObject * getOwner() const
Fetches the current owner, most likely a container but not limited to one.
ossimGridRemapEngine * theGridRemapEngine
ossimRefPtr< ossimConnectableContainer > theContainer
#define CLOG
Definition: ossimTrace.h:23
virtual void disconnect(ossimConnectableObject *object=0)
Will disconnect the object passed in.
bool valid() const
Definition: ossimRefPtr.h:75
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
virtual bool addChild(ossimConnectableObject *attachableObject)
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.

◆ loadState()

bool ossimAtbController::loadState ( const ossimKeywordlist kwl)
virtual

Definition at line 430 of file ossimAtbController.cpp.

431 {
432  static const char MODULE[] = "ossimAtbController::loadState()";
433  if (traceExec()) CLOG << "entering..." << endl;
434 
435  CLOG << "NOTICE: this method not yet implemented." << endl;
436 
437  if (traceExec()) CLOG << "returning..." << endl;
438  return true;
439 }
#define CLOG
Definition: ossimTrace.h:23

◆ lockImage()

bool ossimAtbController::lockImage ( unsigned int  index)

Locks a particular source for adjustment. A locked image effectively defines the target values for all overlapping imagery.

Definition at line 259 of file ossimAtbController.cpp.

References ossimConnectableObject::getInput(), ossimConnectableObject::getNumberOfInputs(), ossimGridRemapSource::lock(), and PTR_CAST.

260 {
261  if (index >= getNumberOfInputs())
262  return false;
263 
265  getInput(index));
266  if (remapper)
267  remapper->lock();
268 
269  return true;
270 }
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.

◆ saveState()

bool ossimAtbController::saveState ( ossimKeywordlist kwl) const
virtual

Implementations of ossimStateInterface pure virtuals

Definition at line 415 of file ossimAtbController.cpp.

416 {
417  static const char MODULE[] = "ossimAtbController::saveState()";
418  if (traceExec()) CLOG << "entering..." << endl;
419 
420  CLOG << "NOTICE: this method not yet implemented." << endl;
421 
422  if (traceExec()) CLOG << "returning..." << endl;
423  return true;
424 }
#define CLOG
Definition: ossimTrace.h:23

◆ setGridRemapEngine()

void ossimAtbController::setGridRemapEngine ( ossimGridRemapEngine engine)

Sets the ATB remap engine. This object implements the specific tonal balancing algorithm. The dependency on number of bands and color space, is limited only to this engine. This facilitates the implementation of various grid-based image matching schemes.

Definition at line 529 of file ossimAtbController.cpp.

530 {
531  static const char MODULE[] = "ossimAtbController::setGridRemapEngine()";
532  if (traceExec()) CLOG << "entering..." << endl;
533 
534  theGridRemapEngine = engine;
535 
536  //***
537  // Communicate the new engine to all member's interested:
538  //***
539  ossimGridRemapSource* remapper;
540  ossimConnectableObject::ConnectableObjectList::iterator iter=theInputObjectList.begin();
541  while (iter != theInputObjectList.end())
542  {
543  remapper = PTR_CAST(ossimGridRemapSource, (*iter).get());
544  remapper->setRemapEngine(engine);
545  iter++;
546  }
547 
548  vector<ossimRefPtr<ossimAtbMatchPoint> >::iterator match_point = theMatchPoints.begin();
549  while (match_point != theMatchPoints.end())
550  {
551  (*match_point)->setGridRemapEngine(engine);
552  match_point++;
553  }
554 
555  if (traceExec()) CLOG << "returning..." << endl;
556  return;
557 }
void setRemapEngine(ossimGridRemapEngine *engine)
ossimGridRemapEngine * theGridRemapEngine
#define CLOG
Definition: ossimTrace.h:23
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
ConnectableObjectList theInputObjectList
Holds a list of input objects.
std::vector< ossimRefPtr< ossimAtbMatchPoint > > theMatchPoints

◆ setGridSpacing()

void ossimAtbController::setGridSpacing ( const ossimIpt spacing)

Sets the grid spacing used in gridding the mosaic's bounding rectangle.

◆ setKernelSize()

void ossimAtbController::setKernelSize ( int  side_size)

Hook to set the size of the kernel used by all point sources in computing their mean pixel value. The kernels will be resized to NxN.

Definition at line 449 of file ossimAtbController.cpp.

450 {
451  static const char MODULE[] = "ossimAtbController::setKernelSize(N)";
452  if (traceExec()) CLOG << "entering..." << endl;
453 
454  vector<ossimRefPtr<ossimAtbMatchPoint> >::iterator mpi = theMatchPoints.begin();
455  while (mpi != theMatchPoints.end())
456  (*mpi)->setKernelSize(side_size);
457 
458  if (traceExec()) CLOG << "returning..." << endl;
459  return;
460 }
#define CLOG
Definition: ossimTrace.h:23
std::vector< ossimRefPtr< ossimAtbMatchPoint > > theMatchPoints

◆ unlockImage()

bool ossimAtbController::unlockImage ( unsigned int  index)

Unlock a particular source for adjustment.

Definition at line 279 of file ossimAtbController.cpp.

References ossimConnectableObject::getInput(), ossimConnectableObject::getNumberOfInputs(), ossimGridRemapSource::lock(), and PTR_CAST.

280 {
281  if (index >= getNumberOfInputs())
282  return false;
283 
285  getInput(index));
286  if (remapper)
287  remapper->lock();
288 
289  return true;
290 }
ossimConnectableObject * getInput(ossim_uint32 index=0)
returns the object at the specified index.
#define PTR_CAST(T, p)
Definition: ossimRtti.h:321
virtual ossim_uint32 getNumberOfInputs() const
Returns the number of input objects.

Member Data Documentation

◆ theBoundingRect

ossimDrect ossimAtbController::theBoundingRect
protected

Definition at line 137 of file ossimAtbController.h.

◆ theContainer

ossimRefPtr<ossimConnectableContainer> ossimAtbController::theContainer
protected

Definition at line 138 of file ossimAtbController.h.

Referenced by ~ossimAtbController().

◆ theGridRemapEngine

ossimGridRemapEngine* ossimAtbController::theGridRemapEngine
protected

Definition at line 139 of file ossimAtbController.h.

Referenced by ~ossimAtbController().

◆ theGridSpacing

ossimIpt ossimAtbController::theGridSpacing
protected

Definition at line 141 of file ossimAtbController.h.

◆ theMatchPoints

std::vector<ossimRefPtr<ossimAtbMatchPoint> > ossimAtbController::theMatchPoints
protected

Definition at line 140 of file ossimAtbController.h.


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