1 #ifndef ldpk_cylindric_extender_sdv 2 #define ldpk_cylindric_extender_sdv 4 #include <ldpk/ldpk_extender_base.h> 8 template <
class VEC2,
class MAT2>
12 typedef VEC2 vec2_type;
13 typedef MAT2 mat2_type;
20 mat2_type para =
tensq(vec2_type(cos(_phi * M_PI / 180.0),sin(_phi * M_PI / 180.0)));
21 _m = _b * para + mat2_type(1.0);
30 _inv_m = mat2_type(1.0);
34 { _phi = phi;calc_m(); }
35 double get_phi()
const 43 vec2_type
eval(
const vec2_type& p)
const 47 {
return _inv_m * q; }
49 vec2_type
eval_inv(
const vec2_type& q,
const vec2_type& p_start)
const 50 {
return _inv_m * q; }
64 template <
class VEC2,
class MAT2>
68 typedef VEC2 vec2_type;
69 typedef MAT2 mat2_type;
76 double q = sqrt(1.0 + _b),c = cos(_phi * M_PI / 180.0),s = sin(_phi * M_PI / 180.0);
77 _m = mat2_type(c*c*q + s*s/q,(q - 1.0/q)*c*s,(q - 1.0/q)*c*s,c*c/q + s*s*q);
86 _inv_m = mat2_type(1.0);
90 { _phi = phi;calc_m(); }
91 double get_phi()
const 99 vec2_type
eval(
const vec2_type& p)
const 102 virtual vec2_type
eval_inv(
const vec2_type& q)
const 103 {
return _inv_m * q; }
105 vec2_type
eval_inv(
const vec2_type& q,
const vec2_type& p_start)
const 106 {
return _inv_m * q; }
mat2d tensq(const vec2d &a)
Tensor (dyadic) product square.
Definition: ldpk_vec2d.h:186
Base class of all extenders The concept of extenders as turned out to be useful in the new-style dist...
Definition: ldpk_extender_base.h:16
virtual vec2_type eval_inv(const vec2_type &q) const
eval_inv() is applying lens distortion (distort)
Definition: ldpk_cylindric_extender.h:102
const mat2_type & get_mat_inv() const
The inverse matrix for this extender.
Definition: ldpk_cylindric_extender.h:111
Definition: ldpk_cylindric_extender.h:9
vec2_type eval_inv(const vec2_type &q) const
eval_inv() is applying lens distortion (distort)
Definition: ldpk_cylindric_extender.h:46
const mat2_type & get_mat() const
The matrix for this extender.
Definition: ldpk_cylindric_extender.h:52
The namespace of (most of the) things related to the Lens Distortion Plugin Kit.
Definition: ldpk.h:180
vec2_type eval_inv(const vec2_type &q, const vec2_type &p_start) const
Generally (but not here), an initial value is needed for calculating the inverse. ...
Definition: ldpk_cylindric_extender.h:49
void set_b(double b)
This parameter expresses the strength of the cylindric deformation ("bending").
Definition: ldpk_cylindric_extender.h:94
void set_b(double b)
This parameter expresses the strength of the cylindric deformation ("bending").
Definition: ldpk_cylindric_extender.h:38
void set_phi(double phi)
The cylindric extender has a parameter called phi.
Definition: ldpk_cylindric_extender.h:33
vec2_type eval_inv(const vec2_type &q, const vec2_type &p_start) const
Generally (but not here), an initial value is needed for calculating the inverse. ...
Definition: ldpk_cylindric_extender.h:105
"Symmetric" version. Scaling by sqrt(1+b) in para-direction and 1/sqrt(1+b) in ortho-direction. The important thing is, that we have turned an almost-symmetry into a perfect symmetry: phi -> phi + 90deg, b -> 1/b. The drawback is, that this models the curved beam splitter only if focal length is corrected slightly, by a factor sqrt(1+b). Nevertheless we are using this model in "3DE4 Radial - Standard, Degree 4".
Definition: ldpk_cylindric_extender.h:65
const mat2_type & get_mat() const
The matrix for this extender.
Definition: ldpk_cylindric_extender.h:108
vec2_type eval(const vec2_type &p) const
eval() is per definition removal of lens distortion (undistort).
Definition: ldpk_cylindric_extender.h:99
void set_phi(double phi)
The cylindric extender has a parameter called phi.
Definition: ldpk_cylindric_extender.h:89
vec2_type eval(const vec2_type &p) const
eval() is per definition removal of lens distortion (undistort).
Definition: ldpk_cylindric_extender.h:43
const mat2_type & get_mat_inv() const
The inverse matrix for this extender.
Definition: ldpk_cylindric_extender.h:55