60 va_start ( arglist , argc ) ;
66 fprintf ( stderr ,
"HPI ERROR: failed to activate Python interface\n" ) ;
74 pyarglist.
add ( plugin_name ) ;
76 for (
int argno = 0 ; argno < argc ; argno++ )
79 const char* type_name = va_arg ( arglist ,
const char* ) ;
81 void* pvalue = va_arg ( arglist ,
void* ) ;
85 if ( ! pyarglist.
add ( pyarg ) )
95 PyObject* arg_tuple = pyarglist.
yield() ;
120 using namespace HuginBase;
121 using namespace hugin_utils;
122 using namespace AppBase;
131 string input ( infile ) ;
133 ifstream prjfile(input.c_str());
138 "could not open script %s\n" ,
146 AppBase::DocumentData::ReadWriteError err = pano->readData(prjfile);
148 if (err != DocumentData::SUCCESSFUL)
152 "error while parsing panos tool script:" ,
154 "DocumentData::ReadWriteError code:" ,
159 fprintf ( stderr ,
"opened pano: %p\n" , pano ) ;
167 int main (
int argc ,
char* argv[] )
172 fprintf(stderr,
"Failed to open pano\n");
176 int success =
hsi::callhpi ( argv[2] , 1 ,
"HuginBase::Panorama*" , pano ) ;
core classes of the hpi interface, not for user code
void setFilePrefix(std::string prefix)
sets the path prefix of the images reffered with relative paths
PyObject * make_hsi_object(const char *hsi_type, void *hugin_value)
general function to make a Python object from a hugin object.
C++ call interface to hpi.
std::string getPathPrefix(const std::string &filename)
Get the path to a filename.
bool activate()
: loads the necessary modules hsi and hpi.
int callhpi(const char *plugin_name, int argc,...)
simplified call interface to the Python Plugin facility.
a class which encapsulates the python interface.
static python_interface hpi_instance
this is where we keep the single instance of class python_interface
PyObject * yield()
returns the generated PyObject Note that this will only succeed if the argument count is correct...
bool add(PyObject *python_arg)
add a python object to the argument list.
helper class to generated PyObject from C/C++/hugin classes
int call_hpi(const char *hpi_func, PyObject *pArgs)
call a routine in the hsi module with a bunch of parameters.
int main(int argc, char *argv[])