Gazebo Rendering

API Reference

6.6.3
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 IGNITION_RENDERING_OGRE_OGREDISTORTIONPASS_HH_
18 #define IGNITION_RENDERING_OGRE_OGREDISTORTIONPASS_HH_
19 
20 #include <memory>
21 #include <vector>
22 
23 #include <ignition/common/SuppressWarning.hh>
24 #include <ignition/utils/ImplPtr.hh>
25 
30 
31 namespace ignition
32 {
33  namespace rendering
34  {
35  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
36  //
37  // Forward declaration
38  class DistortionCompositorListener;
39 
40  /* \class OgreDistortionPass OgreDistortionPass.hh \
41  * ignition/rendering/ogre/OgreDistortionPass.hh
42  */
44  class IGNITION_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 ignition::math::Vector2d Distort(
74  const ignition::math::Vector2d &_in,
75  const ignition::math::Vector2d &_center,
76  double _k1, double _k2, double _k3,
77  double _p1, double _p2,
78  unsigned int _width, double _f);
79 
84  protected: ignition::math::Vector2d
85  DistortionMapValueClamped(int _x, int _y) const;
86 
90  protected: void CalculateAndApplyDistortionScale();
91 
94  IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
95  };
96  }
97  }
98 }
99 #endif
Ogre implementation of the DistortionPass class.
Definition: gz/rendering/ogre/OgreDistortionPass.hh:44
Base distortion render pass.
Definition: gz/rendering/base/BaseDistortionPass.hh:33