23 #include <pybind11/pybind11.h>
24 #include <pybind11/stl.h>
28 #include "ndarray/pybind11.h"
40 using namespace py::literals;
47 using PyClass = py::class_<BoundedField, std::shared_ptr<BoundedField>>;
49 template <
typename PixelT>
51 cls.def(
"fillImage", &BoundedField::fillImage<PixelT>,
52 "image"_a,
"overlapOnly"_a =
false,
"xStep"_a = 1,
"yStep"_a = 1);
53 cls.def(
"addToImage", &BoundedField::addToImage<PixelT>,
"image"_a,
"scaleBy"_a = 1.0,
54 "overlapOnly"_a =
false,
"xStep"_a = 1,
"yStep"_a = 1);
55 cls.def(
"multiplyImage", &BoundedField::multiplyImage<PixelT>,
56 "image"_a,
"overlapOnly"_a =
false,
"xStep"_a = 1,
"yStep"_a = 1);
57 cls.def(
"divideImage", &BoundedField::divideImage<PixelT>,
58 "image"_a,
"overlapOnly"_a =
false,
"xStep"_a = 1,
"yStep"_a = 1);
64 table::io::python::addPersistableMethods<BoundedField>(
cls);
67 cls.def(
"__mul__", &BoundedField::operator*, py::is_operator());
68 cls.def(
"__truediv__", &BoundedField::operator/, py::is_operator());
69 cls.def(
"__eq__", &BoundedField::operator==, py::is_operator());
70 cls.def(
"__ne__", &BoundedField::operator!=, py::is_operator());
74 (ndarray::Array<double, 1, 1> (
BoundedField::*)(ndarray::Array<double const, 1>
const &,
75 ndarray::Array<double const, 1>
const &)
const) &
84 declareTemplates<double>(
cls);
85 declareTemplates<float>(
cls);
90 os <<
"BoundedField(" <<
self <<
")";