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

#include <ossimAtbPointSource.h>

Inheritance diagram for ossimAtbPointSource:
ossimReferenced

Public Member Functions

 ossimAtbPointSource ()
 
 ossimAtbPointSource (ossimGridRemapSource *remap_source, const ossimDpt &view_point)
 
void setRemapSource (ossimGridRemapSource *image_source)
 
ossimGridRemapSourcegetRemapSource ()
 
void setViewPoint (const ossimDpt &view_point)
 
const ossimDptgetViewPoint () const
 
void getSourceValue (void *value)
 
void setKernelSize (int side_size)
 
void setGridRemapEngine (ossimGridRemapEngine *engine)
 
- 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
 

Protected Member Functions

virtual ~ossimAtbPointSource ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Private Attributes

ossimRefPtr< ossimGridRemapSourcetheRemapSource
 
ossimDpt theViewPoint
 
ossimRefPtr< ossimGridRemapEnginetheGridRemapEngine
 
int theKernelSize
 
bool theViewPointIsValid
 

Detailed Description


CLASS: ossimAtbPointSource

Definition at line 34 of file ossimAtbPointSource.h.

Constructor & Destructor Documentation

◆ ossimAtbPointSource() [1/2]

ossimAtbPointSource::ossimAtbPointSource ( )

Definition at line 37 of file ossimAtbPointSource.cpp.

38  : theRemapSource (0),
40  theKernelSize (DEFAULT_KERNEL_SIZE),
41  theViewPointIsValid (false)
42 {
43  static const char MODULE[] = "ossimAtbPointSource Default Constructor";
44  if (traceExec()) CLOG << "entering..." << endl;
45 
46  if (traceExec()) CLOG << "returning..." << endl;
47 }
#define CLOG
Definition: ossimTrace.h:23
ossimRefPtr< ossimGridRemapEngine > theGridRemapEngine
ossimRefPtr< ossimGridRemapSource > theRemapSource

◆ ossimAtbPointSource() [2/2]

ossimAtbPointSource::ossimAtbPointSource ( ossimGridRemapSource remap_source,
const ossimDpt view_point 
)

Definition at line 54 of file ossimAtbPointSource.cpp.

56  : theRemapSource (source),
57  theGridRemapEngine (source->getRemapEngine()),
58  theKernelSize (DEFAULT_KERNEL_SIZE),
59  theViewPointIsValid (false)
60 {
61  static const char MODULE[] = "ossimAtbPointSource Default Constructor";
62  if (traceExec()) CLOG << "entering..." << endl;
63 
64  setViewPoint(view_point);
65 
66  if (traceExec()) CLOG << "returning..." << endl;
67 }
#define CLOG
Definition: ossimTrace.h:23
ossimRefPtr< ossimGridRemapEngine > theGridRemapEngine
ossimRefPtr< ossimGridRemapSource > theRemapSource
void setViewPoint(const ossimDpt &view_point)

◆ ~ossimAtbPointSource()

ossimAtbPointSource::~ossimAtbPointSource ( )
protectedvirtual

Definition at line 74 of file ossimAtbPointSource.cpp.

75 {
76 }

Member Function Documentation

◆ getRemapSource()

ossimGridRemapSource* ossimAtbPointSource::getRemapSource ( )
inline

Returns the reference to the remapper feeding this source.

Definition at line 50 of file ossimAtbPointSource.h.

References ossimRefPtr< T >::get(), and theRemapSource.

50 { return theRemapSource.get(); }
ossimRefPtr< ossimGridRemapSource > theRemapSource

◆ getSourceValue()

void ossimAtbPointSource::getSourceValue ( void *  value)

Returns the computed value vector corresponding to the region about the view point. The ATB Remap engine performs the actual computation, since the definition of "value" is algorithm dependent (the value may be in a different color space).

Definition at line 132 of file ossimAtbPointSource.cpp.

133 {
134  static const char MODULE[] = "ossimAtbPointSource::getSourceValue()";
135  if (traceExec()) CLOG << "entering..." << endl;
136 
137  //***
138  // Verify that members are initialized before processing:
139  //***
141  {
142  CLOG <<"ERROR: This object was not properly initialized before attempting"
143  <<" to compute target value! Returning usassigned vector..."<<endl;
144  return;
145  }
146 
147  //***
148  // Extract the data kernel from the image chain:
149  //***
150  ossimIpt kernel_2d_size (theKernelSize, theKernelSize);
151  ossimIpt kernel_ul (theViewPoint - kernel_2d_size/2.0);
152  ossimIpt kernel_lr (kernel_ul.x + kernel_2d_size.x - 1,
153  kernel_ul.y + kernel_2d_size.y - 1);
154  ossimIrect kernel_rect (kernel_ul, kernel_lr);
155  ossimRefPtr<ossimImageData> kernel_data =
156  theRemapSource->getTile(kernel_rect);
157 
158  //***
159  // Fetch the value of the data kernel. Note: this is not necessarily in
160  // the same color space as the pixels. It depends on which engine is being
161  // utilized:
162  //***
163  theGridRemapEngine->computeSourceValue(kernel_data, value_vector);
164 
165 // delete kernel_data;
166 
167  if (traceExec()) CLOG << "returning..." << endl;
168  return;
169 }
#define CLOG
Definition: ossimTrace.h:23
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &origin, ossim_uint32 resLevel=0)
ossimRefPtr< ossimGridRemapEngine > theGridRemapEngine
ossimRefPtr< ossimGridRemapSource > theRemapSource
virtual void computeSourceValue(ossimRefPtr< ossimImageData > &source, void *result)=0

