Fawkes API  Fawkes Development Version
SkelGuiTextureDrawer Class Referenceabstract

Draw images from camera in texture. More...

#include "texture_drawer.h"

Inheritance diagram for SkelGuiTextureDrawer:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

const unsigned int width_
 Width of visible area from texture. More...
 
const unsigned int height_
 Height of visible area from texture. More...
 
const unsigned int texture_width_
 Real texture width. More...
 
const unsigned int texture_height_
 Real texture height. More...
 
unsigned char * texture_
 Texture buffer. More...
 

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

Definition at line 32 of file texture_drawer.h.

Constructor & Destructor Documentation

◆ SkelGuiTextureDrawer()

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

Constructor.

Parameters
widthwidth of visible area
heightheight of visible area

Definition at line 55 of file texture_drawer.cpp.

References texture_, texture_height_, and texture_width_.

◆ ~SkelGuiTextureDrawer()

SkelGuiTextureDrawer::~SkelGuiTextureDrawer ( )
virtual

Destructor.

Definition at line 69 of file texture_drawer.cpp.

Member Function Documentation

◆ copy_rgb_to_texture()

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 150 of file texture_drawer.cpp.

References height_, texture_, texture_width_, and width_.

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

◆ draw()

void SkelGuiTextureDrawer::draw ( )

Draw texture to screen.

Definition at line 116 of file texture_drawer.cpp.

References fill_texture(), height_, texture_, texture_height_, texture_width_, and width_.

◆ fill_texture()

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

◆ height_

const unsigned int SkelGuiTextureDrawer::height_
protected

◆ texture_

unsigned char* SkelGuiTextureDrawer::texture_
protected

Texture buffer.

Definition at line 58 of file texture_drawer.h.

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

◆ texture_height_

const unsigned int SkelGuiTextureDrawer::texture_height_
protected

Real texture height.

Definition at line 56 of file texture_drawer.h.

Referenced by draw(), and SkelGuiTextureDrawer().

◆ texture_width_

const unsigned int SkelGuiTextureDrawer::texture_width_
protected

Real texture width.

Definition at line 55 of file texture_drawer.h.

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

◆ width_

const unsigned int SkelGuiTextureDrawer::width_
protected

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