-
Notifications
You must be signed in to change notification settings - Fork 0
/
vrgoggles.h
92 lines (86 loc) · 2.3 KB
/
vrgoggles.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef VRGOGGLES_H
#define VRGOGGLES_H
#include <QString>
/**
* @brief The VrGoggles class is a storage for all virtual realty goggles parameters
*/
class VrGoggles
{
public:
VrGoggles();
/**
* @brief VrGoggles
* @param name
* @param interpupillaryDistance
* @param verticalDistanceToLensCenter
* @param lensDiameter
* @param screenToLensDistance
* @param eyeToLensDistance
* @param coefficients Distortion coefficients
*/
VrGoggles(const QString &name, float interpupillaryDistance, float verticalDistanceToLensCenter, float lensDiameter, float screenToLensDistance,
float eyeToLensDistance, float coefficients[4]);
/**
* @brief interpupillaryDistance
* @return Distance between eyes in m
*/
float interpupillaryDistance() const;
/**
* @brief verticalDistanceToLensCenter
* @return Vertical distance to lens center in m.
*/
float verticalDistanceToLensCenter() const;
/**
* @brief lensDiameter
* @return Diameter of lenses in m
*/
float lensDiameter() const;
/**
* @brief screenToLensDistance
* @return Screen to lens distance in m.
*/
float screenToLensDistance() const;
/**
* @brief eyeToLensDistance
* @return
*/
float eyeToLensDistance() const;
/**
* @brief distortInverse Apply goggles's lens inverse distortion
* @param radius
* @return Distorted radius.
*/
float distortInverse(float radius) const;
/**
* @brief distort Apply goggle's lens distotion on given radius
* @param radius
* @return Distorted radius
*/
float distort(float radius)const;
/**
* @brief distortionFactor
* @param radius
* @return Factor of distortion
*/
float distortionFactor(float radius)const;
/**
* @brief coefficients
* @return Four distortion paramares
*/
const float *coefficients() const;
/**
* @brief name
* @return Name of the goggles
*/
QString name() const;
private:
float abs(float val) const;
float m_interpupillaryDistance;
float m_verticalDistanceToLensCenter;
float m_lensDiameter;
float m_screenToLensDistance;
float m_eyeToLensDistance;
float m_coefficients[4];
QString m_name;
};
#endif // VRGOGGLES_H