15 #include <visiontransfer/deviceenumeration.h> 16 #include <visiontransfer/asynctransfer.h> 17 #include <visiontransfer/imageset.h> 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;
void setNumberOfImages(int number)
Sets the number of valid images in this set.
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.
void setWidth(int w)
Sets a new width for both images.
int getHeight() const
Returns the height of each image.
void setHeight(int h)
Sets a new width for both images.
int getBytesPerPixel(int imageNumber) const
Returns the number of bytes that are required to store one image pixel.
void setPixelFormat(int imageNumber, ImageFormat format)
Sets the pixel format for the given image.
void setRowStride(int imageNumber, int stride)
Sets a new row stride for the pixel data of one image.
A set of one to three images, but usually two (the left camera image and the disparity map)...
Class for asynchronous transfer of image sets.
void setIndexOf(ImageType what, int idx)
Assign an image index to a specified ImageType, -1 to disable.
int getWidth() const
Returns the width of each image.