FrameBuffer Class Reference

#include <framebuffer.h>

Inheritance diagram for FrameBuffer:

Image SharedFrameBuffer PluginImage PNGImage List of all members.

Public Member Functions

 FrameBuffer ()
 FrameBuffer (const BoxSize &fbSize)
 FrameBuffer (const FrameBuffer &fb)
FrameBufferoperator= (const FrameBuffer &fb)
 ~FrameBuffer ()
PixelpBuff ()
void setPixel (Point pos, Pixel color)
Pixeloperator[] (int y)
const BoxSizesize () const
void resize (const BoxSize &newSize)
void size (const BoxSize &fbSize)
const Rectselect () const
void select (const Rect &selectRect)
void unSelect ()

Protected Attributes

Pixel_pBuff
 Pointer to array of Pixel objects.

Friends

class SharedObject
 Needed for IPC.
class SharedFrameBuffer
 Needed for IPC.

Classes

class  ErrUnalloc

Detailed Description

Frame buffer. This is base class for image data representation. This class holds information about image size and selected area. It also allocates array of Pixel objects for specified image size.

Definition at line 146 of file framebuffer.h.


Constructor & Destructor Documentation

FrameBuffer::FrameBuffer (  )  [inline]

Create frame buffer with no size. This is used in derived classes. You can set frame buffer size later using FrameBuffer::size() or FrameBuffer::resize() method.

Definition at line 152 of file framebuffer.h.

FrameBuffer::FrameBuffer ( const BoxSize fbSize  )  [inline]

Create frame buffer of desired size. Whole image is set as selected area.

Parameters:
fbSize Desired size of frame buffer.

Definition at line 158 of file framebuffer.h.

References size().

FrameBuffer::FrameBuffer ( const FrameBuffer fb  ) 

Frame buffer copy constructor.

FrameBuffer::~FrameBuffer (  )  [inline]

Free memory allocated for array of Pixel objects.

Definition at line 173 of file framebuffer.h.

References _pBuff.


Member Function Documentation

FrameBuffer& FrameBuffer::operator= ( const FrameBuffer fb  ) 

Frame buffer assignment.

Pixel* FrameBuffer::pBuff (  ) 

Access point to array of Pixel objects. This can throw FrameBuffer::ErrUnalloc exception if there is no array. It happens usualy if frame buffer has zero size.

Returns:
Return pointer to one-dimensional array of Pixel objects.

Referenced by operator[](), and MyFl_Image::uncache().

void FrameBuffer::setPixel ( Point  pos,
Pixel  color 
)

This method sets pixel "pos" to color "color". It has no effect for pixels outside selected area. This can throw FrameBuffer::ErrUnalloc exception if there is no array. It happens usualy if frame buffer has zero size.

Parameters:
pos Pixel position.
color Desired color.

Pixel* FrameBuffer::operator[] ( int  y  )  [inline]

Access point to row of array of Pixel objects. This can throw FrameBuffer::ErrUnalloc exception if there is no array. It happens usualy if frame buffer has zero size.

Returns:
Return Pointer to array of Pixel objects representing image row.
Parameters:
y Desired row. This must be in interval from 0 to FrameBuffer::size().width-1.

Definition at line 199 of file framebuffer.h.

References pBuff(), and BoxSize::width.

const BoxSize& FrameBuffer::size (  )  const [inline]

Returns:
Return current frame buffer size.

Definition at line 207 of file framebuffer.h.

Referenced by FrameBuffer(), and MyFl_Image::uncache().

void FrameBuffer::resize ( const BoxSize newSize  ) 

Change size of frame buffer. Current data are simply coppied.

Parameters:
newSize New size of frame buffer.

void FrameBuffer::size ( const BoxSize fbSize  ) 

Change size of frame buffer. Current data are dropped and array stays uninitialized.

Parameters:
fbSize New size of frame buffer.

const Rect& FrameBuffer::select (  )  const [inline]

Returns:
Return selected area.

Definition at line 225 of file framebuffer.h.

void FrameBuffer::select ( const Rect selectRect  ) 

Set select area. If desired size is greater, it is limited to frame buffer size.

Parameters:
selectRect New select area.

void FrameBuffer::unSelect (  ) 

Select whole image. This means selection will have no effect for operations with frame buffer.


Friends And Related Function Documentation

friend class SharedObject [friend]

Needed for IPC.

Definition at line 243 of file framebuffer.h.

friend class SharedFrameBuffer [friend]

Needed for IPC.

Definition at line 244 of file framebuffer.h.


Member Data Documentation

Pixel* FrameBuffer::_pBuff [protected]

Pointer to array of Pixel objects.

Definition at line 247 of file framebuffer.h.

Referenced by ~FrameBuffer().


The documentation for this class was generated from the following file:
Generated on Wed Aug 29 00:01:04 2007 for GED 2006 by  doxygen 1.5.2