3 #include <ldpk/ldpk_extender_base.h>
8 template <
class VEC2,
class MAT2>
12 typedef VEC2 vec2_type;
13 typedef MAT2 mat2_type;
21 _inv_m = mat2_type(1.0);
24 void set(
const mat2_type& m)
30 template <
class E0,
class E1>
31 void set(
const E0& e0,
const E1& e1)
33 _m = e0.get_mat() * e1.get_mat();
37 template <
class E0,
class E1,
class E2>
38 void set(
const E0& e0,
const E1& e1,
const E2& e2)
40 _m = e0.get_mat() * e1.get_mat() * e2.get_mat();
44 template <
class E0,
class E1,
class E2,
class E3>
45 void set(
const E0& e0,
const E1& e1,
const E2& e2,
const E3& e3)
47 _m = e0.get_mat() * e1.get_mat() * e2.get_mat() * e3.get_mat();
51 vec2_type
eval(
const vec2_type& p)
const
55 {
return _inv_m * q; }
57 vec2_type
eval_inv(
const vec2_type& q,
const vec2_type& p_start)
const
58 {
return _inv_m * q; }
void set(const E0 &e0, const E1 &e1, const E2 &e2)
Building the matrix from three extenders. Order is m(E0) * m(E1) * m(E2).
Definition: ldpk_linear_extender.h:38
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_linear_extender.h:51
const mat2_type & get_mat_inv() const
The inverse matrix for this extender.
Definition: ldpk_linear_extender.h:63
void set(const mat2_type &m)
Passing the matrix.
Definition: ldpk_linear_extender.h:24
void set(const E0 &e0, const E1 &e1, const E2 &e2, const E3 &e3)
Building the matrix from four extenders. Order is m(E0) * m(E1) * m(E2) * m(E3).
Definition: ldpk_linear_extender.h:45
const mat2_type & get_mat() const
The matrix for this extender.
Definition: ldpk_linear_extender.h:60
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_linear_extender.h:57
void set(const E0 &e0, const E1 &e1)
Building the matrix from two extenders. Order is m(E0) * m(E1).
Definition: ldpk_linear_extender.h:31
vec2_type eval_inv(const vec2_type &q) const
eval_inv() is applying lens distortion (distort)
Definition: ldpk_linear_extender.h:54
A general linear extender, based on a 2x2-matrix.
Definition: ldpk_linear_extender.h:9
linear_extender()
Default: unit matrix.
Definition: ldpk_linear_extender.h:18