6#ifndef BAYERCARRIER_INC
7#define BAYERCARRIER_INC
35 size_t image_data_len, consumed;
44 bool bayer_method_set;
53 bool setFormat(
const char *fmt);
69 bayer_method_set(false),
91 return "bayer_carrier";
101 return local->expectBlock(data,len);
104 std::string
expectText(
const char terminatingChar =
'\n')
override {
105 return local->expectText(terminatingChar);
109 return local->expectInt8();
113 return local->expectInt64();
117 return local->expectInt32();
121 return local->expectInt64();
125 return local->pushInt(x);
129 return local->expectFloat32();
133 return local->expectFloat64();
149 if (image_data_len) {
152 return sizeof(header)+image_data_len;
184 return parent->
isError()||!happy;
Decode bayer images and serve them as regular rgb.
virtual bool processDirect(yarp::os::Bytes &bytes)
void flushWriter() override
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.
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.
virtual bool processBuffered() const
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)
yarp::os::Portable * getReference() const override
Get a direct pointer to the object being sent, if possible.
yarp::os::ConnectionWriter * getWriter() override
Gets a way to reply to the message, if possible.
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
Carrier * create() const override
Factory method.
bool pushInt(int x) override
Store an integer to return on the next call to expectInt()
const yarp::os::Searchable & getConnectionModifiers() const override
Access modifiers associated with the connection, if any.
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 flushWriter()=0
virtual void requestDrop()=0
Tag the connection to be dropped after the current message.
virtual ConnectionWriter * getWriter()=0
Gets a way to reply to the message, if possible.
static ConnectionReader * createConnectionReader(InputStream &is)
Create an instance of YARP's standard connection reader implementation.
virtual Portable * getReference() const =0
Get a direct pointer to the object being sent, if possible.
virtual Contact getRemoteContact() const =0
Gets information about who is supplying the data being read, if that information is available.
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 const Searchable & getConnectionModifiers() const =0
Access modifiers associated with the connection, if any.
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.