Realtime Fractal Renderer Documentation
Renderer Class Reference

The renderer of the application, responsible for calculating the colour for each pixel in the window. More...

#include <Renderer.h>

Collaboration diagram for Renderer:
Collaboration graph

Public Member Functions

 Renderer (uint32_t width, uint32_t height, std::ostream &log)
 
 ~Renderer ()
 
void render (const Camera &camera, double time)
 Renders the camera's view of the current scene to the colour buffer. More...
 
Scene load_scene (std::string scene_kernel_path, std::string build_options, size_t work_group_size)
 Attempts to load the scene from the specified kernel .cl path. More...
 
void save_screenshot (std::string path)
 Saves the contents of the colour buffer to a ppm format image, at the specified path. More...
 
DeviceStats getDeviceData ()
 
size_t getWorkGroupSize ()
 

Data Fields

uint8_t * buffer
 A buffer containing the most recent RGBA 0-255 colours. Array has capacity width x height. More...
 

Detailed Description

The renderer of the application, responsible for calculating the colour for each pixel in the window.

Definition at line 32 of file Renderer.h.

Constructor & Destructor Documentation

◆ Renderer()

Renderer ( uint32_t  width,
uint32_t  height,
std::ostream &  log 
)

Definition at line 12 of file Renderer.cpp.

◆ ~Renderer()

~Renderer ( )

Definition at line 23 of file Renderer.cpp.

Member Function Documentation

◆ getDeviceData()

DeviceStats getDeviceData ( )

Definition at line 107 of file Renderer.cpp.

◆ getWorkGroupSize()

size_t getWorkGroupSize ( )
inline

Definition at line 69 of file Renderer.h.

◆ load_scene()

Scene load_scene ( std::string  scene_kernel_path,
std::string  build_options,
size_t  work_group_size 
)

Attempts to load the scene from the specified kernel .cl path.

Parameters
scene_kernel_pathA path relative to the current directory for the the scene .cl kernel file
build_optionsOptions to be passed to the OpenCL compiler. Check the OpenCL C++ wrapper documentation for a full list of options
work_group_sizeDesired group size when distrubuting work over the GPU
Returns
A scene object for the specified kernel

Definition at line 300 of file Renderer.cpp.

◆ render()

void render ( const Camera camera,
double  time 
)

Renders the camera's view of the current scene to the colour buffer.

Parameters
cameraA camera viewing the current scene
timeThe current time since creation for the scene

Definition at line 386 of file Renderer.cpp.

◆ save_screenshot()

void save_screenshot ( std::string  path)

Saves the contents of the colour buffer to a ppm format image, at the specified path.

Parameters
pathA valid path for the image to be created at. It must use already existing directories.

Definition at line 444 of file Renderer.cpp.

Field Documentation

◆ buffer

uint8_t* buffer

A buffer containing the most recent RGBA 0-255 colours. Array has capacity width x height.

Definition at line 48 of file Renderer.h.


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