src
CameraTcpServer.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2011-2014, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or without
6
modification, are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright
10
notice, this list of conditions and the following disclaimer in the
11
documentation and/or other materials provided with the distribution.
12
* Neither the name of the Universite de Sherbrooke nor the
13
names of its contributors may be used to endorse or promote products
14
derived from this software without specific prior written permission.
15
16
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*/
27
28
#ifndef CAMERATCPCLIENT_H_
29
#define CAMERATCPCLIENT_H_
30
31
#include <QtGlobal>
32
#include <QtNetwork/QTcpServer>
33
#include <opencv2/opencv.hpp>
34
35
namespace
find_object
{
36
37
class
CameraTcpServer
:
public
QTcpServer
38
{
39
Q_OBJECT;
40
public
:
41
CameraTcpServer
(quint16 port = 0, QObject * parent = 0);
42
cv::Mat
getImage
();
43
int
imagesBuffered
()
const
{
return
images_
.size();}
44
bool
isConnected
()
const
;
45
46
QHostAddress
getHostAddress
()
const
;
47
quint16
getPort
()
const
;
48
49
protected
:
50
#if QT_VERSION >= 0x050000
51
virtual
void
incomingConnection
( qintptr socketDescriptor );
52
#else
53
virtual
void
incomingConnection
(
int
socketDescriptor );
54
#endif
55
56
private
Q_SLOTS:
57
void
readReceivedData
();
58
void
displayError
(QAbstractSocket::SocketError socketError);
59
void
connectionLost
();
60
61
private
:
62
quint64
blockSize_
;
63
QVector<cv::Mat>
images_
;
64
};
65
66
}
// namespace find_object
67
68
#endif
/* CAMERATCPCLIENT_H_ */
find_object::CameraTcpServer::getPort
quint16 getPort() const
Definition:
CameraTcpServer.cpp:99
find_object::CameraTcpServer::imagesBuffered
int imagesBuffered() const
Definition:
CameraTcpServer.h:43
find_object::CameraTcpServer::connectionLost
void connectionLost()
Definition:
CameraTcpServer.cpp:182
find_object::CameraTcpServer::displayError
void displayError(QAbstractSocket::SocketError socketError)
Definition:
CameraTcpServer.cpp:160
find_object::CameraTcpServer::incomingConnection
virtual void incomingConnection(int socketDescriptor)
Definition:
CameraTcpServer.cpp:106
find_object::CameraTcpServer::getImage
cv::Mat getImage()
Definition:
CameraTcpServer.cpp:48
find_object::CameraTcpServer::readReceivedData
void readReceivedData()
Definition:
CameraTcpServer.cpp:128
find_object::CameraTcpServer::isConnected
bool isConnected() const
Definition:
CameraTcpServer.cpp:70
find_object::CameraTcpServer
Definition:
CameraTcpServer.h:37
find_object::CameraTcpServer::getHostAddress
QHostAddress getHostAddress() const
Definition:
CameraTcpServer.cpp:75
find_object::CameraTcpServer::blockSize_
quint64 blockSize_
Definition:
CameraTcpServer.h:62
find_object
Definition:
Camera.h:38
find_object::CameraTcpServer::images_
QVector< cv::Mat > images_
Definition:
CameraTcpServer.h:63
find_object::CameraTcpServer::CameraTcpServer
CameraTcpServer(quint16 port=0, QObject *parent=0)
Definition:
CameraTcpServer.cpp:37
find_object_2d
Author(s): Mathieu Labbe
autogenerated on Mon Dec 12 2022 03:43:35