Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

RandomSource Class Reference

A class which implements the ImageSource interface as a source of Randomly generated Images. More...

#include <RandomSource.h>

Inheritance diagram for RandomSource::

ImageSource List of all members.

Public Methods

 RandomSource (unsigned int w, unsigned int h, unsigned int fps)
 Create an source of Random Images. More...

virtual ImageSourceoperator>> (ImageRGB &)
 Extract a randomly generated colour Image. More...

virtual ImageSourceoperator>> (ImageGrey &)
 Extract a randomly generated greyscale Image. More...

virtual ImageSourceoperator>> (Image &)
 Extract a randomly generated Image. More...

void update (ImageRGB &)
 Create a random colour Image an store it in the data buffer of the img passed. More...

void update (ImageGrey &)
 Create a random greyscale Image an store it in the brightness buffer of the img passed. More...


Detailed Description

A class which implements the ImageSource interface as a source of Randomly generated Images.

Each image that is extracted from the RandomSource class is a plain one colour image whose colour values are calculated at random when an Image is called to be extracted.

The images will be created at a rate specified to the constructor when an instance of this class is created.

Definition at line 29 of file RandomSource.h.


Constructor & Destructor Documentation

RandomSource::RandomSource ( unsigned int w,
unsigned int h,
unsigned int fps )
 

Create an source of Random Images.

Parameters:
w   The width of the Images to be produced.
h   The height of the Images to be produced.
fps   The rate at which Images are produced.

Definition at line 29 of file RandomSource.cpp.


Member Function Documentation

ImageSource & RandomSource::operator>> ( Image & img ) [virtual]
 

Extract a randomly generated Image.

The Image could be colour or greyscale depending on the default palette type for this class.

The method sleeps for a short time so that images are not created at too fast a rate.

Parameters:
img   The Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 93 of file RandomSource.cpp.

ImageSource & RandomSource::operator>> ( ImageGrey & img ) [virtual]
 

Extract a randomly generated greyscale Image.

The method sleeps for a short time so that images are not created at too fast a rate.

Parameters:
img   The greyscale Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 73 of file RandomSource.cpp.

ImageSource & RandomSource::operator>> ( ImageRGB & img ) [virtual]
 

Extract a randomly generated colour Image.

The method sleeps for a short time so that images are not created at too fast a rate.

Parameters:
img   The colour Image to be extracted to.

Reimplemented from ImageSource.

Definition at line 56 of file RandomSource.cpp.

void RandomSource::update ( ImageGrey & img )
 

Create a random greyscale Image an store it in the brightness buffer of the img passed.

Each pixel in the Image will have the same randomly generated brightnesss values.

Parameters:
img   The colour Image in which to generate the random Image

Definition at line 140 of file RandomSource.cpp.

void RandomSource::update ( ImageRGB & img )
 

Create a random colour Image an store it in the data buffer of the img passed.

Each pixel in the Image will have the same randomly generated red, green, and blue values.

Parameters:
img   The colour Image in which to generate the random Image

Definition at line 112 of file RandomSource.cpp.

Referenced by operator>>().


The documentation for this class was generated from the following files:
Generated at Fri Aug 13 17:29:22 2004 for libRTImage by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001