gtsam_points
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
guik::ScreenCapture Class Reference

Screen capture utility to asynchronously fetch rendering results and save them as images. More...

#include <screen_capture.hpp>

Public Types

using Pixels = std::vector< unsigned char >
 
using PixelsPtr = std::shared_ptr< Pixels >
 
using ImageSaveData = std::pair< std::string, PixelsPtr >
 

Public Member Functions

 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.
 
 ~ScreenCapture ()
 
size_t queue_size () const
 Image encoding queue size.
 
void capture (const std::string &dst_filename)
 Capture the viewer main canvas and save it as a image file.
 
void capture (const std::string &dst_filename, const glk::Texture &texture)
 Capture texture contents and save it as a image file.
 

Detailed Description

Screen capture utility to asynchronously fetch rendering results and save them as images.

Note
The saving process is very computationally heavy as it encodes each frame as PNG or JPG.

Member Typedef Documentation

◆ ImageSaveData

using guik::ScreenCapture::ImageSaveData = std::pair<std::string, PixelsPtr>

◆ Pixels

using guik::ScreenCapture::Pixels = std::vector<unsigned char>

◆ PixelsPtr

using guik::ScreenCapture::PixelsPtr = std::shared_ptr<Pixels>

Constructor & Destructor Documentation

◆ ScreenCapture()

guik::ScreenCapture::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::StdConcurrentQueueImageSaveData > >() 
)

Constructor.

Parameters
image_sizeImage size
num_encode_threadsNumber of threds for image encoding
num_pixel_buffersNumber of pixel buffers
queueConcurrent data queue (Use TbbConcurrentQueue for better multi-threading performance)

◆ ~ScreenCapture()

guik::ScreenCapture::~ScreenCapture ( )

Member Function Documentation

◆ capture() [1/2]

void guik::ScreenCapture::capture ( const std::string &  dst_filename)

Capture the viewer main canvas and save it as a image file.

Parameters
dst_filenameFilename (must end with ".png" or ".jpg")

◆ capture() [2/2]

void guik::ScreenCapture::capture ( const std::string &  dst_filename,
const glk::Texture texture 
)

Capture texture contents and save it as a image file.

Parameters
dst_filenameFilename (must end with ".png" or ".jpg")

◆ queue_size()

size_t guik::ScreenCapture::queue_size ( ) const

Image encoding queue size.


The documentation for this class was generated from the following file: