gradient_paint.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /// @ref gtx_gradient_paint
  2. /// @file glm/gtx/gradient_paint.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtx_optimum_pow (dependence)
  6. ///
  7. /// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint
  8. /// @ingroup gtx
  9. ///
  10. /// Include <glm/gtx/gradient_paint.hpp> to use the features of this extension.
  11. ///
  12. /// Functions that return the color of procedural gradient for specific coordinates.
  13. #pragma once
  14. // Dependency:
  15. #include "../glm.hpp"
  16. #include "../gtx/optimum_pow.hpp"
  17. #ifndef GLM_ENABLE_EXPERIMENTAL
  18. # error "GLM: GLM_GTX_gradient_paint is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
  19. #endif
  20. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  21. # pragma message("GLM: GLM_GTX_gradient_paint extension included")
  22. #endif
  23. namespace glm
  24. {
  25. /// @addtogroup gtx_gradient_paint
  26. /// @{
  27. /// Return a color from a radial gradient.
  28. /// @see - gtx_gradient_paint
  29. template<typename T, qualifier Q>
  30. GLM_FUNC_DECL T radialGradient(
  31. vec<2, T, Q> const& Center,
  32. T const& Radius,
  33. vec<2, T, Q> const& Focal,
  34. vec<2, T, Q> const& Position);
  35. /// Return a color from a linear gradient.
  36. /// @see - gtx_gradient_paint
  37. template<typename T, qualifier Q>
  38. GLM_FUNC_DECL T linearGradient(
  39. vec<2, T, Q> const& Point0,
  40. vec<2, T, Q> const& Point1,
  41. vec<2, T, Q> const& Position);
  42. /// @}
  43. }// namespace glm
  44. #include "gradient_paint.inl"