# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Member Functions | Protected Attributes

# 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:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| 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.
virtual bool | onRenderingFinished (const RenderingAbstract *)
| Reimplement to react to this event.
virtual bool | onRendererStarted (const RendererAbstract *)
| Reimplement to react to this event.
virtual bool | onRendererFinished (const RendererAbstract *)
| Reimplement to react to this event.
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
Image * | image ()
const Image * | image () const
const String & | savePath () const
void | setStoreInPixelBufferObject (bool use_pbo)
bool | storeInPixelBufferObject () const

## Protected Member Functions

void | readPixels ()

## Protected Attributes

int | mX
int | mY
int | mWidth
int | mHeight
EReadDrawBuffer | mReadBuffer
ref< Image > | mImage
String | mSavePath
bool | mStoreInPixelBufferObject

## 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:
  - Image
  - Image::readPixels()
  - RenderEventCallback

Definition at line 142 of file ReadPixels.hpp.

## Constructor & Destructor Documentation

vl::ReadPixels::ReadPixels | ( | ) | `[inline]`

Definition at line 146 of file ReadPixels.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

vl::ReadPixels::ReadPixels | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | EReadDrawBuffer | read_buffer,
|  | Image * | image,
|  | bool | store_in_pbo
| ) |  | `[inline]`

Definition at line 157 of file ReadPixels.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

## Member Function Documentation

virtual const char* vl::ReadPixels::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::RenderEventCallback.

Definition at line 145 of file ReadPixels.hpp.

virtual bool vl::ReadPixels::onRenderingStarted | ( | const RenderingAbstract * | ) | `[inline, virtual]`

Reimplement to react to this event.

Returns:
  `true` if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 169 of file ReadPixels.hpp.

References readPixels().

virtual bool vl::ReadPixels::onRenderingFinished | ( | const RenderingAbstract * | ) | `[inline, virtual]`

Reimplement to react to this event.

Returns:
  `true` if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 175 of file ReadPixels.hpp.

References readPixels().

virtual bool vl::ReadPixels::onRendererStarted | ( | const RendererAbstract * | ) | `[inline, virtual]`

Reimplement to react to this event.

Returns:
  `true` if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 181 of file ReadPixels.hpp.

References readPixels().

virtual bool vl::ReadPixels::onRendererFinished | ( | const RendererAbstract * | ) | `[inline, virtual]`

Reimplement to react to this event.

Returns:
  `true` if the callback reacted to the given event.

Implements vl::RenderEventCallback.

Definition at line 187 of file ReadPixels.hpp.

References readPixels().

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

Definition at line 193 of file ReadPixels.hpp.

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

void vl::ReadPixels::setX | ( | int | x ) | `[inline]`

Definition at line 203 of file ReadPixels.hpp.

References mX, and x().

void vl::ReadPixels::setY | ( | int | y ) | `[inline]`

Definition at line 204 of file ReadPixels.hpp.

References mY, and y().

void vl::ReadPixels::setWidth | ( | int | width ) | `[inline]`

Definition at line 205 of file ReadPixels.hpp.

References mWidth, and width().

void vl::ReadPixels::setHeight | ( | int | height ) | `[inline]`

Definition at line 206 of file ReadPixels.hpp.

References height(), and mHeight.

void vl::ReadPixels::setReadBuffer | ( | EReadDrawBuffer | buffer ) | `[inline]`

Definition at line 207 of file ReadPixels.hpp.

References mReadBuffer.

void vl::ReadPixels::setImage | ( | Image * | image ) | `[inline]`

Definition at line 208 of file ReadPixels.hpp.

References image(), and mImage.

void vl::ReadPixels::setSavePath | ( | const String & | path ) | `[inline]`

Definition at line 209 of file ReadPixels.hpp.

References mSavePath.

int vl::ReadPixels::x | ( | ) | const`[inline]`

Definition at line 211 of file ReadPixels.hpp.

References mX.

Referenced by setup(), and setX().

int vl::ReadPixels::y | ( | ) | const`[inline]`

Definition at line 212 of file ReadPixels.hpp.

References mY.

Referenced by setup(), and setY().

int vl::ReadPixels::width | ( | ) | const`[inline]`

Definition at line 213 of file ReadPixels.hpp.

References mWidth.

Referenced by setup(), and setWidth().

int vl::ReadPixels::height | ( | ) | const`[inline]`

Definition at line 214 of file ReadPixels.hpp.

References mHeight.

Referenced by setHeight(), and setup().

EReadDrawBuffer vl::ReadPixels::readBuffer | ( | ) | const`[inline]`

Definition at line 215 of file ReadPixels.hpp.

References mReadBuffer.

Image* vl::ReadPixels::image | ( | ) | `[inline]`

Definition at line 216 of file ReadPixels.hpp.

References vl::ref< T >::get(), and mImage.

Referenced by setImage().

const Image* vl::ReadPixels::image | ( | ) | const`[inline]`

Definition at line 217 of file ReadPixels.hpp.

References vl::ref< T >::get(), and mImage.

const String& vl::ReadPixels::savePath | ( | ) | const`[inline]`

Definition at line 218 of file ReadPixels.hpp.

References mSavePath.

Referenced by readPixels().

void vl::ReadPixels::setStoreInPixelBufferObject | ( | bool | use_pbo ) | `[inline]`

Definition at line 220 of file ReadPixels.hpp.

References mStoreInPixelBufferObject.

bool vl::ReadPixels::storeInPixelBufferObject | ( | ) | const`[inline]`

Definition at line 221 of file ReadPixels.hpp.

References mStoreInPixelBufferObject.

Referenced by readPixels().

void vl::ReadPixels::readPixels | ( | ) | `[inline, protected]`

Definition at line 224 of file ReadPixels.hpp.

References vl::Log::error(), vl::ref< T >::get(), vl::String::length(), mHeight, mImage, mReadBuffer, mWidth, mX, mY, vl::saveImage(), savePath(), and storeInPixelBufferObject().

Referenced by onRendererFinished(), onRendererStarted(), onRenderingFinished(), and onRenderingStarted().

## Member Data Documentation

int vl::ReadPixels::mX`[protected]`

Definition at line 237 of file ReadPixels.hpp.

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

int vl::ReadPixels::mY`[protected]`

Definition at line 238 of file ReadPixels.hpp.

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

int vl::ReadPixels::mWidth`[protected]`

Definition at line 239 of file ReadPixels.hpp.

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

int vl::ReadPixels::mHeight`[protected]`

Definition at line 240 of file ReadPixels.hpp.

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

EReadDrawBuffer vl::ReadPixels::mReadBuffer`[protected]`

Definition at line 241 of file ReadPixels.hpp.

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

ref<Image> vl::ReadPixels::mImage`[protected]`

Definition at line 242 of file ReadPixels.hpp.

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

String vl::ReadPixels::mSavePath`[protected]`

Definition at line 243 of file ReadPixels.hpp.

Referenced by savePath(), and setSavePath().

bool vl::ReadPixels::mStoreInPixelBufferObject`[protected]`

Definition at line 244 of file ReadPixels.hpp.

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

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/ReadPixels.hpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:43.
Permission is granted to use this page to write and publish articles regarding Visualization Library.