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