Horizon
export_3d_image.hpp
1 #pragma once
2 #include <string>
3 #include <vector>
4 #include "canvas3d/canvas3d_base.hpp"
5 #include <cairomm/cairomm.h>
6 
7 namespace horizon {
8 
9 class Image3DExporter : public Canvas3DBase {
10 public:
11  Image3DExporter(const class Board &brd, class IPool &pool, unsigned int width, unsigned int height);
12 
13  void load_3d_models();
14  Cairo::RefPtr<Cairo::Surface> render_to_surface();
15  virtual ~Image3DExporter();
16 
17  const bool &get_render_background() const
18  {
19  return render_background;
20  }
21  void set_render_background(const bool &v)
22  {
23  render_background = v;
24  }
25 
26 private:
27  class IPool &pool;
28  void *ctx = nullptr; // to get around including osmesa here
29  std::vector<unsigned char> buffer;
30  void check_ctx();
31  bool render_background = false;
32 };
33 
34 } // namespace horizon
Definition: board.hpp:43
Definition: canvas3d_base.hpp:20
Definition: ipool.hpp:14
Definition: export_3d_image.hpp:9