ldpk
tde4_ldp_radial_fisheye_equidistant_deg_8.experimental.h
1 #pragma once
2 
3 #include <ldpk/tde4_ldp_radial_fisheye_base_deg_8.experimental.h>
4 
7 
10 template <class VEC2,class MAT2>
12  {
13 private:
14  typedef VEC2 vec2_type;
15  typedef MAT2 mat2_type;
17  using base_type::_fl_dn;
18  using base_type::_r_clip_factor;
19 protected:
20  bool remap_fe2plain(double r_ed_dn,double& r_plain_dn)
21  {
22  typedef base_type bt;
23 // Angular elongation in equidistant lenses: theta = r / f
24  double theta = r_ed_dn / _fl_dn;
25 // We can only visualize ]-90deg,+90deg[ in plain images.
26  if(theta >= M_PI / 2.0)
27  { return false; }
28 // Now remap to distance in plain filmback
29  r_plain_dn = _fl_dn * tan(theta);
30 // Optionally clip distance.
31  if(r_plain_dn > _r_clip_factor)
32  { r_plain_dn = _r_clip_factor; }
33  return true;
34  }
35  bool remap_plain2fe(double r_plain_dn,double& r_ed_dn)
36  {
37  typedef base_type bt;
38 // Angular elongation in gnomonic lenses: theta = arctan(r / f)
39  double theta = atan2(r_plain_dn,_fl_dn);
40 // Now remap to distance in equidistant lens
41  r_ed_dn = _fl_dn * theta;
42  return true;
43  }
44  bool getModelName(char *name)
45  {
46 #ifdef LDPK_COMPILE_AS_PLUGIN_SDV
47  strcpy(name,"3DE4 Radial - Fisheye, Equidistant, Degree 8 [Plugin]");
48 #else
49  strcpy(name,"3DE4 Radial - Fisheye, Equidistant, Degree 8");
50 #endif
51  return true;
52  }
53  };
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_equidistant_deg_8.experimental.h:11
bool getModelName(char *name)
returns a name for the model as to show up in the GUI (maximum length of "name": 100 bytes)...
Definition: tde4_ldp_radial_fisheye_equidistant_deg_8.experimental.h:44
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_base_deg_8.experimental.h:14
This class handles the built-in parameter and the lookup table. You may find it useful for your own d...
Definition: ldpk_ldp_builtin.h:31