render_to_png_async.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_PNG_RENDER_TO_PNG_ASYNC_H
  9. #define IGL_PNG_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 png
  17. {
  18. // History:
  19. // added multithreaded parameter and support, Alec Sept 3, 2012
  20. //
  21. /// Render current open GL image to .png file using a separate thread
  22. ///
  23. /// @param[in] png_file path to output .png file
  24. /// @param[in] width width of scene and resulting image
  25. /// @param[in] height height of scene and resulting image
  26. /// @param[in] alpha whether to include alpha channel
  27. /// @param[in] fast sacrifice compression ratio for speed
  28. /// @return true only if no errors occurred
  29. ///
  30. /// \see render_to_png
  31. IGL_INLINE std::thread render_to_png_async(
  32. const std::string png_file,
  33. const int width,
  34. const int height,
  35. const bool alpha = true,
  36. const bool fast = false);
  37. }
  38. }
  39. #ifndef IGL_STATIC_LIBRARY
  40. # include "render_to_png_async.cpp"
  41. #endif
  42. #endif