Fawkes API
Fawkes Development Version
|
23 #include "transfer_thread.h"
25 #include <core/threading/read_write_lock.h>
26 #include <fvcams/camera.h>
27 #include <fvutils/color/colorspaces.h>
33 using namespace firevision;
45 :
Thread(
"PclViewerTransferThread",
Thread::OPMODE_CONTINUOUS)
54 std::map<std::string, unsigned char *>::iterator c;
55 for (c = buffers_.begin(); c != buffers_.end(); ++c) {
94 std::map<std::string, firevision::Camera *>::iterator c;
95 for (c = cams_.begin(); c != cams_.end(); ++c) {
98 memcpy(buffers_[c->first], c->second->buffer(), buffer_sizes_[c->first]);
100 c->second->dispose_buffer();
void loop()
Code to execute in the thread.
virtual colorspace_t colorspace()=0
Colorspace of returned image.
const char * name() const
Get name of thread.
~PclViewerTransferThread()
Destructor.
void lock_for_read()
Aquire a reader lock.
Read/write lock to allow multiple readers but only a single writer on the resource at a time.
Fawkes library namespace.
virtual unsigned int pixel_height()=0
Height of image in pixels.
void lock_for_write()
Aquire a writer lock.
void unlock()
Release the lock.
virtual unsigned int pixel_width()=0
Width of image in pixels.
PclViewerTransferThread()
Constructor.
void lock_for_read()
Lock for reading.
Thread class encapsulation of pthreads.
Camera interface for image aquiring devices in FireVision.
void add_camera(std::string name, firevision::Camera *cam)
Add a camera from which to pull images.