Utils.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // This file is part of HDRip.
  2. //
  3. // HDRip is free software: you can redistribute it and/or modify it
  4. // under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation, either version 3 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // HDRip is distributed in the hope that it will be useful, but
  9. // WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with HDRip. If not, see <https://www.gnu.org/licenses/>.
  15. //
  16. // HDRip project
  17. // Author : Rémi Synave
  18. // Contact : remi.synave@univ-littoral.fr
  19. #ifndef UTILS__HPP
  20. #define UTILS_HPP
  21. #include <Eigen/Core>
  22. class Utils
  23. {
  24. public:
  25. static float* interp(const float* x, const unsigned int tx, const Eigen::RowVectorXf& xd, const Eigen::RowVectorXf& yd);
  26. static float interp(float x, float xd1, float yd1, float xd2, float yd2);
  27. static unsigned int search(float to_search, const Eigen::RowVectorXf& data);
  28. static unsigned int search(float to_search, const float* data, unsigned int first, unsigned int last);
  29. static float* NPlinearWeightMask(float* x, unsigned int length, float xMin, float xMax, float xTolerance);
  30. };
  31. #endif