Kanzi 4.1.0
kanzi::LinearFramebuffer Class Reference

LinearFramebuffer class is a temporary render target for linear color workflow. More...

#include <kanzi/core.ui/application/application.hpp>

Public Member Functions

TextureSharedPtr getTexture () const
 Get the texture used as render target in the framebuffer.
 
 LinearFramebuffer (Domain *domain)
 Constructs the linear framebuffer object.
 
void resolve (Renderer &renderer)
 Render a framebuffer sized quad with linear to sRGB shader material.
 
void update (Domain *domain, Renderer &renderer, unsigned int width, unsigned int height)
 Update framebuffer resolution.
 
 ~LinearFramebuffer ()
 Destructs the linear framebuffer object.
 

Detailed Description

LinearFramebuffer class is a temporary render target for linear color workflow.

LinearFramebuffer is needed because it is not possible to create sRGB backbuffer with emscripten/WebGL. This class can be used to capture rendering from the application and resolve it using linear to sRGB converting shader so that the backbuffer contents are correctly gamma corrected.

Constructor & Destructor Documentation

◆ LinearFramebuffer()

kanzi::LinearFramebuffer::LinearFramebuffer ( Domain * domain)
explicit

Constructs the linear framebuffer object.

◆ ~LinearFramebuffer()

kanzi::LinearFramebuffer::~LinearFramebuffer ( )

Destructs the linear framebuffer object.

Member Function Documentation

◆ update()

void kanzi::LinearFramebuffer::update ( Domain * domain,
Renderer & renderer,
unsigned int width,
unsigned int height )

Update framebuffer resolution.

Parameters
domainDomain for the framebuffer.
rendererRenderer for the framebuffer.
widthWidth of the framebuffer.
heightHeight f the framebuffer,

◆ resolve()

void kanzi::LinearFramebuffer::resolve ( Renderer & renderer)

Render a framebuffer sized quad with linear to sRGB shader material.

Parameters
rendererRenderer for the framebuffer.

◆ getTexture()

TextureSharedPtr kanzi::LinearFramebuffer::getTexture ( ) const
inline

Get the texture used as render target in the framebuffer.

Returns
Shared pointer to the texture object.

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