Visualization Library 2.0.0-b3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vl::ReadPixels Class Reference

A RenderEventCallback that copyes a rectangular pixel area from a source buffer to an Image at the end of a rendering. More...

#include <ReadPixels.hpp>

+ Inheritance diagram for vl::ReadPixels:

Public Member Functions

 ReadPixels ()
 
 ReadPixels (int x, int y, int width, int height, EReadDrawBuffer read_buffer, Image *image, bool store_in_pbo)
 
virtual bool onRenderingStarted (const RenderingAbstract *)
 Reimplement to react to this event. More...
 
virtual bool onRenderingFinished (const RenderingAbstract *)
 Reimplement to react to this event. More...
 
virtual bool onRendererStarted (const RendererAbstract *)
 Reimplement to react to this event. More...
 
virtual bool onRendererFinished (const RendererAbstract *)
 Reimplement to react to this event. More...
 
void setup (int x, int y, int width, int height, EReadDrawBuffer read_buffer, bool store_in_pbo)
 
void setX (int x)
 
void setY (int y)
 
void setWidth (int width)
 
void setHeight (int height)
 
void setReadBuffer (EReadDrawBuffer buffer)
 
void setImage (Image *image)
 
void setSavePath (const String &path)
 
int x () const
 
int y () const
 
int width () const
 
int height () const
 
EReadDrawBuffer readBuffer () const
 
Imageimage ()
 
const Imageimage () const
 
const StringsavePath () const
 
void setStoreInPixelBufferObject (bool use_pbo)
 
bool storeInPixelBufferObject () const
 
- Public Member Functions inherited from vl::RenderEventCallback
 RenderEventCallback ()
 
void setRemoveAfterCall (bool remove)
 Defines if the callback shall be removed after being executed. More...
 
bool removeAfterCall () const
 Defines if the callback shall be removed after being executed. More...
 
void setEnabled (bool enabled)
 Enabled/disabled callback. More...
 
bool isEnabled () const
 Whether the callback is enabled or not. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Member Functions

void readPixels ()
 
- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Protected Attributes

int mX
 
int mY
 
int mWidth
 
int mHeight
 
EReadDrawBuffer mReadBuffer
 
ref< ImagemImage
 
String mSavePath
 
bool mStoreInPixelBufferObject
 
- Protected Attributes inherited from vl::RenderEventCallback
bool mRemoveAfterCall
 
bool mEnabled
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Detailed Description

A RenderEventCallback that copyes a rectangular pixel area from a source buffer to an Image at the end of a rendering.

The actual copy is performed using the function Image::readPixels(). Using the function setSavePath() the Image will be saved on the specified location.

See also

Definition at line 152 of file ReadPixels.hpp.

Constructor & Destructor Documentation

◆ ReadPixels() [1/2]

vl::ReadPixels::ReadPixels ( )
inline

Definition at line 157 of file ReadPixels.hpp.

◆ ReadPixels() [2/2]

vl::ReadPixels::ReadPixels ( int  x,
int  y,
int  width,
int  height,
EReadDrawBuffer  read_buffer,
Image image,
bool  store_in_pbo 
)
inline

Definition at line 168 of file ReadPixels.hpp.

Member Function Documentation

◆ height()

int vl::ReadPixels::height ( ) const
inline

Definition at line 225 of file ReadPixels.hpp.

References mHeight.

Referenced by setHeight(), and setup().

◆ image() [1/2]

Image* vl::ReadPixels::image ( )
inline

Definition at line 227 of file ReadPixels.hpp.

References mImage.

Referenced by setImage().

◆ image() [2/2]

const Image* vl::ReadPixels::image ( ) const
inline

Definition at line 228 of file ReadPixels.hpp.

References mImage.

◆ onRendererFinished()

virtual bool vl::ReadPixels::onRendererFinished ( const RendererAbstract )
inlinevirtual

Reimplement to react to this event.

Returns
true if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 198 of file ReadPixels.hpp.

References readPixels().

◆ onRendererStarted()

virtual bool vl::ReadPixels::onRendererStarted ( const RendererAbstract )
inlinevirtual

Reimplement to react to this event.

Returns
true if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 192 of file ReadPixels.hpp.

References readPixels().

◆ onRenderingFinished()

virtual bool vl::ReadPixels::onRenderingFinished ( const RenderingAbstract )
inlinevirtual

Reimplement to react to this event.

Returns
true if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 186 of file ReadPixels.hpp.

References readPixels().

◆ onRenderingStarted()

virtual bool vl::ReadPixels::onRenderingStarted ( const RenderingAbstract )
inlinevirtual

Reimplement to react to this event.

Returns
true if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 180 of file ReadPixels.hpp.

