LeiaSR SDK 720218b2 v1.32.7.6322 2025-02-13T14:55:38Z
Stable
Public Member Functions | Protected Attributes | List of all members
SR::GLWeaverBase Class Reference

class to be used to add Weaving to OpenGL based SR applications More...

#include <glweaver.h>

Inheritance diagram for SR::GLWeaverBase:
[legend]

Public Member Functions

 GLWeaverBase ()
 
 ~GLWeaverBase ()
 
GLuint getFrameBuffer ()
 Returns the buffer that will be used to create a weaved imaged. This buffer expects a side-by-side image. More...
 
void setInputFrameBuffer (GLuint frameBufferID, GLuint renderedTextureID)
 Sets the buffer that will be used to create a weaved image. More...
 
void setWindowHandle (HWND handle)
 Sets the window handle of the application window. If the weaver was created using a deprecated constructor, setting window handle has no effect. More...
 
void setContrast (float contrast)
 Sets the weaving contrast. More...
 
float getContrast () const
 Gets the current weaving contrast. More...
 
void setShaderSRGBConversion (bool read, bool write)
 Sets whether to apply shader sRGB<->Linear color space conversions to the input framebuffer during weaving. More...
 
void setACTMode (WeaverACTMode mode)
 Sets the anti-crosstalk mode. More...
 
WeaverACTMode getACTMode () const
 Gets the anti-crosstalk mode. More...
 
void setCrosstalkStaticFactor (float factor)
 Sets the anti-crosstalk factor. More...
 
float getCrosstalkStaticFactor () const
 Gets the anti-crosstalk factor. More...
 
void setCrosstalkDynamicFactor (float factor)
 Sets the anti-crosstalk dynamic factor. More...
 
float getCrosstalkDynamicFactor () const
 Gets the anti-crosstalk dynamic factor. More...
 
bool canWeave ()
 Used to determine if software weaving is possible on this device. More...
 
bool canWeave (unsigned int width, unsigned int height)
 Used to determine if software weaving is possible for certain size and visibility to the currently bound framebuffer. More...
 
bool canWeave (unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset)
 Used to determine if software weaving is possible for certain size and visibility to the currently bound framebuffer. More...
 
void weave (unsigned int width, unsigned int height)
 Can be called to render a weaved image of a certain size to the currently bound framebuffer. More...
 
void weave (unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset)
 Can be called to render a weaved image of a certain size to the currently bound framebuffer. More...
 
void enableLateLatching (bool enable)
 Enables late latching. Note that late latching requires applications to call weave() once per frame, and does not work with deferred contexts. More...
 
bool isLateLatchingEnabled () const
 Determines if late latching is enabled. More...
 

Protected Attributes

std::unique_ptr< Impl > pimpl
 

Detailed Description

class to be used to add Weaving to OpenGL based SR applications

Constructor & Destructor Documentation

◆ GLWeaverBase()

SR::GLWeaverBase::GLWeaverBase ( )

◆ ~GLWeaverBase()

SR::GLWeaverBase::~GLWeaverBase ( )

Member Function Documentation

◆ canWeave() [1/3]

bool SR::GLWeaverBase::canWeave ( )

Used to determine if software weaving is possible on this device.

Deprecated:
Returns
bool indicating whether weaving can be done. Returns true when software weaving can be performed by GLWeaver. When false is returned, you can output side-by-side manually or let GLWeaver handle this.

◆ canWeave() [2/3]

bool SR::GLWeaverBase::canWeave ( unsigned int  width,
unsigned int  height 
)

Used to determine if software weaving is possible for certain size and visibility to the currently bound framebuffer.

Parameters
widthof the image to be rendered to the bound framebuffer
heightof the image to be rendered to the bound framebuffer
Exceptions
std::runtime_errorif the window handle (HWND) becomes invalid during the execution of canWeave
Returns
bool indicating whether weaving can be done. Returns true when software weaving can be performed by GLWeaver. When false is returned, you can output side-by-side manually or let GLWeaver handle this.

◆ canWeave() [3/3]

bool SR::GLWeaverBase::canWeave ( unsigned int  width,
unsigned int  height,
unsigned int  xOffset,
unsigned int  yOffset 
)

Used to determine if software weaving is possible for certain size and visibility to the currently bound framebuffer.

Parameters
widthof the image to be rendered to the bound framebuffer
heightof the image to be rendered to the bound framebuffer
xOffsetof the image to be rendered to the bound framebuffer
yOffsetof the image to be rendered to the bound framebuffer
Exceptions
std::runtime_errorif the window handle (HWND) becomes invalid during the execution of canWeave
Returns
bool indicating whether weaving can be done. Returns true when software weaving can be performed by GLWeaver. When false is returned, you can output side-by-side manually or let GLWeaver handle this.

