UsTK : Ultrasound ToolKit  version 2.0.1 under development (2023-12-07)
usFrameGrabbedInfo.h
1 /****************************************************************************
2  *
3  * This file is part of the ustk software.
4  * Copyright (C) 2016 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ustk with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * This software was developed at:
17  * Inria Rennes - Bretagne Atlantique
18  * Campus Universitaire de Beaulieu
19  * 35042 Rennes Cedex
20  * France
21  *
22  * If you have questions regarding the use of this file, please contact
23  * Inria at ustk@inria.fr
24  *
25  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27  *
28  * Authors:
29  * Marc Pouliquen
30  *
31  *****************************************************************************/
32 
39 #ifndef __usFrameGrabbedInfo_h_
40 #define __usFrameGrabbedInfo_h_
41 
42 #include <visp3/ustk_core/usConfig.h>
43 
44 #if defined(USTK_HAVE_QT5) || defined(USTK_HAVE_VTK_QT)
45 
46 #include <visp3/ustk_grabber/usNetworkGrabber.h>
47 
48 #include <visp3/core/vpMutex.h>
49 
50 #include <QtCore/QTypeInfo>
51 
59 template <class Type> class usFrameGrabbedInfo : public Type
60 {
61 public:
62  explicit usFrameGrabbedInfo();
64 
65  quint32 getFrameCount() const;
66  int getFramesPerVolume() const;
67  quint64 getTimeStamp() const;
68 
69  void setFrameCount(quint32 frameCount);
70  void setFramesPerVolume(int framesPerVolume);
71  void setTimeStamp(quint64 timeStamp);
72 
73 private:
74  quint32 m_frameCount; // from the beginning of acquisition
75  quint64 m_timeStamp; // msecs since epoch (on ultrasond machine)
76  int m_framesPerVolume; // number of frames in a volume (for 3D case)
77 };
78 
82 template <class Type>
83 usFrameGrabbedInfo<Type>::usFrameGrabbedInfo() : Type(), m_frameCount(0), m_timeStamp(0), m_framesPerVolume(0)
84 {
85 }
86 
91 
96 template <class Type> quint32 usFrameGrabbedInfo<Type>::getFrameCount() const { return m_frameCount; }
97 
102 template <class Type> int usFrameGrabbedInfo<Type>::getFramesPerVolume() const { return m_framesPerVolume; }
103 
108 template <class Type> quint64 usFrameGrabbedInfo<Type>::getTimeStamp() const { return m_timeStamp; }
109 
114 template <class Type> void usFrameGrabbedInfo<Type>::setFrameCount(quint32 frameCount) { m_frameCount = frameCount; }
115 
120 template <class Type> void usFrameGrabbedInfo<Type>::setFramesPerVolume(int framesPerVolume)
121 {
122  m_framesPerVolume = framesPerVolume;
123 }
124 
129 template <class Type> void usFrameGrabbedInfo<Type>::setTimeStamp(quint64 timeStamp) { m_timeStamp = timeStamp; }
130 
139 template <class Type> std::ostream &operator<<(std::ostream &out, const usFrameGrabbedInfo<Type> &other)
140 {
141  out << "timestamp : " << other.getTimeStamp() << std::endl
142  << "frameCount : " << other.getFrameCount() << std::endl
143  << "frames per volume : " << other.getFramesPerVolume() << std::endl
144  << (Type)other << std::endl;
145 
146  return out;
147 }
148 
149 #endif // QT4 || QT5
150 #endif // __usFrameGrabbedInfo_h_
Class to store additionnal informations arriving on the network with ultrasound images grabbed,...
quint64 getTimeStamp() const
quint32 getFrameCount() const
void setFramesPerVolume(int framesPerVolume)
int getFramesPerVolume() const
void setTimeStamp(quint64 timeStamp)
void setFrameCount(quint32 frameCount)