/src/core/GpuShaderUtils.h

http://github.com/imageworks/OpenColorIO · C Header · 58 lines · 21 code · 9 blank · 28 comment · 0 complexity · b97d79d48531131748b3a70573dc7d9c MD5 · raw file

  1. /*
  2. Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
  3. All Rights Reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions are
  6. met:
  7. * Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in the
  11. documentation and/or other materials provided with the distribution.
  12. * Neither the name of Sony Pictures Imageworks nor the names of its
  13. contributors may be used to endorse or promote products derived from
  14. this software without specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  19. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  21. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #ifndef INCLUDED_OCIO_GPUSHADERUTILS_H
  28. #define INCLUDED_OCIO_GPUSHADERUTILS_H
  29. #include <OpenColorIO/OpenColorIO.h>
  30. #include <sstream>
  31. OCIO_NAMESPACE_ENTER
  32. {
  33. std::string GpuTextHalf4x4(const float * m44, GpuLanguage lang);
  34. std::string GpuTextHalf4(const float * v4, GpuLanguage lang);
  35. std::string GpuTextHalf3(const float * v3, GpuLanguage lang);
  36. void Write_mtx_x_vec(std::ostream & os,
  37. const std::string & mtx, const std::string & vec,
  38. GpuLanguage lang);
  39. void Write_half4x4(std::ostream & os, const float * m44, GpuLanguage lang);
  40. void Write_half4(std::ostream & os, const float * v4, GpuLanguage lang);
  41. void Write_half3(std::ostream & os, const float * v3, GpuLanguage lang);
  42. // returns vec3
  43. void Write_sampleLut3D_rgb(std::ostream & os, const std::string & variableName,
  44. const std::string & lutName, int lut3DEdgeLen,
  45. GpuLanguage lang);
  46. }
  47. OCIO_NAMESPACE_EXIT
  48. #endif