Fraxinus  18.10
An IGT application
cxOpenCVStreamerService.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
12 
13 #include "cxStringProperty.h"
14 #include "cxDoubleProperty.h"
15 #include "cxBoolProperty.h"
16 #include "cxImageStreamerOpenCV.h"
17 #include "cxUtilHelpers.h"
18 
19 #include "QApplication"
20 #include <QDir>
22 
23 namespace cx
24 {
25 
27 {
28 // return "OpenCV";
29  return "Video Grabber";
30 }
31 
33 {
34  return "open_cv_streamer";
35 }
36 
37 std::vector<PropertyPtr> OpenCVStreamerService::getSettings(QDomElement root)
38 {
39  std::vector<PropertyPtr> retval;
40  std::vector<PropertyPtr> opencvArgs = ImageStreamerOpenCVArguments().getSettings(root);
41  std::copy(opencvArgs.begin(), opencvArgs.end(), back_inserter(retval));
42 
43  std::vector<PropertyPtr> localsvrArgs = LocalServerStreamerArguments().getSettings(root);
44  std::copy(localsvrArgs.begin(), localsvrArgs.end(), back_inserter(retval));
45 
46  return retval;
47 }
48 
50 {
52  StreamerPtr localServerStreamer = LocalServerStreamer::createStreamerIfEnabled(root, args);
53  if (localServerStreamer)
54  {
55  return localServerStreamer;
56  }
57 
58  else
59  {
60  boost::shared_ptr<ImageStreamerOpenCV> streamer(new ImageStreamerOpenCV());
61  streamer->initialize(args);
62  return streamer;
63  }
64 }
65 
66 } // namespace cx
static StreamerPtr createStreamerIfEnabled(QDomElement root, StringMap args)
StringMap convertToCommandLineArguments(QDomElement root)
virtual QString getType() const
std::map< QString, QString > StringMap
virtual StreamerPtr createStreamer(QDomElement root)
virtual std::vector< PropertyPtr > getSettings(QDomElement root)
boost::shared_ptr< class Streamer > StreamerPtr
std::vector< PropertyPtr > getSettings(QDomElement root)
virtual std::vector< PropertyPtr > getSettings(QDomElement root)
Namespace for all CustusX production code.