|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_DEV_REMOTEFRAMEGRABBER_H
11 #define YARP_DEV_REMOTEFRAMEGRABBER_H
27 public
yarp::dev::IFrameGrabberControlsDC1394
39 bool setCommand(
int code,
double v)
46 _port->write(cmd,response);
50 bool setCommand(
int code,
double b,
double r)
58 _port->write(cmd,response);
62 double getCommand(
int code)
const
68 _port->write(cmd,response);
73 bool getCommand(
int code,
double &b,
double &r)
const
79 _port->write(cmd,response);
94 _port->write(cmd,response);
106 _port->write(cmd,response);
119 _port->write(cmd,response);
120 return response.
get(0).
asInt32()!=0?
true:
false;
129 _port->write(cmd,response);
141 _port->write(cmd,response);
154 _port->write(cmd,response);
155 return response.
get(0).
asInt32()!=0?
true:
false;
164 _port->write(cmd,response);
177 _port->write(cmd,response);
178 return response.
get(0).
asInt32()!=0?
true:
false;
188 _port->write(cmd,response);
200 _port->write(cmd,response);
213 _port->write(cmd,response);
214 return response.
get(0).
asInt32()!=0?
true:
false;
217 bool getFormat7MaxWindowDC1394(
unsigned int &xdim,
unsigned int &ydim,
unsigned int &xstep,
unsigned int &ystep,
unsigned int &xoffstep,
unsigned int &yoffstep)
override
222 _port->write(cmd,response);
230 return response.
get(0).
asInt32()!=0?
true:
false;
238 _port->write(cmd,response);
243 return response.
get(0).
asInt32()!=0?
true:
false;
255 _port->write(cmd,response);
256 return response.
get(0).
asInt32()!=0?
true:
false;
266 _port->write(cmd,response);
267 return response.
get(0).
asInt32()!=0?
true:
false;
275 _port->write(cmd,response);
276 return response.
get(0).
asInt32()!=0?
true:
false;
286 _port->write(cmd,response);
287 return response.
get(0).
asInt32()!=0?
true:
false;
295 _port->write(cmd,response);
296 return response.
get(0).
asInt32()!=0?
true:
false;
306 _port->write(cmd,response);
307 return response.
get(0).
asInt32()!=0?
true:
false;
315 _port->write(cmd,response);
316 return response.
get(0).
asInt32()!=0?
true:
false;
324 _port->write(cmd,response);
325 return response.
get(0).
asInt32()!=0?
true:
false;
334 _port->write(cmd,response);
335 return response.
get(0).
asInt32()!=0?
true:
false;
345 _port->write(cmd,response);
346 return response.
get(0).
asInt32()!=0?
true:
false;
356 _port->write(cmd,response);
357 return response.
get(0).
asInt32()!=0?
true:
false;
366 _port->write(cmd,response);
398 if(no_stream ==
true)
405 if (reader.
read(
true)!=NULL) {
407 lastHeight = image.height();
408 lastWidth = image.width();
424 for(
size_t i=0; i<vertices.size(); i++)
429 port.
write(cmd,response);
440 unsigned char *pixelOut = image.getRawImage();
443 memcpy(pixelOut, response.
get(4).
asBlob(), (
size_t) image.getRawImageSize());
475 "port name of real grabber").asString();
477 "port name to use locally").asString();
478 std::string carrier =
480 "carrier to use for streaming").asString();
485 if(!config.
check(
"no_stream") )
511 #ifndef YARP_NO_DEPRECATED // Since YARP 3.0.0
610 bool no_stream{
false};
623 port.
write(cmd,response);
635 port.
write(cmd,response);
644 port.
write(cmd,response);
655 port.
write(cmd,response);
663 #endif // YARP_DEV_REMOTEFRAMEGRABBER_H
void close() override
Stop port activity.
constexpr yarp::conf::vocab32_t VOCAB_DRSETCOD
constexpr yarp::conf::vocab32_t VOCAB_DRSETISO
bool setHue(double v) override
Set the hue.
A simple collection of objects that can be described and transmitted in a portable way.
virtual std::int32_t asVocab() const
Get vocabulary identifier as an integer.
bool setTransmissionDC1394(bool bTxON) override
bool setGamma(double v) override
Set the gamma.
This classes implement a sender / parser for IFrameGrabberControls interface messages.
constexpr yarp::conf::vocab32_t VOCAB_GAMMA
#define YARP_DECLARE_LOG_COMPONENT(name)
constexpr yarp::conf::vocab32_t VOCAB_DRGETISO
A base class for nested structures that can be searched.
bool setFormat7WindowDC1394(unsigned int xdim, unsigned int ydim, int x0, int y0) override
constexpr yarp::conf::vocab32_t VOCAB_DRSETPWR
bool getOperationModeDC1394() override
size_type size() const
Gets the number of elements in the bottle.
~RemoteFrameGrabber() override=default
constexpr yarp::conf::vocab32_t VOCAB_DRGETCCM
bool close() override
Close the DeviceDriver.
double getExposure() override
Read the exposure parameter.
constexpr yarp::conf::vocab32_t VOCAB_FRAMEGRABBER_IMAGE
virtual const char * asBlob() const
Get binary data value.
bool setWhiteBalance(double blue, double red) override
Set the white balance for the frame grabber.
double getHue() override
Read the hue parameter.
constexpr yarp::conf::vocab32_t VOCAB_FRAMEGRABBER_CONTROL
bool getTransmissionDC1394() override
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
constexpr yarp::conf::vocab32_t VOCAB_DRSETBPP
bool getCommand(int code, double &b, double &r) const
bool setPowerDC1394(bool onoff) override
bool setBroadcastDC1394(bool onoff) override
Interface implemented by all device drivers.
constexpr yarp::conf::vocab32_t VOCAB_BRIGHTNESS
bool setVideoModeDC1394(int video_mode) override
constexpr yarp::conf::vocab32_t VOCAB_GET
constexpr yarp::conf::vocab32_t VOCAB_DRSETTXM
bool setCaptureDC1394(bool bON) override
constexpr yarp::conf::vocab32_t VOCAB_DRGETOPM
constexpr yarp::conf::vocab32_t VOCAB_DRGETVMD
Buffer incoming data to a port.
unsigned int getColorCodingMaskDC1394(unsigned int video_mode) override
bool setExposure(double v) override
Set the exposure.
constexpr yarp::conf::vocab32_t VOCAB_DRSETVMD
unsigned int getColorCodingDC1394() override
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
constexpr yarp::conf::vocab32_t VOCAB_DRSETCAP
void attach(Port &port)
Attach this buffer to a particular port.
bool setBrightness(double v) override
Set the brightness.
bool setSaturation(double v) override
Set the saturation.
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
RemoteFrameGrabber & operator=(const RemoteFrameGrabber &)=delete
bool setIris(double v) override
Set the iris.
constexpr yarp::conf::vocab32_t VOCAB_SHARPNESS
constexpr yarp::conf::vocab32_t VOCAB_DRGETFPM
void init(yarp::os::Port *__port)
bool setResetDC1394() override
A mini-server for network communication.
constexpr yarp::conf::vocab32_t VOCAB_DRGETWF7
bool getWhiteBalance(double &blue, double &red) override
Read the white balance parameters.
constexpr yarp::conf::vocab32_t VOCAB_WHITE
RemoteFrameGrabber & operator=(RemoteFrameGrabber &&)=delete
constexpr yarp::conf::vocab32_t VOCAB_SET
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 ...
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
unsigned int getFPSMaskDC1394() override
virtual bool isBlob() const
Checks if value is a binary object.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
Read a YARP-format image from a device.
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.
constexpr yarp::conf::vocab32_t VOCAB_SATURATION
int height() const override
Return the height of each frame.
T * lastRead() override
Get the last data returned by read()
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.
constexpr yarp::conf::vocab32_t VOCAB_IRIS
constexpr yarp::conf::vocab32_t VOCAB_DRGETCOD
constexpr yarp::conf::vocab32_t VOCAB_SHUTTER
bool setFPSDC1394(int fps) override
bool setCommand(int code, double b, double r)
constexpr yarp::conf::vocab32_t VOCAB_EXPOSURE
int width() const override
Return the width of each frame.
constexpr yarp::conf::vocab32_t VOCAB_DRSETFPS
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
bool setColorCodingDC1394(int coding) override
bool setShutter(double v) override
Set the shutter parameter.
double getBrightness() override
Read the brightness parameter.
constexpr yarp::conf::vocab32_t VOCAB_DRGETFPS
double getGamma() override
Read the gamma parameter.
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
unsigned int getVideoModeMaskDC1394() override
constexpr yarp::conf::vocab32_t VOCAB_DRSETOPM
unsigned int getBytesPerPacketDC1394() override
double getSaturation() override
Read the saturation parameter.
bool setBytesPerPacketDC1394(unsigned int bpp) override
bool setOperationModeDC1394(bool b1394b) override
double getSharpness() override
Read the sharpness parameter.
bool setISOSpeedDC1394(int speed) override
constexpr yarp::conf::vocab32_t VOCAB_DRGETMSK
constexpr yarp::conf::vocab32_t VOCAB_DRGETTXM
IFrameGrabberControlsDC1394 * Ifirewire
void addVocab(int x)
Places a vocabulary item in the bottle, at the end of the list.
T * read(bool shouldWait=true) override
Read an available object from the port.
bool getFormat7WindowDC1394(unsigned int &xdim, unsigned int &ydim, int &x0, int &y0) override
double getGain() override
Read the gain parameter.
unsigned int getISOSpeedDC1394() override
remote_grabber: Connect to a ServerFrameGrabber. See ServerFrameGrabber for the network protocol used...
constexpr yarp::conf::vocab32_t VOCAB_DRGETF7M
double getShutter() override
Read the shutter parameter.
#define yCError(component,...)
constexpr yarp::conf::vocab32_t VOCAB_DRSETDEF
virtual std::int32_t asInt32() const
Get 32-bit integer value.
RemoteFrameGrabber(const RemoteFrameGrabber &)=delete
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
constexpr yarp::conf::vocab32_t VOCAB_DRSETBCS
double getIris() override
Read the iris parameter.
#define yCInfo(component,...)
#define yCDebug(component,...)
constexpr yarp::conf::vocab32_t VOCAB_CROP
unsigned int getFPSDC1394() override
The main, catch-all namespace for YARP.
constexpr yarp::conf::vocab32_t VOCAB_DRGETBPP
bool setGain(double v) override
Set the gain.
double getCommand(int code) const
RemoteFrameGrabber(RemoteFrameGrabber &&)=delete
constexpr yarp::conf::vocab32_t VOCAB_DRSETWF7
#define yCTrace(component,...)
constexpr yarp::conf::vocab32_t VOCAB_HUE
unsigned int getVideoModeDC1394() override
A single value (typically within a Bottle).
bool getFormat7MaxWindowDC1394(unsigned int &xdim, unsigned int &ydim, unsigned int &xstep, unsigned int &ystep, unsigned int &xoffstep, unsigned int &yoffstep) override
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
constexpr yarp::conf::vocab32_t VOCAB_DRSETRST
bool setSharpness(double v) override
Set the sharpness.
const yarp::os::LogComponent & REMOTEFRAMEGRABBER()
constexpr yarp::conf::vocab32_t VOCAB_FRAMEGRABBER_CONTROL_DC1394
bool setCommand(int code, double v)
bool setDefaultsDC1394() override
bool open(yarp::os::Searchable &config) override
Configure with a set of options.
constexpr yarp::conf::vocab32_t VOCAB_GAIN