ldpk
tde4_ldp_radial_fisheye_stereographic_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 stereographic lenses
24  double arg = r_ed_dn / (2.0 * _fl_dn);
25 // stereographic has a maximum elongation of 180 degree.
26  double theta = 2.0 * ::atan(arg);
27 // We can only visualize ]-90deg,+90deg[ in plain images.
28  if(theta >= M_PI / 2.0)
29  { return false; }
30 // Now remap to distance in plain filmback
31  r_plain_dn = _fl_dn * tan(theta);
32 // Optionally clip distance.
33  if(r_plain_dn > _r_clip_factor)
34  { r_plain_dn = _r_clip_factor; }
35  return true;
36  }
37  bool remap_plain2fe(double r_plain_dn,double& r_ed_dn)
38  {
39  typedef base_type bt;
40 // Angular elongation in gnomonic lenses: theta = arctan(r / f)
41  double theta = atan2(r_plain_dn,_fl_dn);
42 // Now remap to distance in stereographic lens
43  r_ed_dn = 2.0 * _fl_dn * ::tan(theta * (1.0/2.0));
44  return true;
45  }
46  bool getModelName(char *name)
47  {
48 #ifdef LDPK_COMPILE_AS_PLUGIN_SDV
49  strcpy(name,"3DE4 Radial - Fisheye, Stereographic, Degree 8 [Plugin]");
50 #else
51  strcpy(name,"3DE4 Radial - Fisheye, Stereographic, Degree 8");
52 #endif
53  return true;
54  }
55  };
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_base_deg_8.experimental.h:14
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_stereographic_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_stereographic_deg_8.experimental.h:46