Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VideoTransmitter.hh
1 #ifndef __BIAS_VideoTransmitter_HH__
2 #define __BIAS_VideoTransmitter_HH__
3 
4 #include <iostream>
5 #include <sstream>
6 #include <string>
7 
8 #include <bias_config.h>
9 // BIAS
10 #include <Base/Debug/Debug.hh>
11 #include <Base/Image/ImageIO.hh>
12 #include <Filter/Rescale.hh>
13 #include <Image/Camera.hh>
14 #include <VideoSource/VideoSource_Base.hh>
15 #include <NetworkComm/CScommServer.hh>
16 
17 
18 #ifdef BIAS_HAVE_LIBJPEG
19 #include <Base/Image/CompressJpeg.hh>
20 #include <Base/Image/ImageConvert.hh>
21 #endif // BIAS_HAVE_LIBJPEG
22 
23 
24 namespace BIAS {
25 
26 /** @class VideoTransmitter
27  @ingroup g_videotransmission
28  @ingroup network
29  @brief class to send images to a client
30  uses TCP or UDPServer,
31  @author Ingo Schilller
32  @date 2009
33 */
34 class BIASVideoSource_EXPORT VideoTransmitter :public BIAS::Debug {
35 public:
38 
39  int Init(int port=D_CS_DEFAULT_PORT);
40 
41  int Process(BIAS::Image<unsigned char> & image);
42 
43  void SetCompression(int compressionLevel=60){
44  jpeg_ = compressionLevel;
45  }
46  inline unsigned int GetMessageSize() { return msgSize_; }
47 
48 protected:
49  int port_;
50  std::string targetAddress_;
51 
52  int jpeg_;
53  double resizeFactor_;
55  bool useUDP_;
56 
58  std::ostringstream SendBuffer_;
59 
60  unsigned int msgSize_;
64 
66 
67 #ifdef BIAS_HAVE_LIBJPEG
69 #endif //BIAS_HAVE_LIBJPEG
70 
71 private:
72  // disabled copy-constructor
74  VideoTransmitter &operator=(const VideoTransmitter &) {return *this;};
75 
76 }; // class VideoTransmitter
77 
78 } // namespace BIAS
79 
80 
81 #endif
82 
83 
Wrapper for fast libjpeg methods.
Definition: CompressJpeg.hh:50
std::ostringstream SendBuffer_
unsigned int GetMessageSize()
class for sending/receiving data between clients and serversOnly registered msgs will be accepted at ...
Definition: CScommServer.hh:55
void SetCompression(int compressionLevel=60)
class to send images to a client uses TCP or UDPServer,