diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-05-14 00:51:55 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-05-14 00:51:55 +0000 |
commit | b2d03716ee053cd32dccb8dd189d0b4bc3540d90 (patch) | |
tree | d329b3f92d5f80b8a76cac17d9e30bd1c8dc4b06 /contrib/python/matplotlib/py2/src/py_converters.h | |
parent | 645c59acc8ced6d89eb8559e26a7405d42ae9fb4 (diff) | |
parent | 0bf9db6399352012396e7791bcfd762e944b33c2 (diff) | |
download | ydb-b2d03716ee053cd32dccb8dd189d0b4bc3540d90.tar.gz |
Merge branch 'rightlib' into merge-libs-250514-0050
Diffstat (limited to 'contrib/python/matplotlib/py2/src/py_converters.h')
-rw-r--r-- | contrib/python/matplotlib/py2/src/py_converters.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/contrib/python/matplotlib/py2/src/py_converters.h b/contrib/python/matplotlib/py2/src/py_converters.h new file mode 100644 index 00000000000..02d84affe85 --- /dev/null +++ b/contrib/python/matplotlib/py2/src/py_converters.h @@ -0,0 +1,49 @@ +/* -*- mode: c++; c-basic-offset: 4 -*- */ + +#ifndef __PY_CONVERTERS_H__ +#define __PY_CONVERTERS_H__ + +/*************************************************************************** + * This module contains a number of conversion functions from Python types + * to C++ types. Most of them meet the Python "converter" signature: + * + * typedef int (*converter)(PyObject *, void *); + * + * and thus can be passed as conversion functions to PyArg_ParseTuple + * and friends. + */ + +#include <Python.h> +#include "numpy_cpp.h" +#include "_backend_agg_basic_types.h" + +extern "C" { +typedef int (*converter)(PyObject *, void *); + +int convert_from_attr(PyObject *obj, const char *name, converter func, void *p); +int convert_from_method(PyObject *obj, const char *name, converter func, void *p); + +int convert_double(PyObject *obj, void *p); +int convert_bool(PyObject *obj, void *p); +int convert_cap(PyObject *capobj, void *capp); +int convert_join(PyObject *joinobj, void *joinp); +int convert_rect(PyObject *rectobj, void *rectp); +int convert_rgba(PyObject *rgbaocj, void *rgbap); +int convert_dashes(PyObject *dashobj, void *gcp); +int convert_dashes_vector(PyObject *obj, void *dashesp); +int convert_trans_affine(PyObject *obj, void *transp); +int convert_path(PyObject *obj, void *pathp); +int convert_clippath(PyObject *clippath_tuple, void *clippathp); +int convert_snap(PyObject *obj, void *snapp); +int convert_offset_position(PyObject *obj, void *offsetp); +int convert_sketch_params(PyObject *obj, void *sketchp); +int convert_gcagg(PyObject *pygc, void *gcp); +int convert_points(PyObject *pygc, void *pointsp); +int convert_transforms(PyObject *pygc, void *transp); +int convert_bboxes(PyObject *pygc, void *bboxp); +int convert_colors(PyObject *pygc, void *colorsp); + +int convert_face(PyObject *color, GCAgg &gc, agg::rgba *rgba); +} + +#endif |