Webcam Class Reference

#include <Webcam.h>

Inheritance diagram for Webcam:

Object2d EventListener ViewObject Object Object

List of all members.

Public Member Functions

void updateImage ()
 Grabs a new frame from the Webcam.
void bindAsTexture ()
 Binds webcam image as OpenGL texture.
const VectorgetLightDirection ()
 Returns the direction from which the most light comes in.
const VectorgetShadowDirection ()
 Returns the direction from which the least light comes in.
Uint32 getDarkPixelsCount ()
 Returns the number of dark pixels recorded by the webcam.
Uint32 getLightPixelsCount ()
 Returns the number of light pixels recorded by the webcam.
float getDarkPixelsPercentage ()
 Returns the percentage of darkest pixels (100% are numDarkest + numLightest).
GLfloat & getWidth ()
 Getter for width.
GLfloat & getHeight ()
 Getter for height.
void setWidth (const GLfloat &width)
 Setter for width.
void setHeight (const GLfloat &height)
 Setter for height.
void renderGl ()
 Renders webcam image as OpenGL plane.
void selectGl ()
 Selection rendering pass.
void processEvent (SDL_Event &event)
 A method to deal with SDL_Event.
virtual string toString () const
 Returns a textual representation.
virtual string className () const
 Returns the class name of the object.
virtual enum classId classId () const
 Returns the class id of the object.

Static Public Member Functions

static WebcamgetInstance ()
 Getter of the singleton instance.

Private Member Functions

 Webcam ()
 Standard constructor.
 Webcam (const Webcam &source)
 Copy constructor.
 ~Webcam ()
 Destructor.
void updateLightDirection ()
 Recalculates the light vector (maybe should moved to a shader).

Private Attributes

CvCapture * captureDevice
 Pointer to hardware device.
IplImage * currentImage
 Webcam Image.
GLuint textureId
 OpenGL Texture ID.
GLfloat width
 width of the 3d representation
GLfloat height
 height of the 3d representation
Vector lightDirection
 Vector pointing to the center of brightness.
Vector shadowDirection
 Vector pointing to the center of drakness.
Uint32 numDark
 Number of dark pixels recorded by the webcam.
Uint32 numLight
 Number of light pixels recorded by the webcam.
float percentageDarkest
 percentage of darkest pixels (numDarkest + numLightest = 100%)
bool lightDirectionUpToDate
 Is the light direction up to date?
Uint32 averageColor
 Average image color.
bool visible
 Should the debug-window be rendered?
bool falseColors
 Should false colors be rendered?
Texture fallbackTexture
 Fallback texture.

Static Private Attributes

static Webcaminstance = 0
 Singleton instance.


Constructor & Destructor Documentation

Webcam::Webcam (  )  [private]

Standard constructor.

Webcam::Webcam ( const Webcam source  )  [private]

Copy constructor.

Should never be called with a singleton

Webcam::~Webcam (  )  [private]

Destructor.


Member Function Documentation

void Webcam::updateLightDirection (  )  [private]

Recalculates the light vector (maybe should moved to a shader).

Webcam * Webcam::getInstance (  )  [static]

Getter of the singleton instance.

void Webcam::updateImage (  ) 

Grabs a new frame from the Webcam.

Updates the Webcam texture if the webcamUpdateImage thread got something new

void Webcam::bindAsTexture (  ) 

Binds webcam image as OpenGL texture.

const Vector & Webcam::getLightDirection (  ) 

Returns the direction from which the most light comes in.

const Vector & Webcam::getShadowDirection (  ) 

Returns the direction from which the least light comes in.

Uint32 Webcam::getDarkPixelsCount (  ) 

Returns the number of dark pixels recorded by the webcam.

Uint32 Webcam::getLightPixelsCount (  ) 

Returns the number of light pixels recorded by the webcam.

float Webcam::getDarkPixelsPercentage (  ) 

Returns the percentage of darkest pixels (100% are numDarkest + numLightest).

GLfloat & Webcam::getWidth (  ) 

Getter for width.

GLfloat & Webcam::getHeight (  ) 

Getter for height.

void Webcam::setWidth ( const GLfloat &  width  ) 

Setter for width.

void Webcam::setHeight ( const GLfloat &  height  ) 

Setter for height.

void Webcam::renderGl (  )  [virtual]

Renders webcam image as OpenGL plane.

Implements Object2d.

void Webcam::selectGl (  )  [virtual]

Selection rendering pass.

Implements Object2d.

void Webcam::processEvent ( SDL_Event &  event  )  [virtual]

A method to deal with SDL_Event.

Implements EventListener.

string Webcam::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Implements EventListener.

string Webcam::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Implements EventListener.

enum classId Webcam::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Implements EventListener.


Member Data Documentation

Webcam * Webcam::instance = 0 [static, private]

Singleton instance.

CvCapture* Webcam::captureDevice [private]

Pointer to hardware device.

IplImage* Webcam::currentImage [private]

Webcam Image.

GLuint Webcam::textureId [private]

OpenGL Texture ID.

GLfloat Webcam::width [private]

width of the 3d representation

GLfloat Webcam::height [private]

height of the 3d representation

Vector pointing to the center of brightness.

Vector pointing to the center of drakness.

Uint32 Webcam::numDark [private]

Number of dark pixels recorded by the webcam.

Uint32 Webcam::numLight [private]

Number of light pixels recorded by the webcam.

float Webcam::percentageDarkest [private]

percentage of darkest pixels (numDarkest + numLightest = 100%)

Is the light direction up to date?

Uint32 Webcam::averageColor [private]

Average image color.

bool Webcam::visible [private]

Should the debug-window be rendered?

bool Webcam::falseColors [private]

Should false colors be rendered?

Fallback texture.


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

Generated on Mon Jul 7 13:30:35 2008 for Firefly by  doxygen 1.5.6