jet.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #ifndef IGL_JET_H
  9. #define IGL_JET_H
  10. #include "igl_inline.h"
  11. //#ifndef IGL_NO_EIGEN
  12. # include <Eigen/Dense>
  13. //#endif
  14. namespace igl
  15. {
  16. // JET like MATLAB's jet
  17. //
  18. // Inputs:
  19. // m number of colors
  20. // Outputs:
  21. // J m by list of RGB colors between 0 and 1
  22. //
  23. //#ifndef IGL_NO_EIGEN
  24. // void jet(const int m, Eigen::MatrixXd & J);
  25. //#endif
  26. // Wrapper for directly computing [r,g,b] values for a given factor f between
  27. // 0 and 1
  28. //
  29. // Inputs:
  30. // f factor determining color value as if 0 was min and 1 was max
  31. // Outputs:
  32. // r red value
  33. // g green value
  34. // b blue value
  35. template <typename T>
  36. [[deprecated("The jet functions have been refactored into a general colormap function set and are tagged for removal -- see igl/colormap.h")]]
  37. IGL_INLINE void jet(const T f, T * rgb);
  38. template <typename T>
  39. [[deprecated("The jet functions have been refactored into a general colormap function set and are tagged for removal -- see igl/colormap.h")]]
  40. IGL_INLINE void jet(const T f, T & r, T & g, T & b);
  41. // Inputs:
  42. // Z #Z list of factors
  43. // normalize whether to normalize Z to be tightly between [0,1]
  44. // Outputs:
  45. // C #C by 3 list of rgb colors
  46. template <typename DerivedZ, typename DerivedC>
  47. [[deprecated("The jet functions have been refactored into a general colormap function set and are tagged for removal -- see igl/colormap.h")]]
  48. IGL_INLINE void jet(
  49. const Eigen::PlainObjectBase<DerivedZ> & Z,
  50. const bool normalize,
  51. Eigen::PlainObjectBase<DerivedC> & C);
  52. // Inputs:
  53. // min_z value at blue
  54. // max_z value at red
  55. template <typename DerivedZ, typename DerivedC>
  56. [[deprecated("The jet functions have been refactored into a general colormap function set and are tagged for removal -- see igl/colormap.h")]]
  57. IGL_INLINE void jet(
  58. const Eigen::PlainObjectBase<DerivedZ> & Z,
  59. const double min_Z,
  60. const double max_Z,
  61. Eigen::PlainObjectBase<DerivedC> & C);
  62. };
  63. #ifndef IGL_STATIC_LIBRARY
  64. # include "jet.cpp"
  65. #endif
  66. #endif