render_to_png_async.h 960 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef IGL_NO_BOOST
  2. #ifndef IGL_RENDER_TO_PNG_ASYNC_H
  3. #define IGL_RENDER_TO_PNG_ASYNC_H
  4. #include <igl/igl_inline.h>
  5. #include <boost/thread/thread.hpp>
  6. #include <string>
  7. namespace igl
  8. {
  9. // History:
  10. // added multithreaded parameter and support, Alec Sept 3, 2012
  11. //
  12. // Render current open GL image to .png file
  13. // Inputs:
  14. // png_file path to output .png file
  15. // width width of scene and resulting image
  16. // height height of scene and resulting image
  17. // alpha whether to include alpha channel
  18. // fast sacrifice compression ratio for speed
  19. // Returns true only if no errors occured
  20. //
  21. // See also: igl/render_to_tga which is faster but writes .tga files
  22. IGL_INLINE boost::thread render_to_png_async(
  23. const std::string png_file,
  24. const int width,
  25. const int height,
  26. const bool alpha = true,
  27. const bool fast = false);
  28. }
  29. #ifdef IGL_HEADER_ONLY
  30. # include "render_to_png_async.cpp"
  31. #endif
  32. #endif
  33. #endif