Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
orxonox::ScreenshotManager Class Reference

Class encapsulates screenshot functionality and provides a method for making multi grid (i.e. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/modules/designtools/ScreenshotManager.h>

Inheritance diagram for orxonox::ScreenshotManager:
orxonox::Configurable orxonox::Singleton< T > orxonox::Listable orxonox::Identifiable

Public Member Functions

 ScreenshotManager ()
 Constructor. More...
 
virtual ~ScreenshotManager ()
 
void cleanup (void)
 Frees used memory. More...
 
unsigned int getGridSize (void)
 Get the current grid size. More...
 
Ogre::Image * getScreenshot ()
 Creates a screenshot and returns it. More...
 
Ogre::Image * getScreenshot (Ogre::Camera *camera)
 Creates a screenshot with the given camera and returns it. More...
 
void makeScreenshot ()
 Make a screenshot. More...
 
void setConfigValues (void)
 Sets some config values. More...
 
void setGridSize (unsigned int size)
 Set the size of the grid. More...
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 

Static Public Member Functions

static void makeScreenshot_s ()
 Creates a screenshot. More...
 
- Static Public Member Functions inherited from orxonox::Singleton< T >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static T & getInstance ()
 Returns a reference to the singleton instance. More...
 

Protected Member Functions

void update (void)
 Update internal parameters. More...
 
- Protected Member Functions inherited from orxonox::Singleton< T >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Protected Attributes

Ogre::HardwarePixelBufferSharedPtr buffer_
 Buffer for the temporary texture. More...
 
uint8_t * data_
 Data pointer for the PixelBox. More...
 
bool disableOverlays_
 Whether overlays should be disabled. More...
 
std::string fileExtension_
 The image extension used to save the screenshot. More...
 
Ogre::PixelBox * finalPicturePB_
 PixelBox for large screenshots, contains the screenshot for gridSize_ > 1. More...
 
unsigned int gridSize_
 The magnification factor. A 2 will create a 2x2 grid, doubling the size of the screenshot. A 3 will create a 3x3 grid, tripling the size of the screenshot. More...
 
Ogre::RenderTexture * renderTarget_
 Render target for the temporary texture. More...
 
Ogre::TexturePtr tempTexture_
 Temporary texture with current screen size. More...
 
unsigned int windowHeight_
 The width and height of the window. More...
 
unsigned int windowWidth_
 

Static Protected Attributes

static ScreenshotManagersingletonPtr_s
 

Friends

class Singleton< ScreenshotManager >
 

Detailed Description

Class encapsulates screenshot functionality and provides a method for making multi grid (i.e.

HD) screenshots.

Author
This code comes from http://www.ogre3d.org/tikiwiki/High+resolution+screenshots which is Public Domain.
Oli Scheuss
Damian 'Mozork' Frick

Constructor & Destructor Documentation

orxonox::ScreenshotManager::ScreenshotManager ( )

Constructor.

orxonox::ScreenshotManager::~ScreenshotManager ( )
virtual

Member Function Documentation

void orxonox::ScreenshotManager::cleanup ( void  )

Frees used memory.

unsigned int orxonox::ScreenshotManager::getGridSize ( void  )
inline

Get the current grid size.

Returns
Returns the size of the grid.
Ogre::Image * orxonox::ScreenshotManager::getScreenshot ( )

Creates a screenshot and returns it.

After calling this method the ScreenshotManager should be cleaned using cleanup().

Returns
Returns a pointer to an Ogre::Image with the screenshot. The memory must be freed, when the image is no longer needed.
Ogre::Image * orxonox::ScreenshotManager::getScreenshot ( Ogre::Camera *  camera)

Creates a screenshot with the given camera and returns it.

After calling this method the ScreenshotManager should be cleaned using cleanup().

Parameters
cameraA pointer to the camera the screenshot should be taken with.
Returns
Returns a pointer to an Ogre::Image with the screenshot. The memory must be freed, when the image is no longer needed.
void orxonox::ScreenshotManager::makeScreenshot ( )

Make a screenshot.

The screenshot is saved in the log folder.

static void orxonox::ScreenshotManager::makeScreenshot_s ( )
inlinestatic

Creates a screenshot.

void orxonox::ScreenshotManager::setConfigValues ( void  )

Sets some config values.

void orxonox::ScreenshotManager::setGridSize ( unsigned int  size)

Set the size of the grid.

Parameters
sizeThe size of the grid.
void orxonox::ScreenshotManager::update ( void  )
protected

Update internal parameters.

Friends And Related Function Documentation

friend class Singleton< ScreenshotManager >
friend

Member Data Documentation

Ogre::HardwarePixelBufferSharedPtr orxonox::ScreenshotManager::buffer_
protected

Buffer for the temporary texture.

uint8_t* orxonox::ScreenshotManager::data_
protected

Data pointer for the PixelBox.

bool orxonox::ScreenshotManager::disableOverlays_
protected

Whether overlays should be disabled.

std::string orxonox::ScreenshotManager::fileExtension_
protected

The image extension used to save the screenshot.

Ogre::PixelBox* orxonox::ScreenshotManager::finalPicturePB_
protected

PixelBox for large screenshots, contains the screenshot for gridSize_ > 1.

unsigned int orxonox::ScreenshotManager::gridSize_
protected

The magnification factor. A 2 will create a 2x2 grid, doubling the size of the screenshot. A 3 will create a 3x3 grid, tripling the size of the screenshot.

Ogre::RenderTexture* orxonox::ScreenshotManager::renderTarget_
protected

Render target for the temporary texture.

ScreenshotManager* orxonox::ScreenshotManager::singletonPtr_s
staticprotected
Ogre::TexturePtr orxonox::ScreenshotManager::tempTexture_
protected

Temporary texture with current screen size.

unsigned int orxonox::ScreenshotManager::windowHeight_
protected

The width and height of the window.

unsigned int orxonox::ScreenshotManager::windowWidth_
protected

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