LSST Applications g011c388f00+f985364e28,g0265f82a02+cefac37fe7,g16a3bce237+cefac37fe7,g2079a07aa2+b9108c1c87,g2bbee38e9b+cefac37fe7,g337abbeb29+cefac37fe7,g3ddfee87b4+425a3f5e02,g4cf46543a9+2ef32aa566,g50ff169b8f+8309cf5058,g52b1c1532d+43dac7135f,g5d89126706+46afc7f72d,g83996f0134+2fb8039c37,g858d7b2824+59f22cc8bb,g87e100324b+59f22cc8bb,g8a8a8dda67+43dac7135f,g99855d9996+1ea0a8cf94,g9d147d8712+4559cd7206,g9ddcbc5298+389b8f2b7e,ga1e77700b3+4bafba478f,ga8c6da7877+1b58c58f75,gae46bcf261+cefac37fe7,gb700894bec+f0b514b300,gb8350603e9+4979c46fed,gba4ed39666+fb465f0d3e,gbeb006f7da+bf3b4a8997,gc86a011abf+59f22cc8bb,gcf0d15dbbd+425a3f5e02,gd162630629+d0c22ff203,gd44f2fa1a7+91fd017016,gdaeeff99f8+6b435c3f92,ge79ae78c31+cefac37fe7,ge9008a0c34+425a3f5e02,gee10cc3b42+43dac7135f,gf041782ebf+713927f999,gf1cff7945b+59f22cc8bb,w.2024.07
LSST Data Management Base Package
Loading...
Searching...
No Matches
findSetBits.cc
Go to the documentation of this file.
1/*
2 * LSST Data Management System
3 *
4 * This product includes software developed by the
5 * LSST Project (http://www.lsst.org/).
6 * See the COPYRIGHT file
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the LSST License Statement and
19 * the GNU General Public License along with this program. If not,
20 * see <https://www.lsstcorp.org/LegalNotices/>.
21 */
22#include "pybind11/pybind11.h"
24
25#include <string>
26
29
30namespace py = pybind11;
31using namespace pybind11::literals;
32
33namespace lsst {
34namespace ip {
35namespace diffim {
36
37namespace {
38
46template <typename MaskT>
47void declareFindSetBits(lsst::cpputils::python::WrapperCollection &wrappers, std::string const& suffix) {
48 using PyFindSetBits = py::class_<FindSetBits<MaskT>>;
49
50 std::string name = "FindSetBits" + suffix;
51 wrappers.wrapType(PyFindSetBits(wrappers.module, name.c_str()), [](auto &mod, auto &cls) {
52
53 cls.def(py::init<>());
54
55 cls.def("reset", &FindSetBits<MaskT>::reset);
56 cls.def("getBits", &FindSetBits<MaskT>::getBits);
57 cls.def("apply", &FindSetBits<MaskT>::apply, "mask"_a);
58 });
59}
60
61} // namespace lsst::ip::diffim::<anonymous>
62
64 declareFindSetBits<afw::image::Mask<afw::image::MaskPixel>>(wrappers, "U");
65}
66
67} // diffim
68} // ip
69} // lsst
table::Key< std::string > name
Definition Amplifier.cc:116
Image Subtraction helper functions.
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
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...
Definition python.h:391
void wrapFindSetBits(WrapperCollection &wrappers)