1#ifndef GUIK_SCREEN_CAPTURE
2#define GUIK_SCREEN_CAPTURE
25 using Pixels = std::vector<unsigned char>;
37 const Eigen::Vector2i& image_size,
38 int num_encode_threads,
39 int num_pixel_buffers = 2,
52 void capture(
const std::string& dst_filename);
64 const Eigen::Vector2i image_size;
67 std::vector<std::string> dst_filenames;
68 std::vector<std::shared_ptr<glk::PixelBuffer>> pixel_buffers;
70 std::atomic_bool kill_switch;
71 std::vector<std::thread> encode_threads;
73 std::shared_ptr<guik::ConcurrentQueue<ImageSaveData>> input_queue;
Definition texture.hpp:10
Definition concurrent_queue.hpp:10
Screen capture utility to asynchronously fetch rendering results and save them as images.
Definition screen_capture.hpp:23
ScreenCapture(const Eigen::Vector2i &image_size, int num_encode_threads, int num_pixel_buffers=2, std::shared_ptr< guik::ConcurrentQueue< ImageSaveData > > queue=std::make_shared< guik::StdConcurrentQueue< ImageSaveData > >())
Constructor.
size_t queue_size() const
Image encoding queue size.
std::pair< std::string, PixelsPtr > ImageSaveData
Definition screen_capture.hpp:27
void capture(const std::string &dst_filename)
Capture the viewer main canvas and save it as a image file.
std::shared_ptr< Pixels > PixelsPtr
Definition screen_capture.hpp:26
void capture(const std::string &dst_filename, const glk::Texture &texture)
Capture texture contents and save it as a image file.
std::vector< unsigned char > Pixels
Definition screen_capture.hpp:25
Definition concurrent_queue.hpp:20
Definition async_buffer_copy.hpp:6
Definition drawable_container.hpp:9