Ogre implementation of the DistortionPass class. More...
#include <OgreDistortionPass.hh>
Public Member Functions | |
OgreDistortionPass () | |
Constructor. | |
virtual | ~OgreDistortionPass () |
Destructor. | |
void | CreateRenderPass () override |
Create the render pass using ogre compositor. | |
void | Destroy () override |
Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. | |
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. | |
Public Member Functions inherited from BaseDistortionPass< OgreRenderPass > | |
virtual | ~BaseDistortionPass () |
Destructor. | |
math::Vector2d | Center () const |
Get the distortion center. | |
double | K1 () const |
Get the radial distortion coefficient k1. | |
double | K2 () const |
Get the radial distortion coefficient k2. | |
double | K3 () const |
Get the radial distortion coefficient k3. | |
double | P1 () const |
Get the tangential distortion coefficient p1. | |
double | P2 () const |
Get the tangential distortion coefficient p2. | |
void | SetCenter (const math::Vector2d &_center) |
Set the distortion center. | |
void | SetK1 (double _k1) |
Set the radial distortion coefficient k1. | |
void | SetK2 (double _k2) |
Set the radial distortion coefficient k2. | |
void | SetK3 (double _k3) |
Set the radial distortion coefficient k3. | |
void | SetP1 (double _p1) |
Set the tangential distortion coefficient p1. | |
void | SetP2 (double _p2) |
Set the tangential distortion coefficient p2. | |
Public Member Functions inherited from DistortionPass | |
DistortionPass () | |
Constructor. | |
virtual | ~DistortionPass () |
Destructor. | |
Public Member Functions inherited from RenderPass | |
virtual | ~RenderPass () |
Destructor. | |
Public Member Functions inherited from Object | |
virtual | ~Object () |
Destructor. | |
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. | |
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. | |
virtual void | PostRender ()=0 |
Post process this object and any of its children after rendering. | |
virtual ScenePtr | Scene () const =0 |
Get the Scene that created this object. | |
Public Member Functions inherited from OgreRenderPass | |
virtual | ~OgreRenderPass () |
Destructor. | |
void | Destroy () override |
Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. | |
virtual void | SetCamera (Ogre::Camera *_camera) |
Set the ogre camera that the render pass applies to. | |
virtual void | SetCameras (Ogre::Camera *_cameras[kMaxOgreRenderPassCameras]) |
Set all ogre cameras that the render pass applies to at once. | |
Public Member Functions inherited from BaseRenderPass< OgreObject > | |
virtual | ~BaseRenderPass () |
Destructor. | |
virtual bool | IsEnabled () const override |
Get whether or not the render pass is enabled. | |
virtual void | PreRender (const CameraPtr &_camera) override |
See Object::PreRender. This function will call Object::PreRender but with the added bonus that it has access to the camera that is about to render. | |
virtual void | SetEnabled (bool _enabled) override |
Set to enable or disable the render pass. | |
void | SetWideAngleCameraAfterStitching (bool _afterStitching) override |
WideAngleCamera renders to 6 faces; then stitches all 6 into a final "fish-eye" lens result. | |
bool | WideAngleCameraAfterStitching () const override |
See SetWideAngleCameraAfterStitching() | |
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. | |
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). | |
gz::math::Vector2d | DistortionMapValueClamped (int _x, int _y) const |
get the distortion map value. | |
Protected Member Functions inherited from BaseDistortionPass< OgreRenderPass > | |
BaseDistortionPass () | |
Constructor. | |
Protected Member Functions inherited from OgreRenderPass | |
OgreRenderPass () | |
Constructor. | |
Protected Member Functions inherited from BaseRenderPass< OgreObject > | |
BaseRenderPass () | |
Constructor. | |
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. | |
double | k2 |
Radial distortion coefficient k2. | |
double | k3 |
Radial distortion coefficient k3. | |
math::Vector2d | lensCenter |
Lens center used for distortion. | |
double | p1 |
Tangential distortion coefficient p1. | |
double | p2 |
Tangential distortion coefficient p2. | |
Protected Attributes inherited from OgreRenderPass | |
Ogre::Camera * | ogreCamera [kMaxOgreRenderPassCameras] = {} |
Pointer to the ogre camera May have more than one. Must check for nullptr on all of them. Not all RenderPasses support multiple cameras. | |
Protected Attributes inherited from BaseRenderPass< OgreObject > | |
bool | afterStitching |
Flag tracking the current value of SetWideAngleCameraAfterStitching() | |
bool | enabled |
Flag to indicate if render pass is enabled or not. | |
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 |
Destructor.
Member Function Documentation
◆ 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()
|
overridevirtual |
Create the render pass using ogre compositor.
Reimplemented from OgreRenderPass.
◆ 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 |
Apply distortion model using camera coordinates projection.
- Parameters
-
[in] _in Input uv coordinate. [in] _center Normalized distortion center. [in] _k1 Radial distortion coefficient k1. [in] _k2 Radial distortion coefficient k2. [in] _k3 Radial distortion coefficient k3. [in] _p1 Tangential distortion coefficient p1. [in] _p2 Tangential distortion coefficient p2. [in] _width Width of the image texture in pixels. [in] _f Focal length in pixels.
- Returns
- Distorted coordinate.
◆ DistortionMapValueClamped()
|
protected |
get the distortion map value.
- Parameters
-
[in] _x X component of map. [in] _y Y component of map.
- Returns
- the distortion map value at the specified index.
◆ 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: