rgb_to_hsv.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <[email protected]>
  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_RGB_TO_HSV_H
  9. #define IGL_RGB_TO_HSV_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Convert RGB to HSV
  15. ///
  16. /// @param[in] rgb rgb triplet in (0,1)³
  17. /// @param[out] hsv hsv triplet in (0,360),(0,1),(0,1)
  18. template <typename R,typename H>
  19. IGL_INLINE void rgb_to_hsv(const R * rgb, H * hsv);
  20. /// \overload
  21. /// @param[in] R #R by 3 list of rgb triplets in (0,1)ⁿˣ³
  22. /// @param[out] H #R by 3 list of hsv triplets in [(0,360),(0,1),(0,1)]ⁿ
  23. template <typename DerivedR,typename DerivedH>
  24. IGL_INLINE void rgb_to_hsv(
  25. const Eigen::MatrixBase<DerivedR> & R,
  26. Eigen::PlainObjectBase<DerivedH> & H);
  27. };
  28. #ifndef IGL_STATIC_LIBRARY
  29. # include "rgb_to_hsv.cpp"
  30. #endif
  31. #endif