23 #include <pybind11/pybind11.h>
29 using namespace py::literals;
36 template <
typename OutImageT,
typename InImageT,
typename KernelT>
38 wrappers.
wrap([](
auto &mod) {
40 (
void (*)(OutImageT &, InImageT
const &, KernelT
const &,
41 ConvolutionControl
const &))convolve<OutImageT, InImageT, KernelT>,
42 "convolvedImage"_a,
"inImage"_a,
"kernel"_a,
"convolutionControl"_a = ConvolutionControl());
44 (
void (*)(OutImageT &, InImageT
const &, KernelT
const &,
bool,
45 bool))convolve<OutImageT, InImageT, KernelT>,
46 "convolvedImage"_a,
"inImage"_a,
"kernel"_a,
"doNormalize"_a,
"doCopyEdge"_a =
false);
50 template <
typename ImageType1,
typename ImageType2>
52 wrappers.
wrap([](
auto &mod) {
54 (
void (*)(ImageType1 &,
double, ImageType2
const &,
double, ImageType2
const &))
scaledPlus);
58 template <
typename ImageType1,
typename ImageType2>
60 declareConvolve<ImageType1, ImageType2, AnalyticKernel>(wrappers);
61 declareConvolve<ImageType1, ImageType2, DeltaFunctionKernel>(wrappers);
62 declareConvolve<ImageType1, ImageType2, FixedKernel>(wrappers);
63 declareConvolve<ImageType1, ImageType2, LinearCombinationKernel>(wrappers);
64 declareConvolve<ImageType1, ImageType2, SeparableKernel>(wrappers);
65 declareConvolve<ImageType1, ImageType2, Kernel>(wrappers);
66 declareScaledPlus<ImageType1, ImageType2>(wrappers);
69 template <
typename PixelType1,
typename PixelType2>
75 declareByType<M1, M2>(wrappers);
79 using PyClass = py::class_<ConvolutionControl, std::shared_ptr<ConvolutionControl>>;
81 clsl.def(py::init<bool, bool, int>(),
"doNormalize"_a = true,
"doCopyEdge"_a = false,
82 "maxInterpolationDistance"_a = 10);
84 clsl.def(
"getDoNormalize", &ConvolutionControl::getDoNormalize);
85 clsl.def(
"getDoCopyEdge", &ConvolutionControl::getDoCopyEdge);
86 clsl.def(
"getMaxInterpolationDistance", &ConvolutionControl::getMaxInterpolationDistance);
87 clsl.def(
"setDoNormalize", &ConvolutionControl::setDoNormalize);
88 clsl.def(
"setDoCopyEdge", &ConvolutionControl::setDoCopyEdge);
89 clsl.def(
"setMaxInterpolationDistance", &ConvolutionControl::setMaxInterpolationDistance);
96 declareConvolveImage(wrappers);
97 declareAll<double, double>(wrappers);
98 declareAll<double, float>(wrappers);
99 declareAll<double, int>(wrappers);
100 declareAll<double, std::uint16_t>(wrappers);
101 declareAll<float, float>(wrappers);
102 declareAll<float, int>(wrappers);
103 declareAll<float, std::uint16_t>(wrappers);
104 declareAll<int, int>(wrappers);
105 declareAll<std::uint16_t, std::uint16_t>(wrappers);
A class to represent a 2-dimensional array of pixels.
A class to manipulate images, masks, and variance as a single object.
A helper class for subdividing pybind11 module across multiple translation units (i....
pybind11::module module
The module object passed to the PYBIND11_MODULE block that contains this WrapperCollection.
PyType wrapType(PyType cls, ClassWrapperCallback function, bool setModuleName=true)
Add a type (class or enum) wrapper, deferring method and other attribute definitions until finish() i...
void wrap(WrapperCallback function)
Add a set of wrappers without defining a class.
void addSignatureDependency(std::string const &name)
Indicate an external module that provides a type used in function/method signatures.
void declareConvolve(lsst::utils::python::WrapperCollection &wrappers)
void scaledPlus(OutImageT &outImage, double c1, InImageT const &inImage1, double c2, InImageT const &inImage2)
Compute the scaled sum of two images.
void wrapConvolveImage(lsst::utils::python::WrapperCollection &wrappers)
py::class_< PixelAreaBoundedField, std::shared_ptr< PixelAreaBoundedField >, BoundedField > PyClass
A base class for image defects.