Gazebo Rendering

API Reference

6.6.4
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 
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 
91 
94  IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr)
95  };
96  }
97  }
98 }
99 #endif
Base distortion render pass.
Definition: gz/rendering/base/BaseDistortionPass.hh:36
Ogre implementation of the DistortionPass class.
Definition: gz/rendering/ogre/OgreDistortionPass.hh:46
void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
ignition::math::Vector2d DistortionMapValueClamped(int _x, int _y) const
get the distortion map value.
void CalculateAndApplyDistortionScale()
calculate the correct scale factor to "zoom" the render, cutting off black borders caused by distorti...
void Destroy() override
Destroy any resources associated with this object. Invoking any other functions after destroying an o...
void CreateRenderPass() override
Create the render pass using ogre compositor.
virtual ~OgreDistortionPass()
Destructor.
static ignition::math::Vector2d Distort(const ignition::math::Vector2d &_in, const ignition::math::Vector2d &_center, double _k1, double _k2, double _k3, double _p1, double _p2, unsigned int _width, double _f)
Apply distortion model using camera coordinates projection.