Fawkes API  Fawkes Development Version
PclViewerTransferThread Class Reference

PCL viewer transfer thread. More...

#include "transfer_thread.h"

Inheritance diagram for PclViewerTransferThread:

List of all members.

Public Member Functions

 PclViewerTransferThread ()
 Constructor.
 ~PclViewerTransferThread ()
 Destructor.
void loop ()
 Code to execute in the thread.
void lock_for_read ()
 Lock for reading.
void unlock ()
 Unlock.
void add_camera (std::string name, firevision::Camera *cam)
 Add a camera from which to pull images.
const unsigned char * buffer (std::string name)
 Get buffer for specified camera.

Detailed Description

PCL viewer transfer thread.

Especially for transmission over slow Wifi networks tranmission must be pushed to its own thread. It captures the frame and copies it to an internal buffer to anytime use.

Author:
Tim Niemueller

Constructor & Destructor Documentation

PclViewerTransferThread::PclViewerTransferThread ( )

Constructor.

Definition at line 43 of file transfer_thread.cpp.

PclViewerTransferThread::~PclViewerTransferThread ( )

Destructor.

Definition at line 51 of file transfer_thread.cpp.


Member Function Documentation

void PclViewerTransferThread::add_camera ( std::string  name,
firevision::Camera cam 
)

Add a camera from which to pull images.

Parameters:
namesymbolic name, used to access buffers
camcamera to add

Definition at line 86 of file transfer_thread.cpp.

References fawkes::Thread::name(), firevision::Camera::colorspace(), firevision::Camera::pixel_width(), and firevision::Camera::pixel_height().

const unsigned char* PclViewerTransferThread::buffer ( std::string  name) [inline]

Get buffer for specified camera.

Parameters:
namethe name passed to add_camera.
Returns:
buffer that contains a copy of the image

Definition at line 52 of file transfer_thread.h.

References fawkes::Thread::name().

void PclViewerTransferThread::lock_for_read ( )

Lock for reading.

Images will not be updated while the lock is held. Any number of readers can hold a read lock at the same time. Make sure that the thread does not starve.

Definition at line 67 of file transfer_thread.cpp.

References fawkes::ReadWriteLock::lock_for_read().

void PclViewerTransferThread::loop ( ) [virtual]

Code to execute in the thread.

Implement this method to hold the code you want to be executed continously. If you do not implement this method, the default is that the thread will exit. This is useful if you choose to only implement once().

Reimplemented from fawkes::Thread.

Definition at line 98 of file transfer_thread.cpp.

References fawkes::ReadWriteLock::lock_for_write(), and fawkes::ReadWriteLock::unlock().

void PclViewerTransferThread::unlock ( )

Unlock.

Definition at line 75 of file transfer_thread.cpp.

References fawkes::ReadWriteLock::unlock().


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