render_to_tga.h 686 B

12345678910111213141516171819202122232425262728
  1. #ifndef IGL_RENDER_TO_TGA_H
  2. #define IGL_RENDER_TO_TGA_H
  3. #include "igl_inline.h"
  4. #include <string>
  5. namespace igl
  6. {
  7. // Render current open GL image to .tga file
  8. // Inputs:
  9. // tga_file path to output .tga file
  10. // width width of scene and resulting image
  11. // height height of scene and resulting image
  12. /// alpha whether to include alpha channel
  13. // Returns true only if no errors occured
  14. //
  15. // See also: png/render_to_png which is slower but writes .png files
  16. IGL_INLINE bool render_to_tga(
  17. const std::string tga_file,
  18. const int width,
  19. const int height,
  20. const bool alpha);
  21. }
  22. #ifdef IGL_HEADER_ONLY
  23. # include "render_to_tga.cpp"
  24. #endif
  25. #endif