Decode bayer images and serve them as regular rgb. More...
#include <bayer_carrier/BayerCarrier.h>
Inheritance diagram for BayerCarrier:Public Member Functions | |
| BayerCarrier () | |
| ~BayerCarrier () | |
| Carrier * | create () const override |
| Factory method. | |
| std::string | getName () const override |
| Get the name of this connection type ("tcp", "mcast", "shmem", ...) | |
| std::string | toString () const override |
| Get name of carrier. | |
| yarp::os::ConnectionReader & | modifyIncomingData (yarp::os::ConnectionReader &reader) override |
| Modify incoming payload data, if appropriate. | |
| bool | expectBlock (char *data, size_t len) override |
| Read a block of data from the network connection. | |
| std::string | expectText (const char terminatingChar='\n') override |
| Read some text from the network connection. | |
| std::int8_t | expectInt8 () override |
| Read a 8-bit integer from the network connection. | |
| std::int16_t | expectInt16 () override |
| Read a 16-bit integer from the network connection. | |
| std::int32_t | expectInt32 () override |
| Read a 32-bit integer from the network connection. | |
| std::int64_t | expectInt64 () override |
| Read a 64-bit integer from the network connection. | |
| bool | pushInt (int x) override |
| Store an integer to return on the next call to expectInt() | |
| yarp::conf::float32_t | expectFloat32 () override |
| Read a 32-bit floating point number from the network connection. | |
| yarp::conf::float64_t | expectFloat64 () override |
| Read a 64-bit floating point number from the network connection. | |
| bool | isTextMode () const override |
| Check if carrier is textual in nature. | |
| bool | isBareMode () const override |
| Check if carrier excludes type information from payload. | |
| bool | convertTextMode () override |
| Reads in a standard description in text mode, and converts it to a standard description in binary. | |
| 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. | |
| yarp::os::Bytes | readEnvelope () override |
| Read a message envelope, if available. | |
| yarp::os::Portable * | getReference () const override |
| Get a direct pointer to the object being sent, if possible. | |
| yarp::os::Contact | getRemoteContact () const override |
| Gets information about who is supplying the data being read, if that information is available. | |
| yarp::os::Contact | getLocalContact () const override |
| Gets information about who is receiving the data, if that information is available. | |
| bool | isValid () const override |
| Check if this object is really a connection, or just an empty placeholder. | |
| bool | isActive () const override |
| Check if carrier is alive and error free. | |
| bool | isError () const override |
| void | requestDrop () override |
| Tag the connection to be dropped after the current message. | |
| const yarp::os::Searchable & | getConnectionModifiers () const override |
| Access modifiers associated with the connection, if any. | |
| bool | setSize (size_t len) override |
| void | flushWriter () override |
| yarp::conf::ssize_t | read (yarp::os::Bytes &b) override |
| Read a block of data from the stream. | |
| void | close () override |
| Close the carrier. | |
| bool | isOk () const override |
| Check if the stream is ok or in an error state. | |
| void | setParent (yarp::os::ConnectionReader &reader) |
| virtual bool | debayerFull (yarp::sig::ImageOf< yarp::sig::PixelMono > &src, yarp::sig::ImageOf< yarp::sig::PixelRgb > &dest) |
| virtual bool | debayerHalf (yarp::sig::ImageOf< yarp::sig::PixelMono > &src, yarp::sig::ImageOf< yarp::sig::PixelRgb > &dest) |
| virtual bool | processBuffered () const |
| virtual bool | processBuffered () |
| virtual bool | processDirect (yarp::os::Bytes &bytes) |
Public Member Functions inherited from yarp::os::ModifyingCarrier | |
| bool | checkHeader (const yarp::os::Bytes &header) override |
| Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for the rest of the connection. | |
| void | getHeader (yarp::os::Bytes &header) const override |
| Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to select it. | |
| bool | respondToHeader (yarp::os::ConnectionState &proto) override |
| Respond to the header. | |
| bool | modifiesIncomingData () const override |
| Check if this carrier modifies incoming data through the Carrier::modifyIncomingData method. | |
| bool | modifiesOutgoingData () const override |
| Check if this carrier modifies outgoing data through the Carrier::modifyOutgoingData method. | |
| bool | modifiesReply () const override |
| Check if this carrier modifies outgoing data through the Carrier::modifyReply method. | |
| void | setCarrierParams (const yarp::os::Property ¶ms) override |
| Configure carrier from port administrative commands. | |
| void | getCarrierParams (yarp::os::Property ¶ms) const override |
| Get carrier configuration and deliver it by port administrative commands. | |
| bool | configureFromProperty (yarp::os::Property &prop) override |
Public Member Functions inherited from yarp::os::AbstractCarrier | |
| void | setParameters (const yarp::os::Bytes &header) override |
| Configure this carrier based on the first 8 bytes of the connection. | |
| bool | isConnectionless () const override |
| Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp). | |
| bool | supportReply () const override |
| This flag is used by YARP to determine whether the connection can carry RPC traffic, that is, messages with replies. | |
| bool | canAccept () const override |
| Check if reading is implemented for this carrier. | |
| bool | canOffer () const override |
| Check if writing is implemented for this carrier. | |
| bool | requireAck () const override |
| Check if carrier has flow control, requiring sent messages to be acknowledged by recipient. | |
| bool | canEscape () const override |
| Check if carrier can encode administrative messages, as opposed to just user data. | |
| bool | isLocal () const override |
| Check if carrier operates within a single process. | |
| bool | prepareSend (ConnectionState &proto) override |
| Perform any initialization needed before writing on a connection. | |
| bool | sendHeader (ConnectionState &proto) override |
| Write a header appropriate to the carrier to the connection, followed by any carrier-specific data. | |
| bool | expectReplyToHeader (ConnectionState &proto) override |
| Process reply to header, if one is expected for this carrier. | |
| virtual bool | sendIndex (ConnectionState &proto, SizedWriter &writer) |
| bool | expectExtraHeader (ConnectionState &proto) override |
| Receive any carrier-specific header. | |
| bool | expectIndex (ConnectionState &proto) override |
| Expect a message header, if there is one for this carrier. | |
| bool | expectSenderSpecifier (ConnectionState &proto) override |
| Expect the name of the sending port. | |
| bool | sendAck (ConnectionState &proto) override |
| Send an acknowledgement, if needed for this carrier. | |
| bool | expectAck (ConnectionState &proto) override |
| Receive an acknowledgement, if expected for this carrier. | |
| bool | defaultSendHeader (ConnectionState &proto) |
| Default implementation for the sendHeader method. | |
| bool | defaultExpectIndex (ConnectionState &proto) |
| Default implementation for the expectIndex method. | |
| bool | defaultSendIndex (ConnectionState &proto, SizedWriter &writer) |
| Default implementation for the sendIndex method. | |
| bool | defaultExpectAck (ConnectionState &proto) |
| Default implementation for the expectAck method. | |
| bool | defaultSendAck (ConnectionState &proto) |
| Default implementation for the sendAck method. | |
| int | readYarpInt (ConnectionState &proto) |
| Read 8 bytes and interpret them as a YARP number. | |
| void | writeYarpInt (int n, ConnectionState &proto) |
Write n as an 8 bytes yarp number. | |
Public Member Functions inherited from yarp::os::Carrier | |
| bool | isBroadcast () const override |
| Check if this carrier uses a broadcast mechanism. | |
| void | handleEnvelope (const std::string &envelope) override |
| Carriers that do not distinguish data from administrative headers (i.e. | |
| bool | isPush () const override |
| Check if carrier is "push" or "pull" style. | |
| virtual bool | reply (ConnectionState &proto, SizedWriter &writer) |
| void | prepareDisconnect () override |
| Do cleanup and preparation for the coming disconnect, if necessary. | |
| virtual | ~Carrier () |
| Destructor. | |
| virtual std::string | getBootstrapCarrierName () const |
| Get the name of the carrier that should be used prior to handshaking, if a port is registered with this carrier as its default carrier. | |
| virtual int | connect (const Contact &src, const Contact &dest, const ContactStyle &style, int mode, bool reversed) |
| Some carrier types may require special connection logic. | |
| ConnectionReader & | modifyIncomingData (ConnectionReader &reader) override |
| Modify incoming payload data, if appropriate. | |
| bool | acceptIncomingData (ConnectionReader &reader) override |
| Determine whether incoming data should be accepted. | |
| const PortWriter & | modifyOutgoingData (const PortWriter &writer) override |
| Modify outgoing payload data, if appropriate. | |
| PortReader & | modifyReply (PortReader &reader) override |
| Modify reply payload data, if appropriate. | |
| bool | acceptOutgoingData (const PortWriter &writer) override |
| Determine whether outgoing data should be accepted. | |
| virtual bool | configure (ConnectionState &proto) |
| Give carrier a shot at looking at how the connection is set up. | |
| virtual yarp::os::Face * | createFace () const |
| Create new Face object that the carrier needs. | |
Public Member Functions inherited from yarp::os::Connection | |
| virtual | ~Connection () |
| Destructor. | |
Public Member Functions inherited from yarp::os::ConnectionReader | |
| virtual | ~ConnectionReader () |
| Destructor. | |
| virtual std::string | expectString () |
| Read a string from the network connection. | |
| virtual void | setParentConnectionReader (ConnectionReader *parentConnectionReader) |
| Set ConnectionReader to be used for reading the envelope. | |
Public Member Functions inherited from yarp::os::InputStream | |
| InputStream () | |
| Constructor. | |
| virtual | ~InputStream () |
| Destructor. | |
| virtual void | check () |
| Perform maintenance actions, if needed. | |
| virtual int | read () |
| Read and return a single byte. | |
| virtual yarp::conf::ssize_t | read (Bytes &b, size_t offset, yarp::conf::ssize_t len) |
| Read a block of data from the stream. | |
| virtual yarp::conf::ssize_t | partialRead (yarp::os::Bytes &b) |
| Like read, but solicit partial responses. | |
| virtual void | interrupt () |
| Interrupt the stream. | |
| virtual bool | setReadTimeout (double timeout) |
| Set activity timeout. | |
| std::string | readLine (const char terminal='\n', bool *success=nullptr) |
| Read a block of text terminated with a specific marker (or EOF). | |
| yarp::conf::ssize_t | readFull (Bytes &b) |
| Keep reading until buffer is full. | |
| yarp::conf::ssize_t | readDiscard (size_t len) |
| Read and discard a fixed number of bytes. | |
| virtual bool | setReadEnvelopeCallback (readEnvelopeCallbackType callback, void *data) |
| Install a callback that the InputStream will have to call when the envelope is read from a message in carriers that cannot be escaped. | |
Decode bayer images and serve them as regular rgb.
Affected by carrier modifiers. Examples: tcp+recv.bayer tcp+recv.bayer+size.half tcp+recv.bayer+size.half+order.bggr
Definition at line 24 of file BayerCarrier.h.
|
inline |
Definition at line 60 of file BayerCarrier.h.
|
inline |
Definition at line 76 of file BayerCarrier.h.
|
inlineoverridevirtual |
Close the carrier.
Reimplemented from yarp::os::Carrier.
Definition at line 209 of file BayerCarrier.h.
|
inlineoverridevirtual |
Reads in a standard description in text mode, and converts it to a standard description in binary.
Useful if you only operate on the binary description usually, and just want to permit text mode for command-line interaction. If isTextMode would return false, no conversion is done.
Implements yarp::os::ConnectionReader.
Definition at line 144 of file BayerCarrier.h.
|
inlineoverridevirtual |
Factory method.
Get a new object of the same type as this one.
Implements yarp::os::ModifyingCarrier.
Definition at line 82 of file BayerCarrier.h.
|
virtual |
Definition at line 201 of file BayerCarrier.cpp.
|
virtual |
Definition at line 159 of file BayerCarrier.cpp.
|
inlineoverridevirtual |
Read a block of data from the network connection.
| data | Start of the block of data |
| len | Length of the block of data |
Implements yarp::os::ConnectionReader.
Definition at line 100 of file BayerCarrier.h.
|
inlineoverridevirtual |
Read a 32-bit floating point number from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 128 of file BayerCarrier.h.
|
inlineoverridevirtual |
Read a 64-bit floating point number from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 132 of file BayerCarrier.h.
|
inlineoverridevirtual |
Read a 16-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 112 of file BayerCarrier.h.
|
inlineoverridevirtual |
Read a 32-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 116 of file BayerCarrier.h.
|
inlineoverridevirtual |
Read a 64-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 120 of file BayerCarrier.h.
|
inlineoverridevirtual |
Read a 8-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 108 of file BayerCarrier.h.
|
inlineoverridevirtual |
Read some text from the network connection.
| terminatingChar | The marker for the end of the text |
Implements yarp::os::ConnectionReader.
Definition at line 104 of file BayerCarrier.h.
|
inlineoverridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 199 of file BayerCarrier.h.
|
inlineoverridevirtual |
Access modifiers associated with the connection, if any.
Implements yarp::os::ConnectionReader.
Definition at line 191 of file BayerCarrier.h.
|
inlineoverridevirtual |
Gets information about who is receiving the data, if that information is available.
Implements yarp::os::ConnectionReader.
Definition at line 171 of file BayerCarrier.h.
|
inlineoverridevirtual |
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
Implements yarp::os::ModifyingCarrier.
Definition at line 86 of file BayerCarrier.h.
|
inlineoverridevirtual |
Get a direct pointer to the object being sent, if possible.
This only makes sense in local operation, when sender and receiver are in the same process; in all other situations this returns nullptr.
Implements yarp::os::ConnectionReader.
Definition at line 163 of file BayerCarrier.h.
|
inlineoverridevirtual |
Gets information about who is supplying the data being read, if that information is available.
Implements yarp::os::ConnectionReader.
Definition at line 167 of file BayerCarrier.h.
|
inlineoverridevirtual |
Checks how much data is available.
Implements yarp::os::ConnectionReader.
Definition at line 148 of file BayerCarrier.h.
|
inlineoverridevirtual |
Gets a way to reply to the message, if possible.
Implements yarp::os::ConnectionReader.
Definition at line 155 of file BayerCarrier.h.
|
inlineoverridevirtual |
Check if carrier is alive and error free.
Reimplemented from yarp::os::AbstractCarrier.
Definition at line 179 of file BayerCarrier.h.
|
inlineoverridevirtual |
Check if carrier excludes type information from payload.
Reimplemented from yarp::os::Connection.
Definition at line 140 of file BayerCarrier.h.
|
inlineoverridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 183 of file BayerCarrier.h.
|
inlineoverridevirtual |
Check if the stream is ok or in an error state.
Implements yarp::os::InputStream.
Definition at line 212 of file BayerCarrier.h.
|
inlineoverridevirtual |
Check if carrier is textual in nature.
Reimplemented from yarp::os::AbstractCarrier.
Definition at line 136 of file BayerCarrier.h.
|
inlineoverridevirtual |
Check if this object is really a connection, or just an empty placeholder.
Reimplemented from yarp::os::Connection.
Definition at line 175 of file BayerCarrier.h.
|
overridevirtual |
Modify incoming payload data, if appropriate.
Doesn't need to be done immediately, it is fine to hold onto a reference to the incoming data reader and use it on demand. This can be handy in order to avoid unnecessary copies.
| reader | for incoming data. |
Implements yarp::os::Connection.
Definition at line 67 of file BayerCarrier.cpp.
|
virtual |
Definition at line 305 of file BayerCarrier.cpp.
|
virtual |
Definition at line 301 of file BayerCarrier.cpp.
|
virtual |
Definition at line 322 of file BayerCarrier.cpp.
|
inlineoverridevirtual |
Store an integer to return on the next call to expectInt()
| x | the integer to store |
Implements yarp::os::ConnectionReader.
Definition at line 124 of file BayerCarrier.h.
|
overridevirtual |
Read a block of data from the stream.
Should block and wait for data.
| b[out] | the block of data to read to |
Implements yarp::os::InputStream.
Definition at line 340 of file BayerCarrier.cpp.
|
inlineoverridevirtual |
Read a message envelope, if available.
Reimplemented from yarp::os::ConnectionReader.
Definition at line 159 of file BayerCarrier.h.
|
inlineoverridevirtual |
Tag the connection to be dropped after the current message.
Implements yarp::os::ConnectionReader.
Definition at line 187 of file BayerCarrier.h.
|
inline |
Definition at line 219 of file BayerCarrier.h.
|
inlineoverridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 195 of file BayerCarrier.h.
|
inlineoverridevirtual |
Get name of carrier.
Reimplemented from yarp::os::AbstractCarrier.
Definition at line 90 of file BayerCarrier.h.