15 #include <visiontransfer/deviceenumeration.h>
16 #include <visiontransfer/asynctransfer.h>
17 #include <visiontransfer/imageset.h>
31 using namespace visiontransfer;
36 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<imageSet.
getHeight(); y++) {
73 for(
int x=0; x<imageSet.
getWidth(); x++) {
74 pixelData[y*imageSet.
getRowStride(0) + x] = (y + x + transfer) & 0xff;
80 asyncTransfer.sendImageSetAsync(imageSet);
82 }
catch(
const std::exception& ex) {
83 std::cerr <<
"Exception occurred: " << ex.what() << std::endl;
int getHeight() const
Returns the height of each image.
int getWidth() const
Returns the width of each image.
void setIndexOf(ImageType what, int idx)
Assign an image index to a specified ImageType, -1 to disable.
int getRowStride(int imageNumber) const
Returns the row stride for the pixel data of one image.
void setPixelData(int imageNumber, unsigned char *pixelData)
Sets the pixel data for the given image.
A set of one to three images, but usually two (the left camera image and the disparity map)....
void setRowStride(int imageNumber, int stride)
Sets a new row stride for the pixel data of one image.
int getBytesPerPixel(int imageNumber) const
Returns the number of bytes that are required to store one image pixel.
void setHeight(int h)
Sets a new width for both images.
void setPixelFormat(int imageNumber, ImageFormat format)
Sets the pixel format for the given image.
Class for asynchronous transfer of image sets.
void setWidth(int w)
Sets a new width for both images.
void setNumberOfImages(int number)
Sets the number of valid images in this set.