LeiaSR SDK 720218b2 v1.32.7.6322 2025-02-13T14:55:38Z
Stable
dx10weaver.h
Go to the documentation of this file.
1
5#pragma once
6#include <memory>
7#include <d3d10_1.h>
9#include "sr/weaver/Weaver.h"
10
11#ifdef WIN32
12# ifdef COMPILING_DLL_SimulatedRealityDirectX
13# define DIMENCOSR_API __declspec(dllexport)
14# else
15# define DIMENCOSR_API __declspec(dllimport)
16# endif
17#else
18# define DIMENCOSR_API
19#endif
20
26namespace SR
27{
29 protected:
30 class Impl;
36#pragma warning(suppress: 4251)
37 std::unique_ptr<Impl> pimpl;
38
39 public:
42
51 ID3D10RenderTargetView* getFrameBuffer();
52
57 void setInputFrameBuffer(ID3D10ShaderResourceView* frameBuffer);
58
63 void setWindowHandle(HWND handle);
64
68 void setContrast(float contrast);
69
73 float getContrast() const;
74
80 void setShaderSRGBConversion(bool read, bool write);
81
86
91
95 void setCrosstalkStaticFactor(float factor);
96
101
105 void setCrosstalkDynamicFactor(float factor);
106
111
119 bool canWeave(unsigned int width, unsigned int height);
120
130 bool canWeave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
131
138 void weave(unsigned int width, unsigned int height);
139
148 void weave(unsigned int width, unsigned int height, unsigned int xOffset, unsigned int yOffset);
149 };
150
152 public:
161 [[deprecated("For best performance use the PredictingDX10Weaver interface")]]
162 DX10Weaver(SR::SRContext& context, ID3D10Device* device, unsigned int width, unsigned int height, HWND window);
163
173 DX10Weaver(SR::SRContext& context, ID3D10Device* device, unsigned int width, unsigned int height, DXGI_FORMAT bufferFormat, HWND window);
174
179 };
180
182 public:
191 PredictingDX10Weaver(SR::SRContext& context, ID3D10Device* device, unsigned int width, unsigned int height, HWND window);
192
202 PredictingDX10Weaver(SR::SRContext& context, ID3D10Device* device, unsigned int width, unsigned int height, DXGI_FORMAT bufferFormat, HWND window);
203
208
220 void setLatency(uint64_t latency);
221
230 uint64_t getLatency();
231
244 void setLatencyInFrames(uint64_t latencyInFrames);
245 };
246}
247
248#undef DIMENCOSR_API
enum DIMENCOSR_API WeaverACTMode
Definition: WeaverTypes.h:29
Definition: dx10weaver.h:28
float getCrosstalkStaticFactor() const
Gets the anti-crosstalk factor.
void setCrosstalkStaticFactor(float factor)
Sets the anti-crosstalk factor.
float getCrosstalkDynamicFactor() const
Gets the anti-crosstalk dynamic factor.
ID3D10RenderTargetView * getFrameBuffer()
Returns the buffer that will be used to create a weaved image. This buffer expects a side-by-side ima...
void setInputFrameBuffer(ID3D10ShaderResourceView *frameBuffer)
Sets the buffer that will be used to create a weaved image. This will release the internally created ...
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 A framebu...
WeaverACTMode getACTMode() const
Gets the anti-crosstalk mode.
void setShaderSRGBConversion(bool read, bool write)
Sets whether to apply shader sRGB<->Linear color space conversions to the input framebuffer during we...
void setCrosstalkDynamicFactor(float factor)
Sets the anti-crosstalk dynamic factor.
void setContrast(float contrast)
Sets the weaving contrast.
std::unique_ptr< Impl > pimpl
Definition: dx10weaver.h:30
void setWindowHandle(HWND handle)
Sets the window handle of the application window.
float getContrast() const
Gets the current weaving contrast.
void setACTMode(WeaverACTMode mode)
Sets the anti-crosstalk mode.
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 bo...
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 A framebu...
bool canWeave(unsigned int width, unsigned int height)
Used to determine if software weaving is possible for certain size and visibility to the currently bo...
Definition: dx10weaver.h:151
~DX10Weaver()
Handles proper destruction of all weaver related classes and buffers.
DX10Weaver(SR::SRContext &context, ID3D10Device *device, unsigned int width, unsigned int height, DXGI_FORMAT bufferFormat, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
DX10Weaver(SR::SRContext &context, ID3D10Device *device, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
Definition: dx10weaver.h:181
void setLatencyInFrames(uint64_t latencyInFrames)
Set the latency to match the expected duration of the full rendering pipeline in number of frames....
PredictingDX10Weaver(SR::SRContext &context, ID3D10Device *device, unsigned int width, unsigned int height, DXGI_FORMAT bufferFormat, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
void setLatency(uint64_t latency)
Set the latency to match the expected duration of the full rendering pipeline.
~PredictingDX10Weaver()
Handles proper destruction of all weaver related classes and buffers.
uint64_t getLatency()
Get the latency that is used by the weaver. If setLatency has been called, the value set by that func...
PredictingDX10Weaver(SR::SRContext &context, ID3D10Device *device, unsigned int width, unsigned int height, HWND window)
Constructs a class to be used for weaving an input image of a certain size.
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:75
#define DIMENCOSR_API
Definition: dx10weaver.h:18
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:20