gradient_paint.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  18. # ifndef GLM_ENABLE_EXPERIMENTAL
  19. # pragma message("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.")
  20. # else
  21. # pragma message("GLM: GLM_GTX_gradient_paint extension included")
  22. # endif
  23. #endif
  24. namespace glm
  25. {
  26. /// @addtogroup gtx_gradient_paint
  27. /// @{
  28. /// Return a color from a radial gradient.
  29. /// @see - gtx_gradient_paint
  30. template<typename T, qualifier Q>
  31. GLM_FUNC_DECL T radialGradient(
  32. vec<2, T, Q> const& Center,
  33. T const& Radius,
  34. vec<2, T, Q> const& Focal,
  35. vec<2, T, Q> const& Position);
  36. /// Return a color from a linear gradient.
  37. /// @see - gtx_gradient_paint
  38. template<typename T, qualifier Q>
  39. GLM_FUNC_DECL T linearGradient(
  40. vec<2, T, Q> const& Point0,
  41. vec<2, T, Q> const& Point1,
  42. vec<2, T, Q> const& Position);
  43. /// @}
  44. }// namespace glm
  45. #include "gradient_paint.inl"