◆ enableLateLatching()

void SR::GLWeaverBase::enableLateLatching ( bool  enable)

Enables late latching. Note that late latching requires applications to call weave() once per frame, and does not work with deferred contexts.

◆ getACTMode()

WeaverACTMode SR::GLWeaverBase::getACTMode ( ) const

Gets the anti-crosstalk mode.

◆ getContrast()

float SR::GLWeaverBase::getContrast ( ) const

Gets the current weaving contrast.

◆ getCrosstalkDynamicFactor()

float SR::GLWeaverBase::getCrosstalkDynamicFactor ( ) const

Gets the anti-crosstalk dynamic factor.

◆ getCrosstalkStaticFactor()

float SR::GLWeaverBase::getCrosstalkStaticFactor ( ) const

Gets the anti-crosstalk factor.

◆ getFrameBuffer()

GLuint SR::GLWeaverBase::getFrameBuffer ( )

Returns the buffer that will be used to create a weaved imaged. This buffer expects a side-by-side image.

Returns
GLuint identifying a buffer generated with glGenFramebuffers

The buffer identifier can be bound using glBindFramebuffer to start rendering to it. Rendering to the buffer is identical to normal rendering and often starts with calling glClear.

◆ isLateLatchingEnabled()

bool SR::GLWeaverBase::isLateLatchingEnabled ( ) const

Determines if late latching is enabled.

◆ setACTMode()

void SR::GLWeaverBase::setACTMode ( WeaverACTMode  mode)

Sets the anti-crosstalk mode.

◆ setContrast()

void SR::GLWeaverBase::setContrast ( float  contrast)

Sets the weaving contrast.

◆ setCrosstalkDynamicFactor()

void SR::GLWeaverBase::setCrosstalkDynamicFactor ( float  factor)

Sets the anti-crosstalk dynamic factor.

◆ setCrosstalkStaticFactor()

void SR::GLWeaverBase::setCrosstalkStaticFactor ( float  factor)

Sets the anti-crosstalk factor.

◆ setInputFrameBuffer()

void SR::GLWeaverBase::setInputFrameBuffer ( GLuint  frameBufferID,
GLuint  renderedTextureID 
)

Sets the buffer that will be used to create a weaved image.

Parameters
frameBufferIDID of the frame buffer object used to render to the weaver input
renderedTextureIDID of the texture used as a buffer for the weaver input. This texture needs to be attached as a color attachment of the frame buffer object!

◆ setShaderSRGBConversion()

void SR::GLWeaverBase::setShaderSRGBConversion ( bool  read,
bool  write 
)

Sets whether to apply shader sRGB<->Linear color space conversions to the input framebuffer during weaving.

Parameters
readConvert from sRGB to Linear color space before weaving.
writeConvert from Linear to sRGB color space after weaving.

◆ setWindowHandle()

void SR::GLWeaverBase::setWindowHandle ( HWND  handle)

Sets the window handle of the application window. If the weaver was created using a deprecated constructor, setting window handle has no effect.

Parameters
windowHandle of the application window

◆ weave() [1/2]

void SR::GLWeaverBase::weave ( unsigned int  width,
unsigned int  height 
)

Can be called to render a weaved image of a certain size to the currently bound framebuffer.

Parameters
widthof the image to be rendered to the bound framebuffer
heightof the image to be rendered to the bound framebuffer Should often be preceeded by glBindFramebuffer(GL_FRAMEBUFFER, 0) to start rendering to the default framebuffer again. The relative position of the user to the display in full-screen mode is equal to the direct output of the SR::EyeTracker class.

◆ weave() [2/2]

void SR::GLWeaverBase::weave ( unsigned int  width,
unsigned int  height,
unsigned int  xOffset,
unsigned int  yOffset 
)

Can be called to render a weaved image of a certain size to the currently bound framebuffer.

Parameters
widthof the image to be rendered to the bound framebuffer
heightof the image to be rendered to the bound framebuffer
xOffsetof the image to be rendered to the bound framebuffer
yOffsetof the image to be rendered to the bound framebuffer Should often be preceeded by glBindFramebuffer(GL_FRAMEBUFFER, 0) to start rendering to the default framebuffer again. The relative position of the user to the display in full-screen mode is equal to the direct output of the SR::EyeTracker class.

Member Data Documentation

◆ pimpl

std::unique_ptr<Impl> SR::GLWeaverBase::pimpl
protected

Suppressing warning because if we don't want to export everything then solving the underlying problem requires modification of the API Warning Description: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2' Candidate for deprecation


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