fast::RenderToImage class

Render to an image.

Use this process object to render to an Image object instead of a window on screen. Do this by connecting renderers to this object in order. Only supports 2D mode for now.

Base classes

class ProcessObject
Abstract base class for all process objects.

Public functions

auto create(Color bgcolor, int width, int height) -> std::shared_ptr<RenderToImage>
Create instance.
void addRenderer(std::shared_ptr<Renderer> renderer)
auto getRenderers() -> std::vector<std::shared_ptr<Renderer>>
auto connect(std::shared_ptr<Renderer> renderer) -> std::shared_ptr<RenderToImage>
auto connect(std::vector<std::shared_ptr<Renderer>> renderers) -> std::shared_ptr<RenderToImage>

Protected functions

void recalculateCamera()
void getMinMaxFromBoundingBoxes(bool transform, Vector3f& min, Vector3f& max)
void initializeGL()
void paintGL()

Protected variables

std::mutex m_mutex
std::atomic_bool m_initialized

Private functions

void execute() override

Function documentation

std::shared_ptr<RenderToImage> fast::RenderToImage::create(Color bgcolor, int width, int height)

Create instance.

Parameters
bgcolor Background color of scene
width Width of image to render to. If negative, the width will be determined using height and aspect ratio of scene.
height Height of image to render to. If negative, the height will be determined using width and aspect ratio of scene.