Gazebo Rendering

API Reference

7.4.2

Ogre implementation of the DistortionPass class. More...

#include <OgreDistortionPass.hh>

Public Member Functions

 OgreDistortionPass ()
 Constructor. More...
 
virtual ~OgreDistortionPass ()
 Destructor. More...
 
void CreateRenderPass () override
 Create the render pass using ogre compositor. More...
 
void Destroy () override
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. More...
 
void PreRender () override
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender. More...
 
- Public Member Functions inherited from BaseDistortionPass< OgreRenderPass >
virtual ~BaseDistortionPass ()
 Destructor. More...
 
math::Vector2d Center () const
 Get the distortion center. More...
 
double K1 () const
 Get the radial distortion coefficient k1. More...
 
double K2 () const
 Get the radial distortion coefficient k2. More...
 
double K3 () const
 Get the radial distortion coefficient k3. More...
 
double P1 () const
 Get the tangential distortion coefficient p1. More...
 
double P2 () const
 Get the tangential distortion coefficient p2. More...
 
void SetCenter (const math::Vector2d &_center)
 Set the distortion center. More...
 
void SetK1 (double _k1)
 Set the radial distortion coefficient k1. More...
 
void SetK2 (double _k2)
 Set the radial distortion coefficient k2. More...
 
void SetK3 (double _k3)
 Set the radial distortion coefficient k3. More...
 
void SetP1 (double _p1)
 Set the tangential distortion coefficient p1. More...
 
void SetP2 (double _p2)
 Set the tangential distortion coefficient p2. More...
 
- Public Member Functions inherited from DistortionPass
 DistortionPass ()
 Constructor. More...
 
virtual ~DistortionPass ()
 Destructor. More...
 
virtual math::Vector2d Center () const =0
 Get the distortion center. More...
 
virtual double K1 () const =0
 Get the radial distortion coefficient k1. More...
 
virtual double K2 () const =0
 Get the radial distortion coefficient k2. More...
 
virtual double K3 () const =0
 Get the radial distortion coefficient k3. More...
 
virtual double P1 () const =0
 Get the tangential distortion coefficient p1. More...
 
virtual double P2 () const =0
 Get the tangential distortion coefficient p2. More...
 
- Public Member Functions inherited from RenderPass
virtual ~RenderPass ()
 Destructor. More...
 
virtual bool IsEnabled () const =0
 Get whether or not the render pass is enabled. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 
- Public Member Functions inherited from OgreRenderPass
virtual ~OgreRenderPass ()
 Destructor. More...
 
void Destroy () override
 
virtual void SetCamera (Ogre::Camera *_camera)
 Set the ogre camera that the render pass applies to. More...
 
- Public Member Functions inherited from BaseRenderPass< OgreObject >
virtual ~BaseRenderPass ()
 Destructor. More...
 
virtual bool IsEnabled () const override
 Get whether or not the render pass is enabled. More...
 
virtual void SetEnabled (bool _enabled) override
 Set to enable or disable the render pass. More...
 
- Public Member Functions inherited from OgreObject
virtual ~OgreObject ()
 
virtual ScenePtr Scene () const
 
- Public Member Functions inherited from BaseObject
virtual ~BaseObject ()
 
virtual unsigned int Id () const override
 
virtual std::string Name () const override
 
virtual void PostRender () override
 

Static Public Member Functions

static gz::math::Vector2d Distort (const gz::math::Vector2d &_in, const gz::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. More...
 

Protected Member Functions

void CalculateAndApplyDistortionScale ()
 calculate the correct scale factor to "zoom" the render, cutting off black borders caused by distortion (only if the crop flag has been set). More...
 
gz::math::Vector2d DistortionMapValueClamped (int _x, int _y) const
 get the distortion map value. More...
 
- Protected Member Functions inherited from BaseDistortionPass< OgreRenderPass >
 BaseDistortionPass ()
 Constructor. More...
 
- Protected Member Functions inherited from OgreRenderPass
 OgreRenderPass ()
 Constructor. More...
 
- Protected Member Functions inherited from BaseRenderPass< OgreObject >
 BaseRenderPass ()
 Constructor. More...
 
- Protected Member Functions inherited from OgreObject
 OgreObject ()
 
- Protected Member Functions inherited from BaseObject
 BaseObject ()
 
virtual void Init ()
 
virtual void Load ()
 

Additional Inherited Members

- Public Attributes inherited from BaseDistortionPass< OgreRenderPass >
double k1
 Radial distortion coefficient k1. More...
 
double k2
 Radial distortion coefficient k2. More...
 
double k3
 Radial distortion coefficient k3. More...
 
math::Vector2d lensCenter
 Lens center used for distortion. More...
 
double p1
 Tangential distortion coefficient p1. More...
 
double p2
 Tangential distortion coefficient p2. More...
 
- Protected Attributes inherited from OgreRenderPass
Ogre::Camera * ogreCamera = nullptr
 Pointer to the ogre camera. More...
 
- Protected Attributes inherited from BaseRenderPass< OgreObject >
bool enabled
 Flag to indicate if render pass is enabled or not. More...
 
- Protected Attributes inherited from OgreObject
OgreScenePtr scene
 
- Protected Attributes inherited from BaseObject
unsigned int id
 
std::string name
 

Detailed Description

Ogre implementation of the DistortionPass class.

Constructor & Destructor Documentation

◆ OgreDistortionPass()

Constructor.

◆ ~OgreDistortionPass()

virtual ~OgreDistortionPass ( )
virtual

Destructor.

Member Function Documentation

◆ CalculateAndApplyDistortionScale()

void CalculateAndApplyDistortionScale ( )
protected

calculate the correct scale factor to "zoom" the render, cutting off black borders caused by distortion (only if the crop flag has been set).

◆ CreateRenderPass()

void CreateRenderPass ( )
overridevirtual

Create the render pass using ogre compositor.

Reimplemented from OgreRenderPass.

◆ Destroy()

void Destroy ( )
overridevirtual

Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior.

Implements Object.

◆ Distort()

static gz::math::Vector2d Distort ( const gz::math::Vector2d _in,
const gz::math::Vector2d _center,
double  _k1,
double  _k2,
double  _k3,
double  _p1,
double  _p2,
unsigned int  _width,
double  _f 
)
static

Apply distortion model using camera coordinates projection.

Parameters
[in]_inInput uv coordinate.
[in]_centerNormalized distortion center.
[in]_k1Radial distortion coefficient k1.
[in]_k2Radial distortion coefficient k2.
[in]_k3Radial distortion coefficient k3.
[in]_p1Tangential distortion coefficient p1.
[in]_p2Tangential distortion coefficient p2.
[in]_widthWidth of the image texture in pixels.
[in]_fFocal length in pixels.
Returns
Distorted coordinate.

◆ DistortionMapValueClamped()

gz::math::Vector2d DistortionMapValueClamped ( int  _x,
int  _y 
) const
protected

get the distortion map value.

Parameters
[in]_xX component of map.
[in]_yY component of map.
Returns
the distortion map value at the specified index.

◆ PreRender()

void PreRender ( )
overridevirtual

Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender.

Implements Object.


The documentation for this class was generated from the following file: