23#include <pybind11/pybind11.h>
30using namespace py::literals;
38template <
typename OutImageT,
typename InImageT>
39void declareByType(lsst::utils::python::WrapperCollection &wrappers) {
40 wrappers.wrap([](
auto &mod) {
41 mod.def(
"basicConvolve",
44 mod.def(
"basicConvolve",
47 mod.def(
"basicConvolve",
50 mod.def(
"basicConvolve",
53 mod.def(
"convolveWithBruteForce",
56 convolveWithBruteForce<OutImageT, InImageT>);
59template <
typename PixelType1,
typename PixelType2>
60void declareAll(lsst::utils::python::WrapperCollection &wrappers) {
65 declareByType<M1, M2>(wrappers);
70 using PyClass = py::class_<KernelImagesForRegion, std::shared_ptr<KernelImagesForRegion>>;
71 auto clsKernelImagesForRegion =
72 wrappers.wrapType(
PyClass(wrappers.module,
"KernelImagesForRegion"), [](
auto &mod,
auto &cls) {
73 cls.def(py::init<KernelImagesForRegion::KernelConstPtr, lsst::geom::Box2I const &,
74 lsst::geom::Point2I const &, bool>(),
75 "kernelPtr"_a,
"bbox"_a,
"xy0"_a,
"doNormalize"_a);
76 cls.def(py::init<KernelImagesForRegion::KernelConstPtr, lsst::geom::Box2I const &,
77 lsst::geom::Point2I const &, bool, KernelImagesForRegion::ImagePtr,
78 KernelImagesForRegion::ImagePtr, KernelImagesForRegion::ImagePtr,
79 KernelImagesForRegion::ImagePtr>(),
80 "kernelPtr"_a,
"bbox"_a,
"xy0"_a,
"doNormalize"_a,
"bottomLeftImagePtr"_a,
81 "bottomRightImagePtr"_a,
"topLeftImagePtr"_a,
"topRightImagePtr"_a);
83 cls.def(
"getBBox", &KernelImagesForRegion::getBBox);
84 cls.def(
"getXY0", &KernelImagesForRegion::getXY0);
85 cls.def(
"getDoNormalize", &KernelImagesForRegion::getDoNormalize);
86 cls.def(
"getImage", &KernelImagesForRegion::getImage);
87 cls.def(
"getKernel", &KernelImagesForRegion::getKernel);
88 cls.def(
"getPixelIndex", &KernelImagesForRegion::getPixelIndex);
89 cls.def(
"computeNextRow", &KernelImagesForRegion::computeNextRow);
90 cls.def_static(
"getMinInterpolationSize", KernelImagesForRegion::getMinInterpolationSize);
93 wrappers.wrapType(py::enum_<KernelImagesForRegion::Location>(clsKernelImagesForRegion,
"Location"),
94 [](
auto &mod,
auto &enm) {
103 wrappers.module,
"RowOfKernelImagesForRegion"),
104 [](
auto &mod,
auto &cls) {
105 cls.def(py::init<int, int>(),
"nx"_a,
"ny"_a);
107 cls.def(
"front", &RowOfKernelImagesForRegion::front);
108 cls.def(
"back", &RowOfKernelImagesForRegion::back);
109 cls.def(
"getNX", &RowOfKernelImagesForRegion::getNX);
110 cls.def(
"getNY", &RowOfKernelImagesForRegion::getNY);
111 cls.def(
"getYInd", &RowOfKernelImagesForRegion::getYInd);
112 cls.def(
"getRegion", &RowOfKernelImagesForRegion::getRegion);
113 cls.def(
"hasData", &RowOfKernelImagesForRegion::hasData);
114 cls.def(
"isLastRow", &RowOfKernelImagesForRegion::isLastRow);
115 cls.def(
"incrYInd", &RowOfKernelImagesForRegion::incrYInd);
119 wrappers.addSignatureDependency(
"lsst.afw.image");
120 wrappers.addSignatureDependency(
"lsst.afw.math");
122 declareAll<double, double>(wrappers);
123 declareAll<double, float>(wrappers);
124 declareAll<double, int>(wrappers);
125 declareAll<double, std::uint16_t>(wrappers);
126 declareAll<float, float>(wrappers);
127 declareAll<float, int>(wrappers);
128 declareAll<float, std::uint16_t>(wrappers);
129 declareAll<int, int>(wrappers);
130 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.
Parameters to control convolution.
A kernel that has only one non-zero pixel (of value 1)
Kernels are used for convolution with MaskedImages and (eventually) Images.
A kernel that is a linear combination of fixed basis kernels.
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
A row of KernelImagesForRegion.
void wrapConvolve(lsst::utils::python::WrapperCollection &wrappers)
void declareConvolve(lsst::utils::python::WrapperCollection &wrappers)
py::class_< PixelAreaBoundedField, std::shared_ptr< PixelAreaBoundedField >, BoundedField > PyClass