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

#include <glweaver.h>

Inheritance diagram for SR::PredictingGLWeaver:
[legend]
Collaboration diagram for SR::PredictingGLWeaver:
[legend]

Public Member Functions

 PredictingGLWeaver (SR::SRContext &context, unsigned int width, unsigned int height)
 Constructs a class to be used for weaving an input image of a certain size. More...
 
 PredictingGLWeaver (SR::SRContext &context, unsigned int width, unsigned int height, HWND window)
 Constructs a class to be used for weaving an input image of a certain size. More...
 
 PredictingGLWeaver (SR::SRContext &context, unsigned int width, unsigned int height, GLenum bufferFormat, HWND window)
 Constructs a class to be used for weaving an input image of a certain size. More...
 
 ~PredictingGLWeaver ()
 Handles proper destruction of all weaver related classes and buffers. More...
 
void setLatency (uint64_t latency)
 Set the latency to match the expected duration of the full rendering pipeline. More...
 
uint64_t getLatency ()
 Get the latency that is used by the weaver. If setLatency has been called, the value set by that function will be returned. If setLatencyInFrames has been called, the latency will be calculated based on the refresh rate of the monitor and the application. By default setLatencyInFrames is used when no latency is explicitly set. More...
 
void setLatencyInFrames (uint64_t latencyInFrames)
 Set the latency to match the expected duration of the full rendering pipeline in number of frames. The latency in time is calculated using these number of frames based on the refresh rate of the monitor that the application is running on, this will be dynamically updated when the window changes monitor. For this it requires the weaver to be given a valid window handle of the running application. More...
 
- Public Member Functions inherited from SR::GLWeaverBase
 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...
 

Additional Inherited Members

- Protected Attributes inherited from SR::GLWeaverBase
std::unique_ptr< Impl > pimpl
 

Constructor & Destructor Documentation

◆ PredictingGLWeaver() [1/3]

SR::PredictingGLWeaver::PredictingGLWeaver ( SR::SRContext context,
unsigned int  width,
unsigned int  height 
)

Constructs a class to be used for weaving an input image of a certain size.

Deprecated:
Parameters
contextto connect to, needs to be valid for the lifetime of the weaver object.
widthof the side-by-side image to be weaved together
heightof the side-by-side image to be weaved together
Exceptions
std::exceptionif FrameBuffer did not initialize successfully can be caused by using Opengl in parallel on another thread

◆ PredictingGLWeaver() [2/3]

SR::PredictingGLWeaver::PredictingGLWeaver ( SR::SRContext context,
unsigned int  width,
unsigned int  height,
HWND  window 
)

Constructs a class to be used for weaving an input image of a certain size.

Parameters
contextto connect to, needs to be valid for the lifetime of the weaver object.
widthof the side-by-side image to be weaved together
heightof the side-by-side image to be weaved together
Exceptions
std::exceptionif FrameBuffer did not initialize successfully can be caused by using Opengl in parallel on another thread
Parameters
windowHandle of the application window

◆ PredictingGLWeaver() [3/3]

SR::PredictingGLWeaver::PredictingGLWeaver ( SR::SRContext context,
unsigned int  width,
unsigned int  height,
GLenum  bufferFormat,
HWND  window 
)

Constructs a class to be used for weaving an input image of a certain size.

Parameters
contextto connect to, needs to be valid for the lifetime of the weaver object.
widthof the side-by-side image to be weaved together
heightof the side-by-side image to be weaved together
bufferFormatFormat of the framebuffer
windowHandle of the application window
Exceptions
std::exceptionif FrameBuffer did not initialize successfully can be caused by using Opengl in parallel on another thread

◆ ~PredictingGLWeaver()

SR::PredictingGLWeaver::~PredictingGLWeaver ( )

Handles proper destruction of all weaver related classes and buffers.

Member Function Documentation

◆ getLatency()

uint64_t SR::PredictingGLWeaver::getLatency ( )

Get the latency that is used by the weaver. If setLatency has been called, the value set by that function will be returned. If setLatencyInFrames has been called, the latency will be calculated based on the refresh rate of the monitor and the application. By default setLatencyInFrames is used when no latency is explicitly set.

Returns
The latency in microseconds

◆ setLatency()

void SR::PredictingGLWeaver::setLatency ( uint64_t  latency)

Set the latency to match the expected duration of the full rendering pipeline.

The eye positions should be predicted to the timepoint at which the frame is visible to the user Internally the prediction is already taking care of all other latency, only the rendering pipeline latency is application dependent A low latency app would have 1 framebuffer latency, so 16666 microseconds (the generated frame will be presented at next v-sync) When using v-sync, the driver adds at least 1 buffer latency, and maybe the windows display manager also adds a buffer latency. Typically, the latency is n * 1000*1000/framerate microseconds

Parameters
latencyThe latency from the moment when weave() is called until presenting the current frame to the user, in microseconds

◆ setLatencyInFrames()

void SR::PredictingGLWeaver::setLatencyInFrames ( uint64_t  latencyInFrames)

Set the latency to match the expected duration of the full rendering pipeline in number of frames. The latency in time is calculated using these number of frames based on the refresh rate of the monitor that the application is running on, this will be dynamically updated when the window changes monitor. For this it requires the weaver to be given a valid window handle of the running application.

The eye positions should be predicted to the timepoint at which the frame is visible to the user Internally the prediction is already taking care of all other latency, only the rendering pipeline latency is application dependent A low latency app would have 1 framebuffer latency, the generated frame will be presented at next v-sync) When using v-sync, the driver adds at least 1 buffer latency, and maybe the windows display manager also adds a buffer latency.

Parameters
latencyInFramesThe expected number of frames before presenting the current generated frame to the user.

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