py_parula.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. //m.def("parula", []
  9. //(
  10. // const double f,
  11. // T * rgb
  12. //)
  13. //{
  14. // return igl::parula(f, rgb);
  15. //}, __doc_igl_parula,
  16. //py::arg("f"), py::arg("rgb"));
  17. m.def("parula", []
  18. (
  19. const double f
  20. )
  21. {
  22. double r, g, b;
  23. igl::parula(f, r, g, b);
  24. return std::make_tuple(r,g,b);
  25. }, __doc_igl_parula,
  26. py::arg("f"));
  27. m.def("parula", []
  28. (
  29. const double f,
  30. double & r,
  31. double & g,
  32. double & b
  33. )
  34. {
  35. return igl::parula(f, r, g, b);
  36. }, __doc_igl_parula,
  37. py::arg("f"), py::arg("r"), py::arg("g"), py::arg("b"));
  38. m.def("parula", []
  39. (
  40. const Eigen::MatrixXd& Z,
  41. const bool normalize,
  42. Eigen::MatrixXd& C
  43. )
  44. {
  45. assert_is_VectorX("Z",Z);
  46. return igl::parula(Z, normalize, C);
  47. }, __doc_igl_parula,
  48. py::arg("Z"), py::arg("normalize"), py::arg("C"));
  49. m.def("parula", []
  50. (
  51. const Eigen::MatrixXd& Z,
  52. const double min_Z,
  53. const double max_Z,
  54. Eigen::MatrixXd& C
  55. )
  56. {
  57. assert_is_VectorX("Z",Z);
  58. return igl::parula(Z, min_Z, max_Z, C);
  59. }, __doc_igl_parula,
  60. py::arg("Z"), py::arg("min_Z"), py::arg("max_Z"), py::arg("C"));