ldpk
tde4_ldp_radial_fisheye_orthographic_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 orthographic lenses
24  double arg = r_ed_dn / _fl_dn;
25 // Orthographic has a maximum elongation of 90 degree.
26 // Negative cases are sorted out befor this method is invoked,
27 // but we leave it here for completeness.
28  if((arg >= 1) || (arg <= -1))
29  { return false; }
30  double theta = ::asin(arg);
31 // We can only visualize ]-90deg,+90deg[ in plain images.
32  if(theta >= M_PI / 2.0)
33  { return false; }
34 // Now remap to distance in plain filmback
35  r_plain_dn = _fl_dn * tan(theta);
36 // Optionally clip distance.
37  if(r_plain_dn > _r_clip_factor)
38  { r_plain_dn = _r_clip_factor; }
39  return true;
40  }
41  bool remap_plain2fe(double r_plain_dn,double& r_ed_dn)
42  {
43  typedef base_type bt;
44 // Angular elongation in gnomonic lenses: theta = arctan(r / f)
45  double theta = atan2(r_plain_dn,_fl_dn);
46 // Now remap to distance in orthographic lens
47  r_ed_dn = _fl_dn * ::sin(theta);
48  return true;
49  }
50  bool getModelName(char *name)
51  {
52 #ifdef LDPK_COMPILE_AS_PLUGIN_SDV
53  strcpy(name,"3DE4 Radial - Fisheye, Orthographic, Degree 8 [Plugin]");
54 #else
55  strcpy(name,"3DE4 Radial - Fisheye, Orthographic, Degree 8");
56 #endif
57  return true;
58  }
59  };
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_base_deg_8.experimental.h:14
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_orthographic_deg_8.experimental.h:50
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
Plugin class for radial distortion. Does not compensate for decentering.
Definition: tde4_ldp_radial_fisheye_orthographic_deg_8.experimental.h:11