15 #ifndef VISIONTRANSFER_IMAGETRANSFER_H
16 #define VISIONTRANSFER_IMAGETRANSFER_H
19 #include "visiontransfer/common.h"
20 #include "visiontransfer/types.h"
21 #include "visiontransfer/imageprotocol.h"
22 #include "visiontransfer/imageset.h"
23 #include "visiontransfer/deviceinfo.h"
25 #if VISIONTRANSFER_CPLUSPLUS_VERSION >= 201103L
29 namespace visiontransfer {
45 class VT_EXPORT ImageTransfer {
82 ImageTransfer(
const char* address,
const char* service =
"7681",
84 bool server =
false,
int bufferSize = 16*1048576,
int maxUdpPacketSize = 1472,
85 int autoReconnectDelay=1);
98 int maxUdpPacketSize = 1472,
int autoReconnectDelay=1);
108 void setRawTransferData(
const ImageSet& metaData,
const std::vector<unsigned char*>& rawData,
109 int firstTileWidth = 0,
int middleTileWidth = 0,
int lastTileWidth = 0);
116 void setRawValidBytes(
const std::vector<int>& validBytes);
128 void setTransferImageSet(
const ImageSet& imageSet);
169 bool receiveImageSet(
ImageSet& imageSet);
171 #ifndef DOXYGEN_SHOULD_SKIP_THIS
172 DEPRECATED(
"Use receiveImageSet() instead")
173 inline
bool receiveImagePair(
ImageSet& imageSet) {
174 return receiveImageSet(imageSet);
187 bool receivePartialImageSet(
ImageSet& imageSet,
int& validRows,
bool& complete);
189 #ifndef DOXYGEN_SHOULD_SKIP_THIS
190 DEPRECATED(
"Use receivePartialImageSet() instead")
191 inline
bool receivePartialImagePair(
ImageSet& imageSet,
int& validRows,
bool& complete) {
192 return receivePartialImageSet(imageSet, validRows, complete);
203 int getNumDroppedFrames()
const;
220 bool isConnected()
const;
234 std::string getRemoteAddress()
const;
236 #ifndef DOXYGEN_SHOULD_SKIP_THIS
237 std::string statusReport();
241 #if VISIONTRANSFER_CPLUSPLUS_VERSION >= 201103L
246 void setConnectionStateChangeCallback(std::function<
void(visiontransfer::ConnectionState)> callback);
264 void setAutoReconnect(
int secondsBetweenRetries=1);
272 ImageTransfer(
const ImageTransfer& other);
273 ImageTransfer& operator=(
const ImageTransfer&);