render_to_png_async.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_PNG_RENDER_TO_PNG_ASYNC_H
  9. #define IGL_PNG_RENDER_TO_PNG_ASYNC_H
  10. #include <igl/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
  22. // Inputs:
  23. // png_file path to output .png file
  24. // width width of scene and resulting image
  25. // height height of scene and resulting image
  26. // alpha whether to include alpha channel
  27. // fast sacrifice compression ratio for speed
  28. // Returns true only if no errors occured
  29. //
  30. // See also: igl/render_to_tga which is faster but writes .tga files
  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