lsst.afw  13.0-94-ga1c444047
color.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2008-2017 AURA/LSST.
4  *
5  * This product includes software developed by the
6  * LSST Project (http://www.lsst.org/).
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 
23 #include "pybind11/pybind11.h"
24 
25 #include <limits>
26 
27 #include "lsst/afw/image/Color.h"
28 
29 namespace py = pybind11;
30 using namespace pybind11::literals;
31 
32 namespace lsst {
33 namespace afw {
34 namespace image {
35 namespace {
36 
37 using PyColor = py::class_<Color, std::shared_ptr<Color>>;
38 
40  py::module mod("color");
41 
42  /* Module level */
43  PyColor cls(mod, "Color");
44 
45  /* Constructors */
46  cls.def(py::init<double>(), "g_r"_a = std::numeric_limits<double>::quiet_NaN());
47 
48  /* Operators */
49  cls.def("__eq__", [](Color const& self, Color const& other) { return self == other; }, py::is_operator());
50  cls.def("__ne__", [](Color const& self, Color const& other) { return self != other; }, py::is_operator());
51 
52  /* Members */
53  cls.def("isIndeterminate", &Color::isIndeterminate);
54  cls.def("getLambdaEff", &Color::getLambdaEff, "filter"_a);
55 
56  return mod.ptr();
57 }
58 }
59 }
60 }
61 } // namespace lsst::afw::image::<anonymous>
PYBIND11_PLUGIN(_cameraPoint)
Definition: cameraPoint.cc:35
A base class for image defects.
Definition: cameraGeom.dox:3