YARP
Yet Another Robot Platform
RemoteFrameGrabber.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_DEV_REMOTEFRAMEGRABBER_H
11 #define YARP_DEV_REMOTEFRAMEGRABBER_H
12 
13 #include <cstring> // for memcpy
14 
15 #include <yarp/os/Network.h>
16 #include <yarp/os/LogComponent.h>
17 #include <yarp/os/LogStream.h>
20 #include <yarp/dev/GenericVocabs.h>
21 
22 #include <mutex>
23 
25 
27  public yarp::dev::IFrameGrabberControlsDC1394
28 {
29 private:
30  yarp::os::Port* _port{nullptr};
31 
32 public:
33  void init(yarp::os::Port *__port)
34  {
35  _port = __port;
36  }
37 
38 private:
39  bool setCommand(int code, double v)
40  {
41  yarp::os::Bottle cmd, response;
43  cmd.addVocab(VOCAB_SET);
44  cmd.addVocab(code);
45  cmd.addFloat64(v);
46  _port->write(cmd,response);
47  return true;
48  }
49 
50  bool setCommand(int code, double b, double r)
51  {
52  yarp::os::Bottle cmd, response;
54  cmd.addVocab(VOCAB_SET);
55  cmd.addVocab(code);
56  cmd.addFloat64(b);
57  cmd.addFloat64(r);
58  _port->write(cmd,response);
59  return true;
60  }
61 
62  double getCommand(int code) const
63  {
64  yarp::os::Bottle cmd, response;
66  cmd.addVocab(VOCAB_GET);
67  cmd.addVocab(code);
68  _port->write(cmd,response);
69  // response should be [cmd] [name] value
70  return response.get(2).asFloat64();
71  }
72 
73  bool getCommand(int code, double &b, double &r) const
74  {
75  yarp::os::Bottle cmd, response;
77  cmd.addVocab(VOCAB_GET);
78  cmd.addVocab(code);
79  _port->write(cmd,response);
80  // response should be [cmd] [name] value
81  b=response.get(2).asFloat64();
82  r=response.get(3).asFloat64();
83  return true;
84  }
85 
86 public:
87 
88  // 12
89  unsigned int getVideoModeMaskDC1394() override
90  {
91  yarp::os::Bottle cmd, response;
94  _port->write(cmd,response);
95 
96  // I'll bite your sweet little fingers ^__^
97  return (unsigned)response.get(0).asInt32();
98  //return response.get(0).asInt32()!=0? true:false;
99  }
100  // 13
101  unsigned int getVideoModeDC1394() override
102  {
103  yarp::os::Bottle cmd, response;
106  _port->write(cmd,response);
107 
108  // I'll bite your sweet little fingers ^__^
109  return (unsigned)response.get(0).asInt32();
110  //return response.get(0).asInt32()!=0? true:false;
111  }
112  // 14
113  bool setVideoModeDC1394(int video_mode) override
114  {
115  yarp::os::Bottle cmd, response;
118  cmd.addInt32(video_mode);
119  _port->write(cmd,response);
120  return response.get(0).asInt32()!=0? true:false;
121  }
122 
123  // 15
124  unsigned int getFPSMaskDC1394() override
125  {
126  yarp::os::Bottle cmd, response;
129  _port->write(cmd,response);
130 
131  // I'll bite your sweet little fingers ^__^
132  return (unsigned)response.get(0).asInt32();
133  //return response.get(0).asInt32()!=0? true:false;
134  }
135  // 16
136  unsigned int getFPSDC1394() override
137  {
138  yarp::os::Bottle cmd, response;
141  _port->write(cmd,response);
142 
143  // I'll bite your sweet little fingers ^__^
144  return (unsigned)response.get(0).asInt32();
145  //return response.get(0).asInt32()!=0? true:false;
146  }
147  // 17
148  bool setFPSDC1394(int fps) override
149  {
150  yarp::os::Bottle cmd, response;
153  cmd.addInt32(fps);
154  _port->write(cmd,response);
155  return response.get(0).asInt32()!=0? true:false;
156  }
157 
158  // 18
159  unsigned int getISOSpeedDC1394() override
160  {
161  yarp::os::Bottle cmd, response;
164  _port->write(cmd,response);
165 
166  // I'll bite your sweet little fingers ^__^
167  return (unsigned)response.get(0).asInt32();
168  //return response.get(0).asInt32()!=0? true:false;
169  }
170  // 19
171  bool setISOSpeedDC1394(int speed) override
172  {
173  yarp::os::Bottle cmd, response;
176  cmd.addInt32(speed);
177  _port->write(cmd,response);
178  return response.get(0).asInt32()!=0? true:false;
179  }
180 
181  // 20
182  unsigned int getColorCodingMaskDC1394(unsigned int video_mode) override
183  {
184  yarp::os::Bottle cmd, response;
187  cmd.addInt32(video_mode);
188  _port->write(cmd,response);
189 
190  // I'll bite your sweet little fingers ^__^
191  return (unsigned)response.get(0).asInt32();
192  //return response.get(0).asInt32()!=0? true:false;
193  }
194  // 21
195  unsigned int getColorCodingDC1394() override
196  {
197  yarp::os::Bottle cmd, response;
200  _port->write(cmd,response);
201 
202  // I'll bite your sweet little fingers ^__^
203  return (unsigned)response.get(0).asInt32();
204  //return response.get(0).asInt32()!=0? true:false;
205  }
206  // 22
207  bool setColorCodingDC1394(int coding) override
208  {
209  yarp::os::Bottle cmd, response;
212  cmd.addInt32(coding);
213  _port->write(cmd,response);
214  return response.get(0).asInt32()!=0? true:false;
215  }
216 
217  bool getFormat7MaxWindowDC1394(unsigned int &xdim,unsigned int &ydim,unsigned int &xstep,unsigned int &ystep,unsigned int &xoffstep,unsigned int &yoffstep) override
218  {
219  yarp::os::Bottle cmd, response;
222  _port->write(cmd,response);
223 
224  xdim=response.get(0).asInt32();
225  ydim=response.get(1).asInt32();
226  xstep=response.get(2).asInt32();
227  ystep=response.get(3).asInt32();
228  xoffstep=response.get(4).asInt32();
229  yoffstep=response.get(5).asInt32();
230  return response.get(0).asInt32()!=0? true:false;
231  }
232  // 26
233  bool getFormat7WindowDC1394(unsigned int &xdim,unsigned int &ydim,int &x0,int &y0) override
234  {
235  yarp::os::Bottle cmd, response;
238  _port->write(cmd,response);
239  xdim=response.get(0).asInt32();
240  ydim=response.get(1).asInt32();
241  x0=response.get(2).asInt32();
242  y0=response.get(3).asInt32();
243  return response.get(0).asInt32()!=0? true:false;
244  }
245  // 27
246  bool setFormat7WindowDC1394(unsigned int xdim,unsigned int ydim,int x0,int y0) override
247  {
248  yarp::os::Bottle cmd, response;
251  cmd.addInt32(xdim);
252  cmd.addInt32(ydim);
253  cmd.addInt32(x0);
254  cmd.addInt32(y0);
255  _port->write(cmd,response);
256  return response.get(0).asInt32()!=0? true:false;
257  }
258 
259  // 28
260  bool setOperationModeDC1394(bool b1394b) override
261  {
262  yarp::os::Bottle cmd, response;
265  cmd.addInt32(int(b1394b));
266  _port->write(cmd,response);
267  return response.get(0).asInt32()!=0? true:false;
268  }
269  // 29
270  bool getOperationModeDC1394() override
271  {
272  yarp::os::Bottle cmd, response;
275  _port->write(cmd,response);
276  return response.get(0).asInt32()!=0? true:false;
277  }
278 
279  // 30
280  bool setTransmissionDC1394(bool bTxON) override
281  {
282  yarp::os::Bottle cmd, response;
285  cmd.addInt32(int(bTxON));
286  _port->write(cmd,response);
287  return response.get(0).asInt32()!=0? true:false;
288  }
289  // 31
290  bool getTransmissionDC1394() override
291  {
292  yarp::os::Bottle cmd, response;
295  _port->write(cmd,response);
296  return response.get(0).asInt32()!=0? true:false;
297  }
298 
299  // 34
300  bool setBroadcastDC1394(bool onoff) override
301  {
302  yarp::os::Bottle cmd, response;
305  cmd.addInt32((int)onoff);
306  _port->write(cmd,response);
307  return response.get(0).asInt32()!=0? true:false;
308  }
309  // 35
310  bool setDefaultsDC1394() override
311  {
312  yarp::os::Bottle cmd, response;
315  _port->write(cmd,response);
316  return response.get(0).asInt32()!=0? true:false;
317  }
318  // 36
319  bool setResetDC1394() override
320  {
321  yarp::os::Bottle cmd, response;
324  _port->write(cmd,response);
325  return response.get(0).asInt32()!=0? true:false;
326  }
327  // 37
328  bool setPowerDC1394(bool onoff) override
329  {
330  yarp::os::Bottle cmd, response;
333  cmd.addInt32((int)onoff);
334  _port->write(cmd,response);
335  return response.get(0).asInt32()!=0? true:false;
336  }
337 
338  // 38
339  bool setCaptureDC1394(bool bON) override
340  {
341  yarp::os::Bottle cmd, response;
344  cmd.addInt32(int(bON));
345  _port->write(cmd,response);
346  return response.get(0).asInt32()!=0? true:false;
347  }
348 
349  // 39
350  bool setBytesPerPacketDC1394(unsigned int bpp) override
351  {
352  yarp::os::Bottle cmd, response;
355  cmd.addInt32(int(bpp));
356  _port->write(cmd,response);
357  return response.get(0).asInt32()!=0? true:false;
358  }
359 
360  // 40
361  unsigned int getBytesPerPacketDC1394() override
362  {
363  yarp::os::Bottle cmd, response;
366  _port->write(cmd,response);
367  return (unsigned)response.get(0).asInt32();
368  }
369 };
370 
382  public ImplementDC1394,
385 {
386 public:
392  ~RemoteFrameGrabber() override = default;
393 
394 
396  {
397  mutex.lock();
398  if(no_stream == true)
399  {
400  image.zero();
401  mutex.unlock();
402  return false;
403  }
404 
405  if (reader.read(true)!=NULL) {
406  image = *(reader.lastRead());
407  lastHeight = image.height();
408  lastWidth = image.width();
409  mutex.unlock();
410  return true;
411  }
412  mutex.unlock();
413  return false;
414  }
415 
416  bool getImageCrop(cropType_id_t cropType, yarp::sig::VectorOf<std::pair<int, int> > vertices, yarp::sig::ImageOf<yarp::sig::PixelRgb>& image) override
417  {
418  yarp::os::Bottle cmd, response;
420  cmd.addVocab(VOCAB_GET);
421  cmd.addVocab(VOCAB_CROP);
422  cmd.addInt32(cropType);
423  yarp::os::Bottle & list = cmd.addList();
424  for(size_t i=0; i<vertices.size(); i++)
425  {
426  list.addInt32(vertices[i].first);
427  list.addInt32(vertices[i].second);
428  }
429  port.write(cmd,response);
430 
431  // Parse the response
432  image.zero();
433  if( (response.get(0).asVocab() != VOCAB_CROP) || (response.size() != 5) || (!response.get(4).isBlob()))
434  {
435  yCError(REMOTEFRAMEGRABBER) << "getImageCrop: malformed response message. Size is " << response.size();
436  return false;
437  }
438 
439  image.resize(response.get(2).asInt32(), response.get(3).asInt32());
440  unsigned char *pixelOut = image.getRawImage();
441 
442  if(response.get(4).asBlob())
443  memcpy(pixelOut, response.get(4).asBlob(), (size_t) image.getRawImageSize());
444 
445  return true;
446  }
447 
448  // this is bad!
449  int height() const override
450  {
451  return lastHeight;
452  }
453 
454  int width() const override
455  {
456  return lastWidth;
457  }
458 
469  bool open(yarp::os::Searchable& config) override
470  {
472  yCDebug(REMOTEFRAMEGRABBER) << "config is " << config.toString();
473 
474  remote = config.check("remote",yarp::os::Value(""),
475  "port name of real grabber").asString();
476  local = config.check("local",yarp::os::Value("..."),
477  "port name to use locally").asString();
478  std::string carrier =
479  config.check("stream",yarp::os::Value("tcp"),
480  "carrier to use for streaming").asString();
481  port.open(local);
482  if (remote!="") {
483  yCInfo(REMOTEFRAMEGRABBER) << "connecting " << local << " to " << remote;
484 
485  if(!config.check("no_stream") )
486  {
487  no_stream = false;
488  if(!yarp::os::Network::connect(remote,local,carrier))
489  yCError(REMOTEFRAMEGRABBER) << "cannot connect " << local << " to " << remote;
490  }
491  else
492  no_stream = true;
493 
494  // reverse connection for RPC
495  // could choose to do this only on need
496 
497  yarp::os::Network::connect(local,remote);
498  }
499  reader.attach(port);
500  ImplementDC1394::init(&port);
501  return true;
502  }
503 
504  bool close() override
505  {
506  port.close();
507 // mutex.lock(); // why does it need this?
508  return true;
509  }
510 
511 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
512  bool setBrightness(double v) override
513  {
514  return setCommand(VOCAB_BRIGHTNESS, v);
515  }
516  double getBrightness() override
517  {
519  }
520  bool setExposure(double v) override
521  {
522  return setCommand(VOCAB_EXPOSURE, v);
523  }
524  double getExposure() override
525  {
526  return getCommand(VOCAB_EXPOSURE);
527  }
528 
529  bool setSharpness(double v) override
530  {
531  return setCommand(VOCAB_SHARPNESS, v);
532  }
533  double getSharpness() override
534  {
535  return getCommand(VOCAB_SHARPNESS);
536  }
537 
538  bool setWhiteBalance(double blue, double red) override
539  {
540  return setCommand(VOCAB_WHITE, blue, red);
541  }
542  bool getWhiteBalance(double &blue, double &red) override
543  {
544  return getCommand(VOCAB_WHITE, blue, red);
545  }
546 
547  bool setHue(double v) override
548  {
549  return setCommand(VOCAB_HUE,v);
550  }
551  double getHue() override
552  {
553  return getCommand(VOCAB_HUE);
554  }
555 
556  bool setSaturation(double v) override
557  {
558  return setCommand(VOCAB_SATURATION,v);
559  }
560  double getSaturation() override
561  {
563  }
564 
565  bool setGamma(double v) override
566  {
567  return setCommand(VOCAB_GAMMA,v);
568  }
569  double getGamma() override
570  {
571  return getCommand(VOCAB_GAMMA);
572  }
573 
574  bool setShutter(double v) override
575  {
576  return setCommand(VOCAB_SHUTTER,v);
577  }
578  double getShutter() override
579  {
580  return getCommand(VOCAB_SHUTTER);
581  }
582 
583  bool setGain(double v) override
584  {
585  return setCommand(VOCAB_GAIN,v);
586  }
587  double getGain() override
588  {
589  return getCommand(VOCAB_GAIN);
590  }
591 
592  bool setIris(double v) override
593  {
594  return setCommand(VOCAB_IRIS,v);
595  }
596  double getIris() override
597  {
598  return getCommand(VOCAB_IRIS);
599  }
600 #endif
601 
602 private:
604  yarp::os::Port port;
605  std::string remote;
606  std::string local;
607  std::mutex mutex;
608  int lastHeight{0};
609  int lastWidth{0};
610  bool no_stream{false};
611 
612 protected:
613 
614  IFrameGrabberControlsDC1394 *Ifirewire{nullptr};
615 
616  bool setCommand(int code, double v)
617  {
618  yarp::os::Bottle cmd, response;
620  cmd.addVocab(VOCAB_SET);
621  cmd.addVocab(code);
622  cmd.addFloat64(v);
623  port.write(cmd,response);
624  return true;
625  }
626 
627  bool setCommand(int code, double b, double r)
628  {
629  yarp::os::Bottle cmd, response;
631  cmd.addVocab(VOCAB_SET);
632  cmd.addVocab(code);
633  cmd.addFloat64(b);
634  cmd.addFloat64(r);
635  port.write(cmd,response);
636  return true;
637  }
638 
639  double getCommand(int code) const {
640  yarp::os::Bottle cmd, response;
642  cmd.addVocab(VOCAB_GET);
643  cmd.addVocab(code);
644  port.write(cmd,response);
645  // response should be [cmd] [name] value
646  return response.get(2).asFloat64();
647  }
648 
649  bool getCommand(int code, double &b, double &r) const
650  {
651  yarp::os::Bottle cmd, response;
653  cmd.addVocab(VOCAB_GET);
654  cmd.addVocab(code);
655  port.write(cmd,response);
656  // response should be [cmd] [name] value
657  b=response.get(2).asFloat64();
658  r=response.get(3).asFloat64();
659  return true;
660  }
661 };
662 
663 #endif // YARP_DEV_REMOTEFRAMEGRABBER_H
yarp::os::Port::close
void close() override
Stop port activity.
Definition: Port.cpp:357
LogStream.h
VOCAB_DRSETCOD
constexpr yarp::conf::vocab32_t VOCAB_DRSETCOD
Definition: FrameGrabberInterfaces.h:140
VOCAB_DRSETISO
constexpr yarp::conf::vocab32_t VOCAB_DRSETISO
Definition: FrameGrabberInterfaces.h:137
RemoteFrameGrabber::setHue
bool setHue(double v) override
Set the hue.
Definition: RemoteFrameGrabber.h:547
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::os::Value::asVocab
virtual std::int32_t asVocab() const
Get vocabulary identifier as an integer.
Definition: Value.cpp:231
ImplementDC1394::setTransmissionDC1394
bool setTransmissionDC1394(bool bTxON) override
Definition: RemoteFrameGrabber.h:280
RemoteFrameGrabber::setGamma
bool setGamma(double v) override
Set the gamma.
Definition: RemoteFrameGrabber.h:565
yarp::dev::FrameGrabberControls_Sender
This classes implement a sender / parser for IFrameGrabberControls interface messages.
Definition: FrameGrabberControlImpl.h:33
VOCAB_GAMMA
constexpr yarp::conf::vocab32_t VOCAB_GAMMA
Definition: FrameGrabberInterfaces.h:56
YARP_DECLARE_LOG_COMPONENT
#define YARP_DECLARE_LOG_COMPONENT(name)
Definition: LogComponent.h:77
VOCAB_DRGETISO
constexpr yarp::conf::vocab32_t VOCAB_DRGETISO
Definition: FrameGrabberInterfaces.h:136
Network.h
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
ImplementDC1394::setFormat7WindowDC1394
bool setFormat7WindowDC1394(unsigned int xdim, unsigned int ydim, int x0, int y0) override
Definition: RemoteFrameGrabber.h:246
VOCAB_DRSETPWR
constexpr yarp::conf::vocab32_t VOCAB_DRSETPWR
Definition: FrameGrabberInterfaces.h:155
ImplementDC1394::getOperationModeDC1394
bool getOperationModeDC1394() override
Definition: RemoteFrameGrabber.h:270
yarp::os::Bottle::size
size_type size() const
Gets the number of elements in the bottle.
Definition: Bottle.cpp:254
RemoteFrameGrabber::~RemoteFrameGrabber
~RemoteFrameGrabber() override=default
VOCAB_DRGETCCM
constexpr yarp::conf::vocab32_t VOCAB_DRGETCCM
Definition: FrameGrabberInterfaces.h:138
RemoteFrameGrabber::close
bool close() override
Close the DeviceDriver.
Definition: RemoteFrameGrabber.h:504
RemoteFrameGrabber::getExposure
double getExposure() override
Read the exposure parameter.
Definition: RemoteFrameGrabber.h:524
VOCAB_FRAMEGRABBER_IMAGE
constexpr yarp::conf::vocab32_t VOCAB_FRAMEGRABBER_IMAGE
Definition: FrameGrabberInterfaces.h:43
yarp::os::Value::asBlob
virtual const char * asBlob() const
Get binary data value.
Definition: Value.cpp:264
RemoteFrameGrabber::setWhiteBalance
bool setWhiteBalance(double blue, double red) override
Set the white balance for the frame grabber.
Definition: RemoteFrameGrabber.h:538
RemoteFrameGrabber::getHue
double getHue() override
Read the hue parameter.
Definition: RemoteFrameGrabber.h:551
VOCAB_FRAMEGRABBER_CONTROL
constexpr yarp::conf::vocab32_t VOCAB_FRAMEGRABBER_CONTROL
Definition: FrameGrabberInterfaces.h:63
ImplementDC1394::getTransmissionDC1394
bool getTransmissionDC1394() override
Definition: RemoteFrameGrabber.h:290
yarp::os::Searchable::toString
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
VOCAB_DRSETBPP
constexpr yarp::conf::vocab32_t VOCAB_DRSETBPP
Definition: FrameGrabberInterfaces.h:157
RemoteFrameGrabber::getCommand
bool getCommand(int code, double &b, double &r) const
Definition: RemoteFrameGrabber.h:649
ImplementDC1394::setPowerDC1394
bool setPowerDC1394(bool onoff) override
Definition: RemoteFrameGrabber.h:328
ImplementDC1394::setBroadcastDC1394
bool setBroadcastDC1394(bool onoff) override
Definition: RemoteFrameGrabber.h:300
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
VOCAB_BRIGHTNESS
constexpr yarp::conf::vocab32_t VOCAB_BRIGHTNESS
Definition: FrameGrabberInterfaces.h:50
ImplementDC1394::setVideoModeDC1394
bool setVideoModeDC1394(int video_mode) override
Definition: RemoteFrameGrabber.h:113
VOCAB_GET
constexpr yarp::conf::vocab32_t VOCAB_GET
Definition: GenericVocabs.h:16
VOCAB_DRSETTXM
constexpr yarp::conf::vocab32_t VOCAB_DRSETTXM
Definition: FrameGrabberInterfaces.h:148
ImplementDC1394::setCaptureDC1394
bool setCaptureDC1394(bool bON) override
Definition: RemoteFrameGrabber.h:339
VOCAB_DRGETOPM
constexpr yarp::conf::vocab32_t VOCAB_DRGETOPM
Definition: FrameGrabberInterfaces.h:147
VOCAB_DRGETVMD
constexpr yarp::conf::vocab32_t VOCAB_DRGETVMD
Definition: FrameGrabberInterfaces.h:131
yarp::os::PortReaderBuffer
Buffer incoming data to a port.
Definition: PortReaderBuffer.h:43
ImplementDC1394::getColorCodingMaskDC1394
unsigned int getColorCodingMaskDC1394(unsigned int video_mode) override
Definition: RemoteFrameGrabber.h:182
RemoteFrameGrabber::setExposure
bool setExposure(double v) override
Set the exposure.
Definition: RemoteFrameGrabber.h:520
VOCAB_DRSETVMD
constexpr yarp::conf::vocab32_t VOCAB_DRSETVMD
Definition: FrameGrabberInterfaces.h:132
ImplementDC1394::getColorCodingDC1394
unsigned int getColorCodingDC1394() override
Definition: RemoteFrameGrabber.h:195
yarp::os::Port::open
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
Definition: Port.cpp:82
VOCAB_DRSETCAP
constexpr yarp::conf::vocab32_t VOCAB_DRSETCAP
Definition: FrameGrabberInterfaces.h:156
yarp::os::PortReaderBuffer::attach
void attach(Port &port)
Attach this buffer to a particular port.
Definition: PortReaderBuffer-inl.h:119
RemoteFrameGrabber::setBrightness
bool setBrightness(double v) override
Set the brightness.
Definition: RemoteFrameGrabber.h:512
RemoteFrameGrabber::setSaturation
bool setSaturation(double v) override
Set the saturation.
Definition: RemoteFrameGrabber.h:556
yarp::os::Bottle::addFloat64
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
Definition: Bottle.cpp:161
RemoteFrameGrabber::operator=
RemoteFrameGrabber & operator=(const RemoteFrameGrabber &)=delete
FrameGrabberControlImpl.h
RemoteFrameGrabber::setIris
bool setIris(double v) override
Set the iris.
Definition: RemoteFrameGrabber.h:592
VOCAB_SHARPNESS
constexpr yarp::conf::vocab32_t VOCAB_SHARPNESS
Definition: FrameGrabberInterfaces.h:52
VOCAB_DRGETFPM
constexpr yarp::conf::vocab32_t VOCAB_DRGETFPM
Definition: FrameGrabberInterfaces.h:133
ImplementDC1394::init
void init(yarp::os::Port *__port)
Definition: RemoteFrameGrabber.h:33
ImplementDC1394::setResetDC1394
bool setResetDC1394() override
Definition: RemoteFrameGrabber.h:319
yarp::sig::ImageOf< yarp::sig::PixelRgb >
yarp::sig::VectorOf
Provides:
Definition: Vector.h:122
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
VOCAB_DRGETWF7
constexpr yarp::conf::vocab32_t VOCAB_DRGETWF7
Definition: FrameGrabberInterfaces.h:144
yarp::dev::Implement_RgbVisualParams_Sender
Definition: IVisualParamsImpl.h:32
RemoteFrameGrabber::getWhiteBalance
bool getWhiteBalance(double &blue, double &red) override
Read the white balance parameters.
Definition: RemoteFrameGrabber.h:542
VOCAB_WHITE
constexpr yarp::conf::vocab32_t VOCAB_WHITE
Definition: FrameGrabberInterfaces.h:53
RemoteFrameGrabber::operator=
RemoteFrameGrabber & operator=(RemoteFrameGrabber &&)=delete
VOCAB_SET
constexpr yarp::conf::vocab32_t VOCAB_SET
Definition: GenericVocabs.h:15
RemoteFrameGrabber::getImageCrop
bool getImageCrop(cropType_id_t cropType, yarp::sig::VectorOf< std::pair< int, int > > vertices, yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
Get a crop of the rgb image from the frame grabber, if required demosaicking/color reconstruction is ...
Definition: RemoteFrameGrabber.h:416
IVisualParamsImpl.h
ImplementDC1394
Definition: RemoteFrameGrabber.h:28
yarp::os::Bottle::get
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Definition: Bottle.cpp:249
ImplementDC1394::getFPSMaskDC1394
unsigned int getFPSMaskDC1394() override
Definition: RemoteFrameGrabber.h:124
yarp::os::Value::isBlob
virtual bool isBlob() const
Checks if value is a binary object.
Definition: Value.cpp:183
yarp::os::Bottle::addList
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
Definition: Bottle.cpp:185
yarp::dev::IFrameGrabberImage
Read a YARP-format image from a device.
Definition: FrameGrabberInterfaces.h:241
RemoteFrameGrabber::getImage
bool getImage(yarp::sig::ImageOf< yarp::sig::PixelRgb > &image) override
Get an rgb image from the frame grabber, if required demosaicking/color reconstruction is applied.
Definition: RemoteFrameGrabber.h:395
VOCAB_SATURATION
constexpr yarp::conf::vocab32_t VOCAB_SATURATION
Definition: FrameGrabberInterfaces.h:55
RemoteFrameGrabber::height
int height() const override
Return the height of each frame.
Definition: RemoteFrameGrabber.h:449
yarp::os::PortReaderBuffer::lastRead
T * lastRead() override
Get the last data returned by read()
Definition: PortReaderBuffer-inl.h:113
yarp::os::NetworkBase::connect
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
Definition: Network.cpp:685
VOCAB_IRIS
constexpr yarp::conf::vocab32_t VOCAB_IRIS
Definition: FrameGrabberInterfaces.h:59
VOCAB_DRGETCOD
constexpr yarp::conf::vocab32_t VOCAB_DRGETCOD
Definition: FrameGrabberInterfaces.h:139
VOCAB_SHUTTER
constexpr yarp::conf::vocab32_t VOCAB_SHUTTER
Definition: FrameGrabberInterfaces.h:57
ImplementDC1394::setFPSDC1394
bool setFPSDC1394(int fps) override
Definition: RemoteFrameGrabber.h:148
RemoteFrameGrabber::setCommand
bool setCommand(int code, double b, double r)
Definition: RemoteFrameGrabber.h:627
VOCAB_EXPOSURE
constexpr yarp::conf::vocab32_t VOCAB_EXPOSURE
Definition: FrameGrabberInterfaces.h:51
RemoteFrameGrabber::width
int width() const override
Return the width of each frame.
Definition: RemoteFrameGrabber.h:454
VOCAB_DRSETFPS
constexpr yarp::conf::vocab32_t VOCAB_DRSETFPS
Definition: FrameGrabberInterfaces.h:135
yarp::os::Searchable::check
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
ImplementDC1394::setColorCodingDC1394
bool setColorCodingDC1394(int coding) override
Definition: RemoteFrameGrabber.h:207
RemoteFrameGrabber::setShutter
bool setShutter(double v) override
Set the shutter parameter.
Definition: RemoteFrameGrabber.h:574
RemoteFrameGrabber::getBrightness
double getBrightness() override
Read the brightness parameter.
Definition: RemoteFrameGrabber.h:516
VOCAB_DRGETFPS
constexpr yarp::conf::vocab32_t VOCAB_DRGETFPS
Definition: FrameGrabberInterfaces.h:134
RemoteFrameGrabber::getGamma
double getGamma() override
Read the gamma parameter.
Definition: RemoteFrameGrabber.h:569
yarp::os::Bottle::addInt32
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
Definition: Bottle.cpp:143
ImplementDC1394::getVideoModeMaskDC1394
unsigned int getVideoModeMaskDC1394() override
Definition: RemoteFrameGrabber.h:89
VOCAB_DRSETOPM
constexpr yarp::conf::vocab32_t VOCAB_DRSETOPM
Definition: FrameGrabberInterfaces.h:146
ImplementDC1394::getBytesPerPacketDC1394
unsigned int getBytesPerPacketDC1394() override
Definition: RemoteFrameGrabber.h:361
RemoteFrameGrabber::getSaturation
double getSaturation() override
Read the saturation parameter.
Definition: RemoteFrameGrabber.h:560
ImplementDC1394::setBytesPerPacketDC1394
bool setBytesPerPacketDC1394(unsigned int bpp) override
Definition: RemoteFrameGrabber.h:350
ImplementDC1394::setOperationModeDC1394
bool setOperationModeDC1394(bool b1394b) override
Definition: RemoteFrameGrabber.h:260
RemoteFrameGrabber::getSharpness
double getSharpness() override
Read the sharpness parameter.
Definition: RemoteFrameGrabber.h:533
ImplementDC1394::setISOSpeedDC1394
bool setISOSpeedDC1394(int speed) override
Definition: RemoteFrameGrabber.h:171
VOCAB_DRGETMSK
constexpr yarp::conf::vocab32_t VOCAB_DRGETMSK
Definition: FrameGrabberInterfaces.h:130
cropType_id_t
cropType_id_t
Definition: FrameGrabberInterfaces.h:77
VOCAB_DRGETTXM
constexpr yarp::conf::vocab32_t VOCAB_DRGETTXM
Definition: FrameGrabberInterfaces.h:149
RemoteFrameGrabber::Ifirewire
IFrameGrabberControlsDC1394 * Ifirewire
Definition: RemoteFrameGrabber.h:614
yarp::os::Bottle::addVocab
void addVocab(int x)
Places a vocabulary item in the bottle, at the end of the list.
Definition: Bottle.cpp:167
LogComponent.h
yarp::os::PortReaderBuffer::read
T * read(bool shouldWait=true) override
Read an available object from the port.
Definition: PortReaderBuffer-inl.h:72
ImplementDC1394::getFormat7WindowDC1394
bool getFormat7WindowDC1394(unsigned int &xdim, unsigned int &ydim, int &x0, int &y0) override
Definition: RemoteFrameGrabber.h:233
RemoteFrameGrabber::getGain
double getGain() override
Read the gain parameter.
Definition: RemoteFrameGrabber.h:587
ImplementDC1394::getISOSpeedDC1394
unsigned int getISOSpeedDC1394() override
Definition: RemoteFrameGrabber.h:159
RemoteFrameGrabber
remote_grabber: Connect to a ServerFrameGrabber. See ServerFrameGrabber for the network protocol used...
Definition: RemoteFrameGrabber.h:385
VOCAB_DRGETF7M
constexpr yarp::conf::vocab32_t VOCAB_DRGETF7M
Definition: FrameGrabberInterfaces.h:143
RemoteFrameGrabber::getShutter
double getShutter() override
Read the shutter parameter.
Definition: RemoteFrameGrabber.h:578
yCError
#define yCError(component,...)
Definition: LogComponent.h:157
VOCAB_DRSETDEF
constexpr yarp::conf::vocab32_t VOCAB_DRSETDEF
Definition: FrameGrabberInterfaces.h:153
yarp::os::Value::asInt32
virtual std::int32_t asInt32() const
Get 32-bit integer value.
Definition: Value.cpp:207
RemoteFrameGrabber::RemoteFrameGrabber
RemoteFrameGrabber(const RemoteFrameGrabber &)=delete
yarp::os::Port::write
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
Definition: Port.cpp:430
VOCAB_DRSETBCS
constexpr yarp::conf::vocab32_t VOCAB_DRSETBCS
Definition: FrameGrabberInterfaces.h:152
RemoteFrameGrabber::getIris
double getIris() override
Read the iris parameter.
Definition: RemoteFrameGrabber.h:596
yCInfo
#define yCInfo(component,...)
Definition: LogComponent.h:135
yCDebug
#define yCDebug(component,...)
Definition: LogComponent.h:112
VOCAB_CROP
constexpr yarp::conf::vocab32_t VOCAB_CROP
Definition: FrameGrabberInterfaces.h:62
ImplementDC1394::getFPSDC1394
unsigned int getFPSDC1394() override
Definition: RemoteFrameGrabber.h:136
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
RemoteFrameGrabber::RemoteFrameGrabber
RemoteFrameGrabber()
Definition: RemoteFrameGrabber.cpp:18
VOCAB_DRGETBPP
constexpr yarp::conf::vocab32_t VOCAB_DRGETBPP
Definition: FrameGrabberInterfaces.h:158
RemoteFrameGrabber::setGain
bool setGain(double v) override
Set the gain.
Definition: RemoteFrameGrabber.h:583
RemoteFrameGrabber::getCommand
double getCommand(int code) const
Definition: RemoteFrameGrabber.h:639
RemoteFrameGrabber::RemoteFrameGrabber
RemoteFrameGrabber(RemoteFrameGrabber &&)=delete
VOCAB_DRSETWF7
constexpr yarp::conf::vocab32_t VOCAB_DRSETWF7
Definition: FrameGrabberInterfaces.h:145
yCTrace
#define yCTrace(component,...)
Definition: LogComponent.h:88
VOCAB_HUE
constexpr yarp::conf::vocab32_t VOCAB_HUE
Definition: FrameGrabberInterfaces.h:54
ImplementDC1394::getVideoModeDC1394
unsigned int getVideoModeDC1394() override
Definition: RemoteFrameGrabber.h:101
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
GenericVocabs.h
ImplementDC1394::getFormat7MaxWindowDC1394
bool getFormat7MaxWindowDC1394(unsigned int &xdim, unsigned int &ydim, unsigned int &xstep, unsigned int &ystep, unsigned int &xoffstep, unsigned int &yoffstep) override
Definition: RemoteFrameGrabber.h:217
yarp::os::Value::asFloat64
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
Definition: Value.cpp:225
VOCAB_DRSETRST
constexpr yarp::conf::vocab32_t VOCAB_DRSETRST
Definition: FrameGrabberInterfaces.h:154
RemoteFrameGrabber::setSharpness
bool setSharpness(double v) override
Set the sharpness.
Definition: RemoteFrameGrabber.h:529
REMOTEFRAMEGRABBER
const yarp::os::LogComponent & REMOTEFRAMEGRABBER()
Definition: RemoteFrameGrabber.cpp:16
VOCAB_FRAMEGRABBER_CONTROL_DC1394
constexpr yarp::conf::vocab32_t VOCAB_FRAMEGRABBER_CONTROL_DC1394
Definition: FrameGrabberInterfaces.h:64
RemoteFrameGrabber::setCommand
bool setCommand(int code, double v)
Definition: RemoteFrameGrabber.h:616
ImplementDC1394::setDefaultsDC1394
bool setDefaultsDC1394() override
Definition: RemoteFrameGrabber.h:310
RemoteFrameGrabber::open
bool open(yarp::os::Searchable &config) override
Configure with a set of options.
Definition: RemoteFrameGrabber.h:469
VOCAB_GAIN
constexpr yarp::conf::vocab32_t VOCAB_GAIN
Definition: FrameGrabberInterfaces.h:58