ccColorRampShader.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //##########################################################################
  2. //# #
  3. //# CLOUDCOMPARE #
  4. //# #
  5. //# This program is free software; you can redistribute it and/or modify #
  6. //# it under the terms of the GNU General Public License as published by #
  7. //# the Free Software Foundation; version 2 or later of the License. #
  8. //# #
  9. //# This program is distributed in the hope that it will be useful, #
  10. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  11. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  12. //# GNU General Public License for more details. #
  13. //# #
  14. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  15. //# #
  16. //##########################################################################
  17. #ifndef CC_COLOR_RAMP_SHADER_HEADER
  18. #define CC_COLOR_RAMP_SHADER_HEADER
  19. //Always on top!
  20. #include "ccIncludeGL.h"
  21. //CCFbo
  22. #include <ccShader.h>
  23. //Local
  24. #include "ccColorScale.h"
  25. class QCC_DB_LIB_API ccColorRampShader : public ccShader
  26. {
  27. Q_OBJECT
  28. public:
  29. //! Default constructor
  30. ccColorRampShader();
  31. //! Destructor
  32. virtual ~ccColorRampShader() {}
  33. //! Setups shader
  34. /** Shader must have already been stared!
  35. **/
  36. bool setup(QOpenGLFunctions_2_1* glFunc, float minSatRel, float maxSatRel, unsigned colorSteps, const ccColorScale::Shared& colorScale);
  37. //! Returns the maximum color ramp size
  38. static unsigned MaxColorRampSize();
  39. //! Returns the minimum memory required on the shader side
  40. /** See GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
  41. **/
  42. static GLint MinRequiredBytes();
  43. };
  44. #endif //CC_COLOR_RAMP_SHADER_HEADER