Ignition Rendering

API Reference

6.3.1
BaseDistortionPass.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef IGNITION_RENDERING_BASEDISTORTIONPASS_HH_
18 #define IGNITION_RENDERING_BASEDISTORTIONPASS_HH_
19 
21 
22 namespace ignition
23 {
24  namespace rendering
25  {
26  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
27  //
28  /* \class BaseDistortionPass BaseDistortionPass.hh \
29  * ignition/rendering/base/BaseDistortionPass.hh
30  */
32  template <class T>
34  public virtual DistortionPass,
35  public virtual T
36  {
38  protected: BaseDistortionPass();
39 
41  public: virtual ~BaseDistortionPass();
42 
43  // Documentation inherited.
44  public: double K1() const;
45 
46  // Documentation inherited.
47  public: double K2() const;
48 
49  // Documentation inherited.
50  public: double K3() const;
51 
52  // Documentation inherited.
53  public: double P1() const;
54 
55  // Documentation inherited.
56  public: double P2() const;
57 
58  // Documentation inherited.
59  public: math::Vector2d Center() const;
60 
61  // Documentation inherited.
62  public: void SetK1(double _k1);
63 
64  // Documentation inherited.
65  public: void SetK2(double _k2);
66 
67  // Documentation inherited.
68  public: void SetK3(double _k3);
69 
70  // Documentation inherited.
71  public: void SetP1(double _p1);
72 
73  // Documentation inherited.
74  public: void SetP2(double _p2);
75 
76  // Documentation inherited.
77  public: void SetCenter(const math::Vector2d &_center);
78 
80  public: double k1 = 0;
81 
83  public: double k2 = 0;
84 
86  public: double k3 = 0;
87 
89  public: double p1 = 0;
90 
92  public: double p2 = 0;
93 
95  public: math::Vector2d lensCenter = {0.5, 0.5};
96  };
97 
99  // BaseDistortionPass
101  template <class T>
103  {
104  }
105 
107  template <class T>
109  {
110  }
111 
113  template <class T>
115  {
116  return this->k1;
117  }
118 
120  template <class T>
122  {
123  return this->k2;
124  }
125 
127  template <class T>
129  {
130  return this->k3;
131  }
132 
134  template <class T>
136  {
137  return this->p1;
138  }
139 
141  template <class T>
143  {
144  return this->p2;
145  }
146 
148  template <class T>
150  {
151  return this->lensCenter;
152  }
153 
155  template <class T>
157  {
158  this->k1 = _k1;
159  }
160 
162  template <class T>
164  {
165  this->k2 = _k2;
166  }
167 
169  template <class T>
171  {
172  this->k3 = _k3;
173  }
174 
176  template <class T>
178  {
179  this->p1 = _p1;
180  }
181 
183  template <class T>
185  {
186  this->p2 = _p2;
187  }
188 
190  template <class T>
192  {
193  this->lensCenter = _center;
194  }
195  }
196  }
197 }
198 #endif
BaseDistortionPass()
Constructor.
Definition: BaseDistortionPass.hh:102
Base distortion render pass.
Definition: BaseDistortionPass.hh:33
double K3() const
Get the radial distortion coefficient k3.
Definition: BaseDistortionPass.hh:128
double P1() const
Get the tangential distortion coefficient p1.
Definition: BaseDistortionPass.hh:135
void SetK2(double _k2)
Set the radial distortion coefficient k2.
Definition: BaseDistortionPass.hh:163
math::Vector2d Center() const
Get the distortion center.
Definition: BaseDistortionPass.hh:149
void SetK1(double _k1)
Set the radial distortion coefficient k1.
Definition: BaseDistortionPass.hh:156
void SetP1(double _p1)
Set the tangential distortion coefficient p1.
Definition: BaseDistortionPass.hh:177
void SetCenter(const math::Vector2d &_center)
Set the distortion center.
Definition: BaseDistortionPass.hh:191
double K1() const
Get the radial distortion coefficient k1.
Definition: BaseDistortionPass.hh:114
virtual ~BaseDistortionPass()
Destructor.
Definition: BaseDistortionPass.hh:108
double P2() const
Get the tangential distortion coefficient p2.
Definition: BaseDistortionPass.hh:142
A render pass that applies distortion to the render target.
Definition: DistortionPass.hh:37
void SetK3(double _k3)
Set the radial distortion coefficient k3.
Definition: BaseDistortionPass.hh:170
void SetP2(double _p2)
Set the tangential distortion coefficient p2.
Definition: BaseDistortionPass.hh:184
double K2() const
Get the radial distortion coefficient k2.
Definition: BaseDistortionPass.hh:121