1 //*******************************************************************
2 //
3 // License:  See top level LICENSE.txt file.
4 //
5 // AUTHOR: Oscar Kramer (okramer@imagelinks.com)
6 //
7 // DESCRIPTION: Contains declaration of class ossimAtbPointSource.
8 //   This object provides the statistics associated with a given point on a
9 //   given image corresponding to a matchpoint. A matchpoint contains a
10 //   collection of these point sources, one for each contributing image.
11 //
12 // LIMITATIONS: None.
13 //
14 //*****************************************************************************
15 //  $Id: ossimAtbPointSource.h 15766 2009-10-20 12:37:09Z gpotts $
16 
17 #ifndef ossimAtbPointSource_HEADER
18 #define ossimAtbPointSource_HEADER
19 
20 #include <ossim/base/ossimDpt.h>
21 #include <ossim/base/ossimReferenced.h>
22 #include <ossim/base/ossimRefPtr.h>
23 
24 class ossimImageSource;
25 class ossimImageData;
26 class ossimGridRemapSource;
27 class ossimGridRemapEngine;
28 
29 /*!****************************************************************************
30  *
31  * CLASS: ossimAtbPointSource
32  *
33  *****************************************************************************/
34 class ossimAtbPointSource : public ossimReferenced
35 {
36 public:
37    ossimAtbPointSource();
38    ossimAtbPointSource(ossimGridRemapSource* remap_source,
39                        const ossimDpt&       view_point);
40 
41 
42    /*!
43     * Sets the pointer of the source of pixels used to compute the stats.
44     */
45    void setRemapSource(ossimGridRemapSource* image_source);
46 
47    /*!
48     * Returns the reference to the remapper feeding this source.
49     */
50    ossimGridRemapSource* getRemapSource() { return theRemapSource.get(); }
51 
52    /*!
53     * Sets the view coordinates corresponding to this point.
54     */
55    void setViewPoint(const ossimDpt& view_point);
56 
57    /*!
58     * Returns the view point corresponding to this point source.
59     */
60    const ossimDpt& getViewPoint() const { return theViewPoint; }
61 
62    /*!
63     * Returns the computed value vector corresponding to the region about the
64     * view point. The ATB Remap engine performs the actual computation, since
65     * the definition of "value" is algorithm dependent (the value may be in a
66     * different color space).
67     */
68    void getSourceValue(void* value);
69 
70    /*!
71     * Method to set the kernel size used in computing statistics. The kernel
72     * will be resized to NxN.
73     */
74    void setKernelSize(int side_size);
75 
76    /*!
77     * Sets the ATB remap engine reference owned by the controller. This engine
78     * is the only object that understands how to compute remap parameters from
79     * pixel data. This permits easily modifying the ATB algorithm without
80     * the support classes such as this one.
qos_init(void)81     */
82    void setGridRemapEngine(ossimGridRemapEngine* engine)
83       { theGridRemapEngine = engine; }
84 protected:
85    virtual ~ossimAtbPointSource();
86 
87 private:
88 
89    ossimRefPtr<ossimGridRemapSource> theRemapSource;
90    ossimDpt              theViewPoint;
91    ossimRefPtr<ossimGridRemapEngine> theGridRemapEngine;
92    int                   theKernelSize;
93    bool                  theViewPointIsValid;
94 };
95 
96 #endif
97