Gazebo Rendering

API Reference

7.4.2
gz/rendering/ogre/OgreDistortionPass.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 GZ_RENDERING_OGRE_OGREDISTORTIONPASS_HH_
18 #define GZ_RENDERING_OGRE_OGREDISTORTIONPASS_HH_
19 
20 #include <memory>
21 #include <vector>
22 
23 #include <gz/utils/ImplPtr.hh>
24 #include <gz/utils/SuppressWarning.hh>
25 
29 #include "gz/rendering/ogre/Export.hh"
30 
31 namespace gz
32 {
33  namespace rendering
34  {
35  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
36  //
37  // Forward declaration
38  class DistortionCompositorListener;
39 
40  /* \class OgreDistortionPass OgreDistortionPass.hh \
41  * gz/rendering/ogre/OgreDistortionPass.hh
42  */
44  class GZ_RENDERING_OGRE_VISIBLE OgreDistortionPass :
45  public BaseDistortionPass<OgreRenderPass>
46  {
48  public: OgreDistortionPass();
49 
51  public: virtual ~OgreDistortionPass();
52 
53  // Documentation inherited
54  public: void PreRender() override;
55 
56  // Documentation inherited
57  public: void Destroy() override;
58 
59  // Documentation inherited
60  public: void CreateRenderPass() override;
61 
73  public: static gz::math::Vector2d Distort(
74  const gz::math::Vector2d &_in,
75  const gz::math::Vector2d &_center,
76  double _k1, double _k2, double _k3,
77  double _p1, double _p2,
78  unsigned int _width, double _f);
79 
84  protected: gz::math::Vector2d
85  DistortionMapValueClamped(int _x, int _y) const;
86 
90  protected: void CalculateAndApplyDistortionScale();
91 
94  GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr)
95  };
96  }
97  }
98 }
99 #endif