15 #include <visiontransfer/deviceenumeration.h> 16 #include <visiontransfer/asynctransfer.h> 17 #include <visiontransfer/imagepair.h> 32 #define snprintf _snprintf_s 41 AsyncTransfer asyncTransfer(
"0.0.0.0",
"7681", ImageProtocol::PROTOCOL_UDP,
true);
62 if(!asyncTransfer.isConnected()) {
68 cout <<
"Client IP: " << asyncTransfer.getRemoteAddress() << endl;
72 for(
int y=0; y<imagePair.
getHeight(); y++) {
73 for(
int x=0; x<imagePair.
getWidth(); x++) {
74 pixelData[y*imagePair.
getRowStride(0) + x] = (y + x + transfer) & 0xff;
80 asyncTransfer.sendImagePairAsync(imagePair);
82 }
catch(
const std::exception& ex) {
83 std::cerr <<
"Exception occurred: " << ex.what() << std::endl;
int getHeight() const
Returns the height of each image.
void setPixelFormat(int imageNumber, ImageFormat format)
Sets the pixel format for the given image.
void setPixelData(int imageNumber, unsigned char *pixelData)
Sets the pixel data for the given image.
void setRowStride(int imageNumber, int stride)
Sets a new row stride for the pixel data of one image.
int getRowStride(int imageNumber) const
Returns the row stride for the pixel data of one image.
void setWidth(int w)
Sets a new width for both images.
int getWidth() const
Returns the width of each image.
Class for asynchronous transfer of image pairs.
void setHeight(int h)
Sets a new width for both images.
A set of two images, which are usually the left camera image and the disparity map.
int getBytesPerPixel(int imageNumber) const
Returns the number of bytes that are required to store one image pixel.