# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::DrawPixels::Pixels Class Reference

Represents a bitmap to be drawn on the screen. More...

`#include <DrawPixels.hpp>`

Inheritance diagram for vl::DrawPixels::Pixels:

List of all members.

## Public Member Functions
| Pixels ()
| Pixels (Image *img, int scrx, int scry, int startx=0, int starty=0, int width=-1, int height=-1, int alignment=AlignBottom|AlignLeft)
| Constructor.
| Pixels (const Pixels &other)
Pixels & | operator= (const Pixels &other)
| ~Pixels ()
const ivec2 & | position () const
const ivec2 & | start () const
const ivec2 & | size () const
void | setPosition (const ivec2 &position)
void | setStart (const ivec2 &start)
void | setSize (const ivec2 &size)
Image * | image ()
const Image * | image () const
int | align () const
void | setAlign (int align)
bool | generatePixelBufferObject (EGLBufferUsage usage, bool discard_local_storage)
| Generates a pixel buffer object for the associated Image calling image()->gpuBuffer()->setBufferData(usage, discard_local_storage);.
void | deletePixelBufferObject ()
bool | hasPixelBufferObject () const
## Protected Attributes
ref< Image > | mImage
ivec2 | mPosition
ivec2 | mStart
ivec2 | mSize
int | mAlign
## Friends
class | DrawPixels

## Detailed Description

Represents a bitmap to be drawn on the screen.

## Constructor & Destructor Documentation

DrawPixels::Pixels::Pixels | ( |  | ) |

DrawPixels::Pixels::Pixels | ( | Image * | img,
|  | int | scrx,
|  | int | scry,
|  | int | startx = `0`,
|  | int | starty = `0`,
|  | int | width = `-1`,
|  | int | height = `-1`,
|  | int | alignment = `AlignBottom | AlignLeft` |
| ) |  |  |

Constructor.

The parameters 'scrx' and 'scry' define the position of the viewport in pixels where the image has to be placed. If a Transform is attached to the Actor using DrawPixels scrx, scry follow the transform on the screen. The parameters 'startx', 'starty', 'width' and 'height' define the sub-portion of the Image to be rendered. The parameters 'width' and 'height' can be -1, in this case they will be automatically set so that the Image is shown until the top-right edge.

DrawPixels::Pixels::Pixels | ( | const Pixels & | other | ) |

DrawPixels::Pixels::~Pixels | ( |  | ) |

## Member Function Documentation

DrawPixels::Pixels & DrawPixels::Pixels::operator= | ( | const Pixels & | other | ) |

const ivec2& vl::DrawPixels::Pixels::position | ( |  | ) | const`[inline]`

const ivec2& vl::DrawPixels::Pixels::start | ( |  | ) | const`[inline]`

const ivec2& vl::DrawPixels::Pixels::size | ( |  | ) | const`[inline]`

void vl::DrawPixels::Pixels::setPosition | ( | const ivec2 & | position | ) | `[inline]`

void vl::DrawPixels::Pixels::setStart | ( | const ivec2 & | start | ) | `[inline]`

void vl::DrawPixels::Pixels::setSize | ( | const ivec2 & | size | ) | `[inline]`

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

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

int vl::DrawPixels::Pixels::align | ( |  | ) | const`[inline]`

void vl::DrawPixels::Pixels::setAlign | ( | int | align | ) | `[inline]`

bool DrawPixels::Pixels::generatePixelBufferObject | ( | EGLBufferUsage | usage,
|  | bool | discard_local_storage |
| ) |  |  |

Generates a pixel buffer object for the associated Image calling image()->gpuBuffer()->setBufferData(usage, discard_local_storage);.

Note:
  All the Pixels object sharing the same Image will use the Image's PBO

void DrawPixels::Pixels::deletePixelBufferObject | ( |  | ) |

bool DrawPixels::Pixels::hasPixelBufferObject | ( |  | ) | const

## Friends And Related Function Documentation

friend class DrawPixels`[friend]`

## Member Data Documentation

ref<Image> vl::DrawPixels::Pixels::mImage`[protected]`

ivec2 vl::DrawPixels::Pixels::mPosition`[protected]`

ivec2 vl::DrawPixels::Pixels::mStart`[protected]`

ivec2 vl::DrawPixels::Pixels::mSize`[protected]`

int vl::DrawPixels::Pixels::mAlign`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/DrawPixels.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/DrawPixels.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:28:57 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.