我的结构体
类似这样
typedef struct _IplImage
{
...........
struct _IplTileInfo *tileInfo; /* " " */
int imageSize; /* Image data size in bytes
(==image->height*image->widthStep
in case of interleaved data)*/
char *imageData; /* Pointer to aligned image data. */
int widthStep; /* Size of aligned image row in bytes. */
int BorderMode[4]; /* Ignored by OpenCV. */
int BorderConst[4]; /* Ditto. */
char *imageDataOrigin; /* Pointer to very origin of image data
(not necessarily aligned) -
needed for correct deallocation */
.............
}
IplImage;
发送函数
我实验了几种
QTextStream 不支持自定义的结构体类型
然后我实验write
用char *的方式传输
也不行
m_clientTcpSocket的类型是 QTcpSocket
void VideoServer::sendData(IplImage image)
{
if (!client_flag ) createClient();
// QTextStream out(m_clientTcpSocket);
//out << image << endl;
m_clientTcpSocket->write((const char *)&image,sizeof(IplImage));
}
qt有什么好的方法吗?