render_to_file_async.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_OPENGL_STB_RENDER_TO_PNG_ASYNC_H
  9. #define IGL_OPENGL_STB_RENDER_TO_PNG_ASYNC_H
  10. #include "../../igl_inline.h"
  11. #include <thread>
  12. //#include <boost/thread/thread.hpp>
  13. #include <string>
  14. namespace igl
  15. {
  16. namespace opengl
  17. {
  18. namespace stb
  19. {
  20. // History:
  21. // added multithreaded parameter and support, Alec Sept 3, 2012
  22. //
  23. /// Render current open GL image to file using a separate thread
  24. ///
  25. /// @param[in] filename path to output image file
  26. /// @param[in] width width of scene and resulting image
  27. /// @param[in] height height of scene and resulting image
  28. /// @param[in] alpha whether to include alpha channel
  29. /// @param[in] fast sacrifice compression ratio for speed
  30. /// @return true only if no errors occurred
  31. ///
  32. /// \see render_to_file
  33. IGL_INLINE std::thread render_to_file_async(
  34. const std::string filename,
  35. const int width,
  36. const int height,
  37. const bool alpha = true,
  38. const bool fast = false);
  39. }
  40. }
  41. }
  42. #ifndef IGL_STATIC_LIBRARY
  43. # include "render_to_file_async.cpp"
  44. #endif
  45. #endif