# Visualization Library

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

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

Public Member Functions | Protected Attributes | Friends

# 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 (ImagePBO *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)
ImagePBO * | image ()
const ImagePBO * | image () const
int | align () const
void | setAlign (int align)
bool | generatePixelBufferObject (EBufferObjectUsage usage, bool discard_local_storage)
| Generates a pixel buffer object for the associated Image calling image()->bufferObject()->setBufferData(usage, discard_local_storage);.
void | deletePixelBufferObject ()
bool | hasPixelBufferObject () const

## Protected Attributes

ref< ImagePBO > | mImage
ivec2 | mPosition
ivec2 | mStart
ivec2 | mSize
int | mAlign

## Friends

class | DrawPixels

## Detailed Description

Represents a bitmap to be drawn on the screen.

Definition at line 71 of file DrawPixels.hpp.

## Constructor & Destructor Documentation

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

Definition at line 44 of file DrawPixels.cpp.

References vl::AlignBottom, vl::AlignLeft, mAlign, and VL_DEBUG_SET_OBJECT_NAME.

DrawPixels::Pixels::Pixels | ( | ImagePBO * | 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.

Definition at line 50 of file DrawPixels.cpp.

References vl::Image::height(), VL_DEBUG_SET_OBJECT_NAME, and vl::Image::width().

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

Definition at line 68 of file DrawPixels.cpp.

References VL_DEBUG_SET_OBJECT_NAME.

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

Definition at line 85 of file DrawPixels.cpp.

## Member Function Documentation

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

Definition at line 75 of file DrawPixels.cpp.

References mAlign, mImage, mPosition, mSize, and mStart.

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

Definition at line 92 of file DrawPixels.hpp.

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

Definition at line 94 of file DrawPixels.hpp.

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

Definition at line 96 of file DrawPixels.hpp.

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

Definition at line 98 of file DrawPixels.hpp.

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

Definition at line 100 of file DrawPixels.hpp.

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

Definition at line 102 of file DrawPixels.hpp.

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

Definition at line 104 of file DrawPixels.hpp.

Referenced by vl::DrawPixels::render_Implementation().

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

Definition at line 106 of file DrawPixels.hpp.

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

Definition at line 108 of file DrawPixels.hpp.

Referenced by vl::DrawPixels::render_Implementation().

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

Definition at line 110 of file DrawPixels.hpp.

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

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

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

Definition at line 94 of file DrawPixels.cpp.

References VL_CHECK.

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

Definition at line 89 of file DrawPixels.cpp.

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

Definition at line 105 of file DrawPixels.cpp.

## Friends And Related Function Documentation

friend class DrawPixels`[friend]`

Definition at line 75 of file DrawPixels.hpp.

## Member Data Documentation

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

Definition at line 124 of file DrawPixels.hpp.

Referenced by operator=().

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

Definition at line 125 of file DrawPixels.hpp.

Referenced by operator=(), and vl::DrawPixels::render_Implementation().

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

Definition at line 126 of file DrawPixels.hpp.

Referenced by operator=(), and vl::DrawPixels::render_Implementation().

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

Definition at line 127 of file DrawPixels.hpp.

Referenced by operator=(), and vl::DrawPixels::render_Implementation().

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

Definition at line 128 of file DrawPixels.hpp.

Referenced by operator=(), and Pixels().

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

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

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:33.
Permission is granted to use this page to write and publish articles regarding Visualization Library.