Hugin trunk 0.1
Loading...
Searching...
No Matches
hpi_classes.h
Go to the documentation of this file.
1
15/* This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
19 *
20 * This software is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this software. If not, see
27 * <http://www.gnu.org/licenses/>.
28 *
29 * KFJ 2011-01-18
30 *
31 */
32
33#ifdef MAC_SELF_CONTAINED_BUNDLE
34 #include <Python27/Python.h>
35#else
36 #include <Python.h> // always first
37#endif // MAC_SELF_CONTAINED_BUNDLE
38#include "swigpyrun.h" // contains SWIG access
39#include <panodata/Panorama.h>
40
41namespace hpi
42{
51{
52private :
60 PyObject* load_module ( const char* name );
61
62public:
65 /* destructor, does cleanup */
67
75 bool activate();
76
83 int call_hpi ( const char* hpi_func ,
84 PyObject* pArgs );
85};
86
89{
90 // the class members are private
91private :
93 int argc;
94 int have;
95
96public:
104 PyObject* make_hsi_object ( const char* hsi_type ,
105 void* hugin_value );
106
111 explicit python_arglist ( int _argc );
114
115public :
121 bool add ( PyObject* python_arg );
127 bool add ( const char* str );
131 PyObject* yield();
132};
133
134}; //namespace
helper class to generated PyObject from C/C++/hugin classes
Definition hpi_classes.h:89
bool add(PyObject *python_arg)
add a python object to the argument list.
PyObject * make_hsi_object(const char *hsi_type, void *hugin_value)
general function to make a Python object from a hugin object.
PyObject * yield()
returns the generated PyObject Note that this will only succeed if the argument count is correct.
~python_arglist()
destructor, does cleanup
a class which encapsulates the python interface.
Definition hpi_classes.h:51
python_interface()
constructor
Definition hpi_classes.h:64
PyObject * hsi_module
pointer to loaded hsi module
Definition hpi_classes.h:56
bool activate()
: loads the necessary modules hsi and hpi.
int call_hpi(const char *hpi_func, PyObject *pArgs)
call a routine in the hsi module with a bunch of parameters.
PyObject * load_module(const char *name)
general module-loading function
bool activated
flag, true if activated
Definition hpi_classes.h:54
PyObject * hpi_module
pointer to loaded hpi module
Definition hpi_classes.h:58
Definition hpi.cpp:51
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41