-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgjslib_c.cpp
More file actions
89 lines (78 loc) · 2.33 KB
/
gjslib_c.cpp
File metadata and controls
89 lines (78 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*a Copyright
This file 'gjslib_c.cpp' copyright Gavin J Stark 2016
This is free software; you can redistribute it and/or modify it however you wish,
with no obligations
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
*/
/*a Includes
*/
#include <Python.h>
#include <OpenGL/gl3.h>
#include "python_filter.h"
#include "python_texture.h"
#include "python_image_correlator.h"
#include "python_quaternion_image_correlator.h"
#include "python_lens_projection.h"
#include "python_quaternion.h"
#include "python_vector.h"
/*a Defines
*/
/*a Types
*/
/*f gl_get_errors
*/
int gl_get_errors(const char *msg)
{
GLenum err;
int num_errors;
num_errors = 0;
while ((err = glGetError()) != GL_NO_ERROR) {
fprintf(stderr,"OpenGL error %s : %d\n", msg, err);
num_errors++;
}
return num_errors;
}
/*a Statics
*/
/*v gjslib_c_module_methods
*/
static PyMethodDef gjslib_c_module_methods[] =
{
{NULL, NULL, 0, NULL} /* Sentinel */
};
/*a C code for gjslib_c
*/
extern "C" void initgjslib_c( void )
{
PyObject *module;
if ( python_quaternion_init_premodule() ||
python_vector_init_premodule() ||
python_image_correlator_init_premodule() ||
python_quaternion_image_correlator_init_premodule() ||
python_texture_init_premodule() ||
python_lens_projection_init_premodule() ||
python_filter_init_premodule() ) {
fprintf(stderr,"Failed initialization of classes\n");
return;
}
module = Py_InitModule3("gjslib_c", gjslib_c_module_methods, "C version of gjslib" );
if (!module) {
fprintf(stderr,"Failed initialization of module\n");
return;
}
python_lens_projection_init_postmodule(module);
python_texture_init_postmodule(module);
python_image_correlator_init_postmodule(module);
python_quaternion_image_correlator_init_postmodule(module);
python_filter_init_postmodule(module);
python_quaternion_init_postmodule(module);
python_vector_init_postmodule(module);
}
/*a Editor preferences and notes
mode: c ***
c-basic-offset: 4 ***
c-default-style: (quote ((c-mode . "k&r") (c++-mode . "k&r"))) ***
outline-regexp: "/\\\*a\\\|[\t ]*\/\\\*[b-z][\t ]" ***
*/