55 if (!ok) {
return false; }
100 if (elems != 1 + (1 * 2) + (
layersNum*10))
127 bool can_be_compressed = connection.
expectInt8();
207 size_t l2 =
alt.layers.size();
219 for (
size_t i = 0; i <
l1; i++)
221 if ((this->
layers[i].enable !=
alt.layers[i].enable) ||
222 (
this->layers[i].colorkey.enable !=
alt.layers[i].colorkey.enable) ||
223 (
this->layers[i].colorkey.value !=
alt.layers[i].colorkey.value) ||
224 (
this->layers[i].alpha.enable !=
alt.layers[i].alpha.enable) ||
225 (
fabs(this->
layers[i].alpha.value -
alt.layers[i].alpha.value) > 0.001) ||
226 (
this->layers[i].layer !=
alt.layers[i].layer) ||
227 (
this->layers[i].can_be_compressed !=
alt.layers[i].can_be_compressed) ||
228 (
this->layers[i].offset_x !=
alt.layers[i].offset_x) ||
229 (
this->layers[i].offset_y !=
alt.layers[i].offset_y))
243 for (
size_t i = 0; i < this->
layers.size(); i++)
245 if (
layers[i].enable ==
false)
258 return convert_to_flexImage();
#define BOTTLE_TAG_FLOAT32
bool readFromConnection(Image &dest, ImageNetworkHeader &header, ConnectionReader &connection)
This helper function groups code to avoid duplication.
void writeToConnection(const Image &img, ConnectionWriter &connection)
bool readFromConnection(FlexImage &dest, ConnectionReader &connection)
A mini-server for performing network communication in the background.
An interface for reading from a network connection.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual yarp::conf::float32_t expectFloat32()=0
Read a 32-bit floating point number from the network connection.
virtual std::int8_t expectInt8()=0
Read a 8-bit integer from the network connection.
An interface for writing to a network connection.
virtual bool isError() const =0
virtual void appendInt8(std::int8_t data)=0
Send a representation of a 8-bit integer to the network connection.
virtual void appendFloat32(yarp::conf::float32_t data)=0
Send a representation of a 32-bit floating point number to the network connection.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
virtual void appendBlock(const char *data, size_t len)=0
Send a block of data to the network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
Image class with user control of representation details.
A single layer of a layered image.
Base class for storing images.
unsigned char * getRawImage() const
Access to the internal image buffer.
size_t getRawImageSize() const
Access to the internal buffer size information (this is how much memory has been allocated for the im...
void zero()
Set all pixels to 0.
A Layered Image, composed by a background and multiple layers.
yarp::sig::FlexImage convert_to_flexImage()
Conversion operator.
~LayeredImage() override
Destructor.
yarp::sig::FlexImage background
void clear()
Clear the layered Image.
bool read(yarp::os::ConnectionReader &connection) override
Read a LayeredImage from a connection.
std::vector< yarp::sig::ImageLayer > layers
bool write(yarp::os::ConnectionWriter &connection) const override
Write a LayeredImage to a connection.
LayeredImage & operator=(const LayeredImage &alt)
Assignment operator.
bool operator==(const LayeredImage &alt) const
Comparison operator.
LayeredImage()
Default constructor.
An interface to the operating system, including Port based communication.
bool sum(yarp::sig::Image &OutImg, const yarp::sig::Image &InImg, bool colorkey_enable, int colorkey, bool alpha_enable, float alpha, size_t off_x, size_t off_y)
applies an image on the top over another image.