9 #ifndef BAYERCARRIER_INC
10 #define BAYERCARRIER_INC
38 size_t image_data_len, consumed;
47 bool bayer_method_set;
56 bool setFormat(
const char *fmt);
72 bayer_method_set(false),
80 if (local)
delete local;
92 return "bayer_carrier";
102 return local->expectBlock(data,len);
105 std::string
expectText(
const char terminatingChar =
'\n')
override {
106 return local->expectText(terminatingChar);
110 return local->expectInt8();
114 return local->expectInt64();
118 return local->expectInt32();
122 return local->expectInt64();
126 return local->pushInt(x);
130 return local->expectFloat32();
134 return local->expectFloat64();
150 if (image_data_len) {
153 return sizeof(header)+image_data_len;
185 return parent->
isError()||!happy;
Decode bayer images and serve them as regular rgb.
yarp::os::Portable * getReference() const override
Get a direct pointer to the object being sent, if possible.
virtual bool processDirect(yarp::os::Bytes &bytes)
std::int64_t expectInt64() override
Read a 64-bit integer from the network connection.
size_t getSize() const override
Checks how much data is available.
yarp::os::ConnectionWriter * getWriter() override
Gets a way to reply to the message, if possible.
bool isTextMode() const override
Check if the connection is text mode.
yarp::conf::float32_t expectFloat32() override
Read a 32-bit floating point number from the network connection.
std::int16_t expectInt16() override
Read a 16-bit integer from the network connection.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
yarp::os::Contact getRemoteContact() const override
Gets information about who is supplying the data being read, if that information is available.
void setParent(yarp::os::ConnectionReader &reader)
std::string expectText(const char terminatingChar='\n') override
Read some text from the network connection.
Carrier * create() const override
Factory method.
virtual bool processBuffered() const
const yarp::os::Searchable & getConnectionModifiers() const override
Access modifiers associated with the connection, if any.
std::int8_t expectInt8() override
Read a 8-bit integer from the network connection.
void close() override
Terminate the stream.
bool setSize(size_t len) override
yarp::os::Contact getLocalContact() const override
Gets information about who is receiving the data, if that information is available.
void requestDrop() override
Tag the connection to be dropped after the current message.
virtual bool debayerHalf(yarp::sig::ImageOf< yarp::sig::PixelMono > &src, yarp::sig::ImageOf< yarp::sig::PixelRgb > &dest)
bool expectBlock(char *data, size_t len) override
Read a block of data from the network connection.
bool convertTextMode() override
Reads in a standard description in text mode, and converts it to a standard description in binary.
std::string toString() const override
Get name of carrier.
bool isValid() const override
std::int32_t expectInt32() override
Read a 32-bit integer from the network connection.
virtual bool debayerFull(yarp::sig::ImageOf< yarp::sig::PixelMono > &src, yarp::sig::ImageOf< yarp::sig::PixelRgb > &dest)
bool isActive() const override
bool isError() const override
bool pushInt(int x) override
Store an integer to return on the next call to expectInt()
yarp::conf::float64_t expectFloat64() override
Read a 64-bit floating point number from the network connection.
yarp::os::Bytes readEnvelope() override
Read a message envelope, if available.
yarp::os::ConnectionReader & modifyIncomingData(yarp::os::ConnectionReader &reader) override
Modify incoming payload data, if appropriate.
bool isOk() const override
Check if the stream is ok or in an error state.
bool isBareMode() const override
Check if the connection is bare mode.
A simple abstraction for a block of bytes.
An interface for reading from a network connection.
virtual void requestDrop()=0
Tag the connection to be dropped after the current message.
virtual const Searchable & getConnectionModifiers() const =0
Access modifiers associated with the connection, if any.
static ConnectionReader * createConnectionReader(InputStream &is)
Create an instance of YARP's standard connection reader implementation.
virtual Contact getRemoteContact() const =0
Gets information about who is supplying the data being read, if that information is available.
virtual Portable * getReference() const =0
Get a direct pointer to the object being sent, if possible.
virtual bool setSize(size_t len)=0
virtual Contact getLocalContact() const =0
Gets information about who is receiving the data, if that information is available.
virtual bool isActive() const =0
virtual Bytes readEnvelope()
Read a message envelope, if available.
virtual bool isError() const =0
virtual ConnectionWriter * getWriter()=0
Gets a way to reply to the message, if possible.
An interface for writing to a network connection.
A dummy connection to test yarp::os::Portable implementations.
A starter class for implementing simple modifying carriers.
This is a base class for objects that can be both read from and be written to the YARP network.
A base class for nested structures that can be searched.
The main, catch-all namespace for YARP.