jet.cpp 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@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. #include "jet.h"
  9. #include "colormap.h"
  10. template <typename T>
  11. IGL_INLINE void igl::jet(const T x, T * rgb)
  12. {
  13. igl::colormap(x, rgb, igl::CM_JET);
  14. }
  15. template <typename T>
  16. IGL_INLINE void igl::jet(const T x_in, T & r, T & g, T & b)
  17. {
  18. igl::colormap(x_in, r, g, b, igl::CM_JET);
  19. }
  20. template <typename DerivedZ, typename DerivedC>
  21. IGL_INLINE void igl::jet(
  22. const Eigen::PlainObjectBase<DerivedZ> & Z,
  23. const bool normalize,
  24. Eigen::PlainObjectBase<DerivedC> & C)
  25. {
  26. igl::colormap(Z, normalize, C, igl::CM_JET);
  27. }
  28. template <typename DerivedZ, typename DerivedC>
  29. IGL_INLINE void igl::jet(
  30. const Eigen::PlainObjectBase<DerivedZ> & Z,
  31. const double min_z,
  32. const double max_z,
  33. Eigen::PlainObjectBase<DerivedC> & C)
  34. {
  35. igl::colormap(Z, min_z, max_z, C, igl::CM_JET);
  36. }
  37. #ifdef IGL_STATIC_LIBRARY
  38. // Explicit template instantiation
  39. // generated by autoexplicit.sh
  40. template void igl::jet<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  41. template void igl::jet<double>(double, double*);
  42. template void igl::jet<double>(double, double&, double&, double&);
  43. template void igl::jet<float>(float, float*);
  44. template void igl::jet<Eigen::Array<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Array<double, -1, 1, 0, -1, 1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  45. template void igl::jet<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  46. template void igl::jet<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  47. template void igl::jet<float>(float, float&, float&, float&);
  48. template void igl::jet<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, double, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  49. template void igl::jet<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, double, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  50. template void igl::jet<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, double, double, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  51. #endif