aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/contourpy/src/common.h
blob: cc4bc851a064526f5d05e52a5b2901c5fb6b3377 (plain) (blame)
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
#ifndef CONTOURPY_COMMON_H
#define CONTOURPY_COMMON_H

#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>

namespace contourpy {

namespace py = pybind11;

// quad/point index type, the same as for numpy array shape/indices (== npy_intp).  Also used for
// chunks.
typedef py::ssize_t index_t;

// Count of points, lines and holes.
typedef py::size_t count_t;

// Offsets into point arrays.
typedef uint32_t offset_t;

// Input numpy array classes.
typedef py::array_t<double, py::array::c_style | py::array::forcecast> CoordinateArray;
typedef py::array_t<bool,   py::array::c_style | py::array::forcecast> MaskArray;

// Output numpy array classes.
typedef py::array_t<double>   PointArray;
typedef py::array_t<uint8_t>  CodeArray;
typedef py::array_t<offset_t> OffsetArray;

} // namespace contourpy

#endif // CONTOURPY_COMMON_H