render_to_png_async.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  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_NO_BOOST
  9. #ifndef IGL_RENDER_TO_PNG_ASYNC_H
  10. #define IGL_RENDER_TO_PNG_ASYNC_H
  11. #include <igl/igl_inline.h>
  12. #include <boost/thread/thread.hpp>
  13. #include <string>
  14. namespace igl
  15. {
  16. // History:
  17. // added multithreaded parameter and support, Alec Sept 3, 2012
  18. //
  19. // Render current open GL image to .png file
  20. // Inputs:
  21. // png_file path to output .png file
  22. // width width of scene and resulting image
  23. // height height of scene and resulting image
  24. // alpha whether to include alpha channel
  25. // fast sacrifice compression ratio for speed
  26. // Returns true only if no errors occured
  27. //
  28. // See also: igl/render_to_tga which is faster but writes .tga files
  29. IGL_INLINE boost::thread render_to_png_async(
  30. const std::string png_file,
  31. const int width,
  32. const int height,
  33. const bool alpha = true,
  34. const bool fast = false);
  35. }
  36. #ifdef IGL_HEADER_ONLY
  37. # include "render_to_png_async.cpp"
  38. #endif
  39. #endif
  40. #endif