Fawkes API  Fawkes Development Version
SkelGuiTextureDrawer Class Reference

Draw images from camera in texture. More...

#include "texture_drawer.h"

Inheritance diagram for SkelGuiTextureDrawer:

List of all members.

Public Member Functions

 SkelGuiTextureDrawer (unsigned int width, unsigned int height)
 Constructor.
virtual ~SkelGuiTextureDrawer ()
 Destructor.
virtual void fill_texture ()=0
 Fill texture with data.
void draw ()
 Draw texture to screen.

Protected Member Functions

void copy_rgb_to_texture (const unsigned char *rgb_buf)
 Copy an RGB buffer to texture.

Protected Attributes

unsigned char * __texture
 Texture buffer.
const unsigned int __width
 Width of visible area from texture.
const unsigned int __height
 Height of visible area from texture.
const unsigned int __texture_width
 Real texture width.
const unsigned int __texture_height
 Real texture height.

Detailed Description

Draw images from camera in texture.

Uses texture mapping to show an image acquired from a camera in the background.

Author:
Tim Niemueller

Constructor & Destructor Documentation

SkelGuiTextureDrawer::SkelGuiTextureDrawer ( unsigned int  width,
unsigned int  height 
)

Constructor.

Parameters:
widthwidth of visible area
heightheight of visible area

Definition at line 54 of file texture_drawer.cpp.

References __texture, __texture_width, and __texture_height.

SkelGuiTextureDrawer::~SkelGuiTextureDrawer ( ) [virtual]

Destructor.

Definition at line 66 of file texture_drawer.cpp.

References __texture.


Member Function Documentation

void SkelGuiTextureDrawer::copy_rgb_to_texture ( const unsigned char *  rgb_buf) [protected]

Copy an RGB buffer to texture.

Parameters:
rgb_bufthe RGB buffer to copy, it must exactly of dimensions __width and __height.

Definition at line 138 of file texture_drawer.cpp.

References __texture, __height, __width, and __texture_width.

Referenced by SkelGuiDepthDrawer::fill_texture(), and SkelGuiImageDrawer::fill_texture().

void SkelGuiTextureDrawer::draw ( )

Draw texture to screen.

Definition at line 112 of file texture_drawer.cpp.

References fill_texture(), __texture_width, __texture_height, __texture, __width, and __height.

SkelGuiTextureDrawer::fill_texture ( ) [pure virtual]

Fill texture with data.

This function is called during draw() and the sub-class shall implement it to fill the texture with the data to show. Be aware that the texture size and the actually shown size will likely differ.

Implemented in SkelGuiDepthDrawer, and SkelGuiImageDrawer.

Referenced by draw().


Member Data Documentation

unsigned char* SkelGuiTextureDrawer::__texture [protected]

Texture buffer.

Definition at line 51 of file texture_drawer.h.

Referenced by SkelGuiTextureDrawer(), ~SkelGuiTextureDrawer(), draw(), and copy_rgb_to_texture().

const unsigned int SkelGuiTextureDrawer::__texture_height [protected]

Real texture height.

Definition at line 57 of file texture_drawer.h.

Referenced by SkelGuiTextureDrawer(), and draw().

const unsigned int SkelGuiTextureDrawer::__texture_width [protected]

Real texture width.

Definition at line 56 of file texture_drawer.h.

Referenced by SkelGuiTextureDrawer(), draw(), and copy_rgb_to_texture().


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