Gazebo Rendering

API Reference

9.0.0
RenderTarget Class Referenceabstract

Represents a render-target to which cameras can render images. More...

#include <gz/rendering/RenderTarget.hh>

Public Member Functions

virtual ~RenderTarget ()
 Destructor.
 
virtual void AddRenderPass (const RenderPassPtr &_pass)=0
 Add a render pass to the render target.
 
virtual math::Color BackgroundColor () const =0
 Get the background color of the render target. This should be the same as the scene background color.
 
virtual void Copy (Image &_image) const =0
 Write rendered image to given Image. The RenderTarget will convert the underlying image to the specified format listed in the given Image. However if the given image is not of the correct size no work will be done. Calling this function before an image has been rendered will result in undefined behavior.
 
virtual PixelFormat Format () const =0
 Set the render target image format.
 
virtual unsigned int Height () const =0
 Get render target height in pixels.
 
virtual void PreRender ()=0
 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.
 
virtual void PreRender (const CameraPtr &_camera)=0
 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 bool Reinterpretable () const =0
 See SetFormat()
 
virtual void RemoveAllRenderPasses ()=0
 Remove all render passes from the render target.
 
virtual void RemoveRenderPass (const RenderPassPtr &_pass)=0
 Remove a render pass from the render target.
 
virtual RenderPassPtr RenderPassByIndex (unsigned int _index) const =0
 Get a render pass by index.
 
virtual unsigned int RenderPassCount () const =0
 Get the number of render passes applied to the render target.
 
virtual void SetFormat (PixelFormat _format, bool _reinterpretable=false)=0
 Set the render target image format.
 
virtual void SetHeight (const unsigned int _height)=0
 Set the render target height in pixels.
 
virtual void SetWidth (const unsigned int _width)=0
 Set the render target width in pixels.
 
virtual unsigned int Width () const =0
 Get render target width in pixels.
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor.
 
virtual void Destroy ()=0
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior.
 
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.
 

Detailed Description

Represents a render-target to which cameras can render images.

Constructor & Destructor Documentation

◆ ~RenderTarget()

virtual ~RenderTarget ( )
virtual

Destructor.

Member Function Documentation

◆ AddRenderPass()

virtual void AddRenderPass ( const RenderPassPtr _pass)
pure virtual

Add a render pass to the render target.

Parameters
[in]_passNew render pass to add

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, BaseRenderTarget< OgreObject >, and Ogre2RenderTexture.

Referenced by BaseCamera< T >::AddRenderPass().

◆ BackgroundColor()

virtual math::Color BackgroundColor ( ) const
pure virtual

Get the background color of the render target. This should be the same as the scene background color.

Returns
Render target background color.

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, BaseRenderTarget< OgreObject >, OgreRenderTarget, and Ogre2RenderTarget.

◆ Copy()

virtual void Copy ( Image _image) const
pure virtual

Write rendered image to given Image. The RenderTarget will convert the underlying image to the specified format listed in the given Image. However if the given image is not of the correct size no work will be done. Calling this function before an image has been rendered will result in undefined behavior.

Parameters
[out]_imageImage to which output will be written

Implemented in OgreRenderTarget, and Ogre2RenderTarget.

Referenced by BaseCamera< T >::Copy().

◆ Format()

virtual PixelFormat Format ( ) const
pure virtual

Set the render target image format.

Returns
Render target format

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::ImageFormat().

◆ Height()

virtual unsigned int Height ( ) const
pure virtual

Get render target height in pixels.

Returns
The Render target height in pixels

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::ImageHeight().

◆ PreRender() [1/2]

virtual void PreRender ( )
virtual

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.

◆ PreRender() [2/2]

virtual void PreRender ( const CameraPtr _camera)
pure virtual

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.

Parameters
[in]_cameraCamera that is about to render

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::PreRender().

◆ Reinterpretable()

virtual bool Reinterpretable ( ) const
pure virtual

See SetFormat()

Returns
True if format is reinterpretable

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

◆ RemoveAllRenderPasses()

virtual void RemoveAllRenderPasses ( )
pure virtual

Remove all render passes from the render target.

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, BaseRenderTarget< OgreObject >, and Ogre2RenderTexture.

◆ RemoveRenderPass()

virtual void RemoveRenderPass ( const RenderPassPtr _pass)
pure virtual

Remove a render pass from the render target.

Parameters
[in]_passrender pass to remove

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, BaseRenderTarget< OgreObject >, and Ogre2RenderTexture.

Referenced by BaseCamera< T >::RemoveRenderPass().

◆ RenderPassByIndex()

virtual RenderPassPtr RenderPassByIndex ( unsigned int  _index) const
pure virtual

Get a render pass by index.

Returns
Render pass at the specified index

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::RenderPassByIndex().

◆ RenderPassCount()

virtual unsigned int RenderPassCount ( ) const
pure virtual

Get the number of render passes applied to the render target.

Returns
Number of render passes applied

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::RenderPassCount().

◆ SetFormat()

virtual void SetFormat ( PixelFormat  _format,
bool  _reinterpretable = false 
)
pure virtual

Set the render target image format.

Parameters
[in]_formatNew target format
[in]_reinterpretablewhether the RenderTarget will be reinterpreted to another format (e.g. from RGBA8_UNORM to/from RGBA8_UNORM_SRGB)

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::SetImageFormat().

◆ SetHeight()

virtual void SetHeight ( const unsigned int  _height)
pure virtual

Set the render target height in pixels.

Parameters
[in]_heightNew render target height in pixels

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::SetImageHeight().

◆ SetWidth()

virtual void SetWidth ( const unsigned int  _width)
pure virtual

Set the render target width in pixels.

Parameters
[in]_widthNew render target width in pixels

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::SetImageWidth().

◆ Width()

virtual unsigned int Width ( ) const
pure virtual

Get render target width in pixels.

Returns
The render target width in pixels

Implemented in BaseRenderTarget< T >, BaseRenderTarget< Ogre2Object >, and BaseRenderTarget< OgreObject >.

Referenced by BaseCamera< T >::ImageWidth().


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