◆ getViewPoint()

const ossimDpt& ossimAtbPointSource::getViewPoint ( ) const
inline

Returns the view point corresponding to this point source.

Definition at line 60 of file ossimAtbPointSource.h.

References theViewPoint.

60 { return theViewPoint; }

◆ setGridRemapEngine()

void ossimAtbPointSource::setGridRemapEngine ( ossimGridRemapEngine engine)
inline

Sets the ATB remap engine reference owned by the controller. This engine is the only object that understands how to compute remap parameters from pixel data. This permits easily modifying the ATB algorithm without the support classes such as this one.

Definition at line 82 of file ossimAtbPointSource.h.

References theGridRemapEngine.

83  { theGridRemapEngine = engine; }
ossimRefPtr< ossimGridRemapEngine > theGridRemapEngine

◆ setKernelSize()

void ossimAtbPointSource::setKernelSize ( int  side_size)

Method to set the kernel size used in computing statistics. The kernel will be resized to NxN.

Definition at line 179 of file ossimAtbPointSource.cpp.

180 {
181  static const char MODULE[] = "ossimAtbPointSource::setKernelSize()";
182  if (traceExec()) CLOG << "entering..." << endl;
183 
184  theKernelSize = side_size;
185 
186  if (traceExec()) CLOG << "returning..." << endl;
187  return;
188 }
#define CLOG
Definition: ossimTrace.h:23

◆ setRemapSource()

void ossimAtbPointSource::setRemapSource ( ossimGridRemapSource image_source)

Sets the pointer of the source of pixels used to compute the stats.

Definition at line 84 of file ossimAtbPointSource.cpp.

85 {
86  static const char MODULE[] = "ossimAtbPointSource::setRemapSource()";
87  if (traceExec()) CLOG << "entering..." << endl;
88 
89  theRemapSource = source;
90 
91  //***
92  // Also fetch the remap engine which should be a derived ossimAtbRemapEngine:
93  //***
95 
96  if (traceExec()) CLOG << "returning..." << endl;
97  return;
98 }
#define CLOG
Definition: ossimTrace.h:23
ossimGridRemapEngine * getRemapEngine()
ossimRefPtr< ossimGridRemapEngine > theGridRemapEngine
ossimRefPtr< ossimGridRemapSource > theRemapSource

◆ setViewPoint()

void ossimAtbPointSource::setViewPoint ( const ossimDpt view_point)

Sets the view coordinates corresponding to this point.

Definition at line 107 of file ossimAtbPointSource.cpp.

108 {
109  static const char MODULE[] = "ossimAtbPointSource::setViewPoint()";
110  if (traceExec()) CLOG << "entering..." << endl;
111 
112  theViewPoint = view_point;
113 
114  if ((theRemapSource.valid()) &&
116  theViewPointIsValid = true;
117  else
118  theViewPointIsValid = false;
119 
120  if (traceExec()) CLOG << "returning..." << endl;
121  return;
122 }
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
#define CLOG
Definition: ossimTrace.h:23
bool valid() const
Definition: ossimRefPtr.h:75
ossimRefPtr< ossimGridRemapSource > theRemapSource
bool pointWithin(const ossimIpt &pt) const
Definition: ossimIrect.h:729

Member Data Documentation

◆ theGridRemapEngine

ossimRefPtr<ossimGridRemapEngine> ossimAtbPointSource::theGridRemapEngine
private

Definition at line 91 of file ossimAtbPointSource.h.

Referenced by setGridRemapEngine().

◆ theKernelSize

int ossimAtbPointSource::theKernelSize
private

Definition at line 92 of file ossimAtbPointSource.h.

◆ theRemapSource

ossimRefPtr<ossimGridRemapSource> ossimAtbPointSource::theRemapSource
private

Definition at line 89 of file ossimAtbPointSource.h.

Referenced by getRemapSource().

◆ theViewPoint

ossimDpt ossimAtbPointSource::theViewPoint
private

Definition at line 90 of file ossimAtbPointSource.h.

Referenced by getViewPoint().

◆ theViewPointIsValid

bool ossimAtbPointSource::theViewPointIsValid
private

Definition at line 93 of file ossimAtbPointSource.h.


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