gramods
|
The SaveView is a view that saves the image generated by another view. More...
#include <SaveView.hh>
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... | |
![]() | |
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... | |
![]() | |
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 gramods::gmCore::OFactory::OFactoryInformation | _gm_ofi |
![]() | |
static gramods::gmCore::OFactory::OFactoryInformation | _gm_ofi |
Additional Inherited Members | |
![]() | |
void | populateViewSettings (ViewSettings &settings) |
Adds the dispatcher's local renderers and viewpoint, if set. More... | |
![]() | |
Node::list | nodes |
std::vector< std::shared_ptr< Viewpoint > > | viewpoints |
The SaveView is a view that saves the image generated by another view.
void gramods::gmGraphics::SaveView::addView | ( | std::shared_ptr< View > | view | ) |
Adds a view that should be saved to file.
XML-attribute: view
bool gramods::gmGraphics::SaveView::getUseAlpha | ( | ) |
Returns true iff the alpha channel is read off and saved.
bool gramods::gmGraphics::SaveView::getUseFloat | ( | ) |
Returns true iff the pixel data are read off and saved in floating point format, false otherwise.
|
overridevirtual |
Forwards rendering to the sub view and saves the result.
Reimplemented from gramods::gmGraphics::ViewBase.
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
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
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
void gramods::gmGraphics::SaveView::setUseAlpha | ( | bool | on | ) |
Set to true if the alpha channel should be read off and saved.
Default is false.
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.
|
overridevirtual |
Propagates the specified visitor.
Reimplemented from gramods::gmCore::Object.