References readPixels().

◆ readBuffer()

EReadDrawBuffer vl::ReadPixels::readBuffer ( ) const
inline

Definition at line 226 of file ReadPixels.hpp.

References mReadBuffer.

◆ readPixels()

void vl::ReadPixels::readPixels ( )
inlineprotected

◆ savePath()

const String& vl::ReadPixels::savePath ( ) const
inline

Definition at line 229 of file ReadPixels.hpp.

References mSavePath.

Referenced by readPixels().

◆ setHeight()

void vl::ReadPixels::setHeight ( int  height)
inline

Definition at line 217 of file ReadPixels.hpp.

References height(), and mHeight.

◆ setImage()

void vl::ReadPixels::setImage ( Image image)
inline

Definition at line 219 of file ReadPixels.hpp.

References image(), and mImage.

◆ setReadBuffer()

void vl::ReadPixels::setReadBuffer ( EReadDrawBuffer  buffer)
inline

Definition at line 218 of file ReadPixels.hpp.

References mReadBuffer.

◆ setSavePath()

void vl::ReadPixels::setSavePath ( const String path)
inline

Definition at line 220 of file ReadPixels.hpp.

References mSavePath.

◆ setStoreInPixelBufferObject()

void vl::ReadPixels::setStoreInPixelBufferObject ( bool  use_pbo)
inline

Definition at line 231 of file ReadPixels.hpp.

References mStoreInPixelBufferObject.

◆ setup()

void vl::ReadPixels::setup ( int  x,
int  y,
int  width,
int  height,
EReadDrawBuffer  read_buffer,
bool  store_in_pbo 
)
inline

Definition at line 204 of file ReadPixels.hpp.

References height(), mHeight, mReadBuffer, mStoreInPixelBufferObject, mWidth, mX, mY, width(), x(), and y().

◆ setWidth()

void vl::ReadPixels::setWidth ( int  width)
inline

Definition at line 216 of file ReadPixels.hpp.

References mWidth, and width().

◆ setX()

void vl::ReadPixels::setX ( int  x)
inline

Definition at line 214 of file ReadPixels.hpp.

References mX, and x().

◆ setY()

void vl::ReadPixels::setY ( int  y)
inline

Definition at line 215 of file ReadPixels.hpp.

References mY, and y().

◆ storeInPixelBufferObject()

bool vl::ReadPixels::storeInPixelBufferObject ( ) const
inline

Definition at line 232 of file ReadPixels.hpp.

References mStoreInPixelBufferObject.

Referenced by readPixels().

◆ width()

int vl::ReadPixels::width ( ) const
inline

Definition at line 224 of file ReadPixels.hpp.

References mWidth.

Referenced by setup(), and setWidth().

◆ x()

int vl::ReadPixels::x ( ) const
inline

Definition at line 222 of file ReadPixels.hpp.

References mX.

Referenced by setup(), and setX().

◆ y()

int vl::ReadPixels::y ( ) const
inline

Definition at line 223 of file ReadPixels.hpp.

References mY.

Referenced by setup(), and setY().

Member Data Documentation

◆ mHeight

int vl::ReadPixels::mHeight
protected

Definition at line 251 of file ReadPixels.hpp.

Referenced by height(), readPixels(), setHeight(), and setup().

◆ mImage

ref<Image> vl::ReadPixels::mImage
protected

Definition at line 253 of file ReadPixels.hpp.

Referenced by image(), readPixels(), and setImage().

◆ mReadBuffer

EReadDrawBuffer vl::ReadPixels::mReadBuffer
protected

Definition at line 252 of file ReadPixels.hpp.

Referenced by readBuffer(), readPixels(), setReadBuffer(), and setup().

◆ mSavePath

String vl::ReadPixels::mSavePath
protected

Definition at line 254 of file ReadPixels.hpp.

Referenced by savePath(), and setSavePath().

◆ mStoreInPixelBufferObject

bool vl::ReadPixels::mStoreInPixelBufferObject
protected

Definition at line 255 of file ReadPixels.hpp.

Referenced by setStoreInPixelBufferObject(), setup(), and storeInPixelBufferObject().

◆ mWidth

int vl::ReadPixels::mWidth
protected

Definition at line 250 of file ReadPixels.hpp.

Referenced by readPixels(), setup(), setWidth(), and width().

◆ mX

int vl::ReadPixels::mX
protected

Definition at line 248 of file ReadPixels.hpp.

Referenced by readPixels(), setup(), setX(), and x().

◆ mY

int vl::ReadPixels::mY
protected

Definition at line 249 of file ReadPixels.hpp.

Referenced by readPixels(), setup(), setY(), and y().


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