gramods
Classes | Public Member Functions | Static Public Attributes | List of all members
gramods::gmGraphics::SaveView Class Reference

The SaveView is a view that saves the image generated by another view. More...

#include <SaveView.hh>

Inheritance diagram for gramods::gmGraphics::SaveView:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmGraphics::SaveView:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

void renderFullPipeline (ViewSettings settings) override
 Forwards rendering to the sub view and saves the result. More...
 
void traverse (Visitor *visitor) override
 Propagates the specified visitor. More...
 
void setFile (std::filesystem::path file)
 Sets the file path to save the view to. More...
 
void setResolution (gmCore::size2 res)
 Sets the resolution to render and save at, regarless of resolution of the view itself. More...
 
void setUseFloat (bool on)
 Set to true if the pixel data should be read off and saved in floating point format. More...
 
bool getUseFloat ()
 Returns true iff the pixel data are read off and saved in floating point format, false otherwise. More...
 
void setUseAlpha (bool on)
 Set to true if the alpha channel should be read off and saved. More...
 
bool getUseAlpha ()
 Returns true iff the alpha channel is read off and saved. More...
 
void setExit (bool on)
 Activates or deactivates automatic exit when the view has been saved. More...
 
void addView (std::shared_ptr< View > view)
 Adds a view that should be saved to file. More...
 
- Public Member Functions inherited from gramods::gmGraphics::ViewBase
void addNode (std::shared_ptr< Node > node)
 Adds a scenegraph to the view. More...
 
void setViewpoint (std::shared_ptr< Viewpoint > viewpoint)
 Sets the viewpoint to use in the views rendered by this ViewBase. More...
 
void addViewpoint (std::shared_ptr< Viewpoint > viewpoint)
 Adds a viewpoint to use in the views rendered by this ViewBase. More...
 
void traverse (Visitor *visitor) override
 Propagates the specified visitor. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void initialize ()
 Called to initialize the Object. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmGraphics::View
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmGraphics::ViewBase
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Protected Member Functions inherited from gramods::gmGraphics::ViewBase
void populateViewSettings (ViewSettings &settings)
 Adds the dispatcher's local renderers and viewpoint, if set. More...
 
- Protected Attributes inherited from gramods::gmGraphics::ViewBase
Node::list nodes
 
std::vector< std::shared_ptr< Viewpoint > > viewpoints
 

Detailed Description

The SaveView is a view that saves the image generated by another view.

Member Function Documentation

◆ addView()

void gramods::gmGraphics::SaveView::addView ( std::shared_ptr< View view)

Adds a view that should be saved to file.

XML-attribute: view

◆ getUseAlpha()

bool gramods::gmGraphics::SaveView::getUseAlpha ( )

Returns true iff the alpha channel is read off and saved.

◆ getUseFloat()

bool gramods::gmGraphics::SaveView::getUseFloat ( )

Returns true iff the pixel data are read off and saved in floating point format, false otherwise.

◆ renderFullPipeline()

void gramods::gmGraphics::SaveView::renderFullPipeline ( ViewSettings  settings)
overridevirtual

Forwards rendering to the sub view and saves the result.

Reimplemented from gramods::gmGraphics::ViewBase.

◆ setExit()

void gramods::gmGraphics::SaveView::setExit ( bool  on)

Activates or deactivates automatic exit when the view has been saved.

When converting animation, consider using automatic exit in the ImageTexture. Default is false.

XML-attribute: exit

◆ setFile()

void gramods::gmGraphics::SaveView::setFile ( std::filesystem::path  file)

Sets the file path to save the view to.

If a sequence of image files should be saved, then set this as a fprint formatted template, for example "frame_%06d.png". Default value is "SaveView.png".

Supported suffixes are png, jpeg, exr, tiff and pfm. Some of these support alpha and some support float:

Format Alpha Float
PNG *
JPEG
EXR *
TIFF * *
PFM *

XML-attribute: file

◆ setResolution()

void gramods::gmGraphics::SaveView::setResolution ( gmCore::size2  res)

Sets the resolution to render and save at, regarless of resolution of the view itself.

Default is to use the view resolution.

XML-attribute: resolution

◆ setUseAlpha()

void gramods::gmGraphics::SaveView::setUseAlpha ( bool  on)

Set to true if the alpha channel should be read off and saved.

Default is false.

◆ setUseFloat()

void gramods::gmGraphics::SaveView::setUseFloat ( bool  on)

Set to true if the pixel data should be read off and saved in floating point format.

Default is off.

◆ traverse()

void gramods::gmGraphics::SaveView::traverse ( Visitor visitor)
overridevirtual

Propagates the specified visitor.

See also
Object::Visitor

Reimplemented from gramods::gmCore::Object.


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