Visualization Library 2.1.0

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

VL     Star     Watch     Fork     Issue

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

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

#include <DrawPixels.hpp>

+ Inheritance diagram for vl::DrawPixels::Pixels:

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. More...
 
 Pixels (const Pixels &other)
 
Pixelsoperator= (const Pixels &other)
 
 ~Pixels ()
 
const ivec2position () const
 
const ivec2start () const
 
const ivec2size () const
 
void setPosition (const ivec2 &position)
 
void setStart (const ivec2 &start)
 
void setSize (const ivec2 &size)
 
ImagePBOimage ()
 
const ImagePBOimage () 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);. More...
 
void deletePixelBufferObject ()
 
bool hasPixelBufferObject () const
 
- 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 Attributes

ref< ImagePBOmImage
 
ivec2 mPosition
 
ivec2 mStart
 
ivec2 mSize
 
int mAlign
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Friends

class DrawPixels
 

Additional Inherited Members

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

Detailed Description

Represents a bitmap to be drawn on the screen.

Definition at line 71 of file DrawPixels.hpp.

Constructor & Destructor Documentation

◆ Pixels() [1/3]

DrawPixels::Pixels::Pixels ( )

Definition at line 44 of file DrawPixels.cpp.

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

◆ Pixels() [2/3]

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(), mAlign, mImage, mPosition, mSize, mStart, and vl::Image::width().

◆ Pixels() [3/3]

DrawPixels::Pixels::Pixels ( const Pixels other)

Definition at line 68 of file DrawPixels.cpp.

◆ ~Pixels()

DrawPixels::Pixels::~Pixels ( )

Definition at line 85 of file DrawPixels.cpp.

Member Function Documentation

◆ align()

int vl::DrawPixels::Pixels::align ( ) const
inline

Definition at line 108 of file DrawPixels.hpp.

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

◆ deletePixelBufferObject()

void DrawPixels::Pixels::deletePixelBufferObject ( )

◆ generatePixelBufferObject()

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::Buffer::clear(), image(), vl::Image::imageBuffer(), vl::ImagePBO::pixelBufferObject(), vl::BufferObject::setBufferData(), and VL_CHECK.

◆ hasPixelBufferObject()

bool DrawPixels::Pixels::hasPixelBufferObject ( ) const

◆ image() [1/2]

ImagePBO* vl::DrawPixels::Pixels::image ( )
inline

◆ image() [2/2]

const ImagePBO* vl::DrawPixels::Pixels::image ( ) const
inline

Definition at line 106 of file DrawPixels.hpp.

◆ operator=()

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

Definition at line 75 of file DrawPixels.cpp.

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

◆ position()

const ivec2& vl::DrawPixels::Pixels::position ( ) const
inline

Definition at line 92 of file DrawPixels.hpp.

◆ setAlign()

void vl::DrawPixels::Pixels::setAlign ( int  align)
inline

Definition at line 110 of file DrawPixels.hpp.

◆ setPosition()

void vl::DrawPixels::Pixels::setPosition ( const ivec2 position)
inline

Definition at line 98 of file DrawPixels.hpp.

◆ setSize()

void vl::DrawPixels::Pixels::setSize ( const ivec2 size)
inline

Definition at line 102 of file DrawPixels.hpp.

◆ setStart()

void vl::DrawPixels::Pixels::setStart ( const ivec2 start)
inline

Definition at line 100 of file DrawPixels.hpp.

◆ size()

const ivec2& vl::DrawPixels::Pixels::size ( ) const
inline

Definition at line 96 of file DrawPixels.hpp.

◆ start()

const ivec2& vl::DrawPixels::Pixels::start ( ) const
inline

Definition at line 94 of file DrawPixels.hpp.

Friends And Related Function Documentation

◆ DrawPixels

friend class DrawPixels
friend

Definition at line 75 of file DrawPixels.hpp.

Member Data Documentation

◆ mAlign

int vl::DrawPixels::Pixels::mAlign
protected

Definition at line 128 of file DrawPixels.hpp.

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

◆ mImage

ref<ImagePBO> vl::DrawPixels::Pixels::mImage
protected

◆ mPosition

ivec2 vl::DrawPixels::Pixels::mPosition
protected

Definition at line 125 of file DrawPixels.hpp.

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

◆ mSize

ivec2 vl::DrawPixels::Pixels::mSize
protected

Definition at line 127 of file DrawPixels.hpp.

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

◆ mStart

ivec2 vl::DrawPixels::Pixels::mStart
protected

Definition at line 126 of file DrawPixels.hpp.

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


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