Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
Weaver.h
Go to the documentation of this file.
1
10#pragma once
11#include "WeaverTypes.h"
12#include <string>
13#include <vector>
14
15#ifdef WIN32
16# ifdef COMPILING_DLL_DimencoWeaving
17# define DIMENCOSR_API __declspec(dllexport)
18# else
19# define DIMENCOSR_API __declspec(dllimport)
20# endif
21#else
22# define DIMENCOSR_API
23#endif
24
29template <class T>
31
32 static_assert(std::is_member_function_pointer<decltype(static_cast<bool (T::*)(unsigned int, unsigned int)>(&T::canWeave))>::value,
33 "This weaver class does not implement the canWeave(unsigned int, unsigned int) function of the weaver interface");
34 static_assert(std::is_member_function_pointer<decltype(static_cast<bool (T::*)(unsigned int, unsigned int, unsigned int, unsigned int)>(&T::canWeave))>::value,
35 "This weaver class does not implement the canWeave(unsigned int, unsigned int, unsigned int, unsigned int) function of the weaver interface");
36 static_assert(std::is_member_function_pointer<decltype(static_cast<void (T::*)(unsigned int, unsigned int)>(&T::weave))>::value,
37 "This weaver class does not implement the weave(unsigned int, unsigned int) function of the weaver interface");
38 static_assert(std::is_member_function_pointer<decltype(static_cast<void (T::*)(unsigned int, unsigned int, unsigned int, unsigned int)>(&T::weave))>::value,
39 "This weaver class does not implement the weave(unsigned int, unsigned int, unsigned int, unsigned int) function of the weaver interface");
40}
41
42namespace Dimenco {
43
45
46public:
51 static void SetGlobalParameters(FLOAT3 userPos);
52
58 static void SetGlobalParameters(const char* configPath, FLOAT3 userPos);
59
63 static void ReconfigureWeaver();
64
68 static void SetDeviceSerialNumbers(const std::vector<std::string> &deviceSerialNumbers);
69
73 static void SetInstallPath(const std::string &installPath);
74
84 static void FillAttributes(const FLOAT2& TextureRes, const FLOAT4& Position, FLOAT4& phases, FLOAT4& dxy, FLOAT2& ScreenPos, FLOAT2& WeaverVars);
85
96 static WeaverErrorCode LoadTexture(WeaverTextureType type, unsigned char** out_pTexture, int* out_width, int* out_height, int* out_channels, int* out_bitsPerPixel);
97
102 static void UnLoadCorrectionTexture(unsigned char** in_pTexture);
103
104 static float GetPattern();
105 static float GetXTalkFactor();
106 static float GetFilterWidth();
107 static float GetFilterSlope();
108
112 static float GetSlant();
113
117 static float GetPx();
118
122 static float GetN();
123
127 static float GetDoN();
128
129private:
130 static void _SetGlobalParameters(FLOAT3 userPos);
131};
132
133}
134
135#undef DIMENCOSR_API
enum DIMENCOSR_API WeaverTextureType
Definition: WeaverTypes.h:22
enum DIMENCOSR_API WeaverErrorCode
Definition: WeaverTypes.h:27
#define DIMENCOSR_API
Definition: Weaver.h:22
void isWeaverClass()
Checks at compile time whether a class implements the all common weaver interface functions.
Definition: Weaver.h:30
Definition: Weaver.h:44
static void ReconfigureWeaver()
Reconfigures global weaver parameters.
static float GetFilterSlope()
static void SetGlobalParameters(const char *configPath, FLOAT3 userPos)
Set global shader parameters needed for weaving, using a different .ini file.
static void UnLoadCorrectionTexture(unsigned char **in_pTexture)
Unloads a texture.
static float GetPattern()
static void SetDeviceSerialNumbers(const std::vector< std::string > &deviceSerialNumbers)
Sets the device serial numbers of attached devices to be used when loading calibration data.
static void SetGlobalParameters(FLOAT3 userPos)
Set global shader parameters needed for weaving.
static WeaverErrorCode LoadTexture(WeaverTextureType type, unsigned char **out_pTexture, int *out_width, int *out_height, int *out_channels, int *out_bitsPerPixel)
Load a weaver texture.
static void SetInstallPath(const std::string &installPath)
Sets the install path for Simulated Reality to be used when configuring the weaver.
static float GetDoN()
Returns D over N in millimeters.
static float GetPx()
Returns pitch in x direction in pixels.
static float GetXTalkFactor()
static float GetN()
Returns the refractive index N.
static float GetSlant()
Returns slant as a coëfficiënt.
static float GetFilterWidth()
static void FillAttributes(const FLOAT2 &TextureRes, const FLOAT4 &Position, FLOAT4 &phases, FLOAT4 &dxy, FLOAT2 &ScreenPos, FLOAT2 &WeaverVars)
Fill the vertex attributes needed for weaving.
Definition: Weaver.h:42
Definition: WeaverTypes.h:34
Definition: WeaverTypes.h:45
Definition: WeaverTypes.h:53