jet.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. IGL_INLINE void jet(const T f, T * rgb);
  37. template <typename T>
  38. IGL_INLINE void jet(const T f, T & r, T & g, T & b);
  39. };
  40. #ifdef IGL_HEADER_ONLY
  41. # include "jet.cpp"
  42. #endif
  43. #endif