Classes | Macros | Functions | Variables
apriltag_pywrap.c File Reference
#include <stdbool.h>
#include <Python.h>
#include <structmember.h>
#include <numpy/arrayobject.h>
#include <signal.h>
#include "apriltag.h"
#include "tag36h10.h"
#include "tag36h11.h"
#include "tag25h9.h"
#include "tag16h5.h"
#include "tagCircle21h7.h"
#include "tagCircle49h12.h"
#include "tagCustom48h12.h"
#include "tagStandard41h12.h"
#include "tagStandard52h13.h"
#include "apriltag_detect_docstring.h"
#include "apriltag_py_type_docstring.h"
Include dependency graph for apriltag_pywrap.c:

Go to the source code of this file.

Classes

struct  apriltag_py_t
 

Macros

#define FAMILY_STRING(name)   " " #name "\n"
 
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
 
#define PYMETHODDEF_ENTRY(function_prefix, name, args)
 
#define RESET_SIGINT()
 
#define SET_SIGINT()
 
#define SUPPORTED_TAG_FAMILIES(_)
 
#define TAG_CREATE_FAMILY(name)   else if (0 == strcmp(family, #name)) self->tf = name ## _create();
 
#define TAG_SET_DESTROY_FUNC(name)   else if (0 == strcmp(family, #name)) self->destroy_func = name ## _destroy;
 

Functions

static void apriltag_dealloc (apriltag_py_t *self)
 
static PyObject * apriltag_detect (apriltag_py_t *self, PyObject *args)
 
static PyObject * apriltag_new (PyTypeObject *type, PyObject *args, PyObject *kwargs)
 
PyMODINIT_FUNC PyInit_apriltag (void)
 

Variables

static PyMethodDef apriltag_methods []
 
static PyTypeObject apriltagType
 
static PyMethodDef methods []
 
static struct PyModuleDef module_def
 

Macro Definition Documentation

◆ FAMILY_STRING

#define FAMILY_STRING (   name)    " " #name "\n"

Definition at line 36 of file apriltag_pywrap.c.

◆ NPY_NO_DEPRECATED_API

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION

Definition at line 1 of file apriltag_pywrap.c.

◆ PYMETHODDEF_ENTRY

#define PYMETHODDEF_ENTRY (   function_prefix,
  name,
  args 
)
Value:
{#name, \
(PyCFunction)function_prefix ## name, \
args, \
function_prefix ## name ## _docstring}

Definition at line 61 of file apriltag_pywrap.c.

◆ RESET_SIGINT

#define RESET_SIGINT ( )
Value:
do { \
if( 0 != sigaction(SIGINT, \
&sigaction_old, NULL )) \
PyErr_SetString(PyExc_RuntimeError, "sigaction-restore failed"); \
} while(0)

Definition at line 55 of file apriltag_pywrap.c.

◆ SET_SIGINT

#define SET_SIGINT ( )
Value:
struct sigaction sigaction_old; \
do { \
if( 0 != sigaction(SIGINT, \
&(struct sigaction){ .sa_handler = SIG_DFL }, \
&sigaction_old) ) \
{ \
PyErr_SetString(PyExc_RuntimeError, "sigaction() failed"); \
goto done; \
} \
} while(0)

Definition at line 45 of file apriltag_pywrap.c.

◆ SUPPORTED_TAG_FAMILIES

#define SUPPORTED_TAG_FAMILIES (   _)
Value:
_(tag36h10) \
_(tag36h11) \
_(tag25h9) \
_(tag16h5) \
_(tagCircle21h7) \
_(tagCircle49h12) \
_(tagStandard41h12) \
_(tagStandard52h13) \
_(tagCustom48h12)

Definition at line 21 of file apriltag_pywrap.c.

◆ TAG_CREATE_FAMILY

#define TAG_CREATE_FAMILY (   name)    else if (0 == strcmp(family, #name)) self->tf = name ## _create();

Definition at line 32 of file apriltag_pywrap.c.

◆ TAG_SET_DESTROY_FUNC

#define TAG_SET_DESTROY_FUNC (   name)    else if (0 == strcmp(family, #name)) self->destroy_func = name ## _destroy;

Definition at line 34 of file apriltag_pywrap.c.

Function Documentation

◆ apriltag_dealloc()

static void apriltag_dealloc ( apriltag_py_t self)
static

Definition at line 184 of file apriltag_pywrap.c.

◆ apriltag_detect()

static PyObject* apriltag_detect ( apriltag_py_t self,
PyObject *  args 
)
static

Definition at line 202 of file apriltag_pywrap.c.

◆ apriltag_new()

static PyObject* apriltag_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwargs 
)
static

Definition at line 76 of file apriltag_pywrap.c.

◆ PyInit_apriltag()

PyMODINIT_FUNC PyInit_apriltag ( void  )

Definition at line 372 of file apriltag_pywrap.c.

Variable Documentation

◆ apriltag_methods

PyMethodDef apriltag_methods[]
static
Initial value:
=
{ PYMETHODDEF_ENTRY(apriltag_, detect, METH_VARARGS),
{NULL, NULL, 0, NULL}
}

Definition at line 319 of file apriltag_pywrap.c.

◆ apriltagType

PyTypeObject apriltagType
static
Initial value:
=
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "apriltag",
.tp_basicsize = sizeof(apriltag_py_t),
.tp_new = apriltag_new,
.tp_dealloc = (destructor)apriltag_dealloc,
.tp_methods = apriltag_methods,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_doc = apriltag_py_type_docstring
}

Definition at line 324 of file apriltag_pywrap.c.

◆ methods

PyMethodDef methods[]
static
Initial value:
=
{ {NULL, NULL, 0, NULL}
}

Definition at line 336 of file apriltag_pywrap.c.

◆ module_def

struct PyModuleDef module_def
static
Initial value:
=
{
PyModuleDef_HEAD_INIT,
"apriltag",
"AprilTags visual fiducial system detector",
-1,
0,
0,
0,
0
}

Definition at line 359 of file apriltag_pywrap.c.

methods
static PyMethodDef methods[]
Definition: apriltag_pywrap.c:336
PYMETHODDEF_ENTRY
#define PYMETHODDEF_ENTRY(function_prefix, name, args)
Definition: apriltag_pywrap.c:61
apriltag_methods
static PyMethodDef apriltag_methods[]
Definition: apriltag_pywrap.c:319
apriltag_dealloc
static void apriltag_dealloc(apriltag_py_t *self)
Definition: apriltag_pywrap.c:184
apriltag_new
static PyObject * apriltag_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
Definition: apriltag_pywrap.c:76
apriltag_py_t
Definition: apriltag_pywrap.c:66


apriltag
Author(s): Edwin Olson , Max Krogius
autogenerated on Sun Apr 20 2025 02:08:47