1 #ifndef ldpk_rotation_extender_sdv 2 #define ldpk_rotation_extender_sdv 4 #include <ldpk/ldpk_extender_base.h> 11 template <
class VEC2,
class MAT2>
15 typedef VEC2 vec2_type;
16 typedef MAT2 mat2_type;
19 mat2_type _m_rot,_inv_m_rot;
25 _m_rot = mat2_type(1.0);
26 _inv_m_rot = mat2_type(1.0);
32 _m_rot = mat2_type(cos(_phi),-sin(_phi),sin(_phi),cos(_phi));
33 _inv_m_rot = trans(_m_rot);
40 vec2_type
eval(
const vec2_type& p)
const 41 {
return _m_rot * p; }
44 {
return _inv_m_rot * q; }
46 vec2_type
eval_inv(
const vec2_type& q,
const vec2_type& p_start)
const 47 {
return _inv_m_rot * q; }
53 {
return _inv_m_rot; }
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
vec2_type eval(const vec2_type &p) const
eval() is per definition removal of lens distortion (undistort).
Definition: ldpk_rotation_extender.h:40
The namespace of (most of the) things related to the Lens Distortion Plugin Kit.
Definition: ldpk.h:180
The rotation extender simply rotates the incident ray around the optical axis. We need this e...
Definition: ldpk_rotation_extender.h:12
double get_phi() const
Getter.
Definition: ldpk_rotation_extender.h:36
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_rotation_extender.h:46
const mat2_type & get_mat() const
The matrix for this extender.
Definition: ldpk_rotation_extender.h:49
const mat2_type & get_mat_inv() const
The inverse matrix for this extender.
Definition: ldpk_rotation_extender.h:52
vec2_type eval_inv(const vec2_type &q) const
eval_inv() is applying lens distortion (distort)
Definition: ldpk_rotation_extender.h:43
void set_phi(double phi)
The rotation extender has one parameter called phi (in radians).
Definition: ldpk_rotation_extender.h:29