CustusX  2023.01.05-dev+develop.0da12
An IGT application
cx::VideoSourceSHM Class Reference

VideoSource for connecting to shared memory. More...

#include <cxVideoSourceSHM.h>

Inheritance diagram for cx::VideoSourceSHM:
cx::VideoSource

Public Member Functions

 VideoSourceSHM (int width=0, int height=0, int depth=24)
 
virtual ~VideoSourceSHM ()
 
int width () const
 
int height () const
 
int depth () const
 
virtual QString getUid ()
 
virtual QString getName ()
 
virtual vtkImageDataPtr getVtkImageData ()
 
virtual double getTimestamp ()
 
virtual QString getInfoString () const
 Returns a short info message. More...
 
virtual QString getStatusString () const
 Returns a short status message. More...
 
virtual void start ()
 start streaming More...
 
virtual void stop ()
 stop streaming More...
 
virtual bool validData () const
 return true is data stream is ok to display. This is a heuristic based on the data rate. More...
 
virtual bool isConnected () const
 return true when a connection to the data source is established. More...
 
virtual bool isStreaming () const
 return true when the source is streaming data. More...
 
void connectServer (const QString &key)
 
void disconnectServer ()
 
virtual void setResolution (double resolution)
 
- Public Member Functions inherited from cx::VideoSource
virtual ~VideoSource ()
 
virtual TimeInfo getAdvancedTimeInfo ()=0
 

Protected Member Functions

void update ()
 

Protected Attributes

int mImageWidth
 
int mImageHeight
 
int mImageColorDepth
 

Additional Inherited Members

- Signals inherited from cx::VideoSource
void streaming (bool on)
 emitted when streaming started/stopped More...
 
void connected (bool on)
 emitted when source is connected/disconnected More...
 
void newFrame ()
 emitted when a new frame has arrived (getVtkImageData() returns something new). info/status/name/valid might also have changed More...
 

Detailed Description

VideoSource for connecting to shared memory.

Contains data assosiated with a shared memory video stream

Definition at line 52 of file cxVideoSourceSHM.h.

Constructor & Destructor Documentation

cx::VideoSourceSHM::VideoSourceSHM ( int  width = 0,
int  height = 0,
int  depth = 24 
)

Definition at line 28 of file cxVideoSourceSHM.cpp.

cx::VideoSourceSHM::~VideoSourceSHM ( )
virtual

Definition at line 48 of file cxVideoSourceSHM.cpp.

Member Function Documentation

void cx::VideoSourceSHM::connectServer ( const QString &  key)

Connects to a shared memory server end, described by a unique key string. Connects signals and slots on success.

Definition at line 163 of file cxVideoSourceSHM.cpp.

int cx::VideoSourceSHM::depth ( ) const
inline

Definition at line 63 of file cxVideoSourceSHM.h.

void cx::VideoSourceSHM::disconnectServer ( )

Disconnects from current shared memory server end. Disconnects signals and slots.

Definition at line 182 of file cxVideoSourceSHM.cpp.

QString cx::VideoSourceSHM::getInfoString ( ) const
virtual

Returns a short info message.

Implements cx::VideoSource.

Definition at line 75 of file cxVideoSourceSHM.cpp.

QString cx::VideoSourceSHM::getName ( )
virtual

Implements cx::VideoSource.

Definition at line 59 of file cxVideoSourceSHM.cpp.

QString cx::VideoSourceSHM::getStatusString ( ) const
virtual

Returns a short status message.

Implements cx::VideoSource.

Definition at line 81 of file cxVideoSourceSHM.cpp.

double cx::VideoSourceSHM::getTimestamp ( )
virtual

Implements cx::VideoSource.

Definition at line 69 of file cxVideoSourceSHM.cpp.

QString cx::VideoSourceSHM::getUid ( )
virtual

Implements cx::VideoSource.

Definition at line 54 of file cxVideoSourceSHM.cpp.

vtkImageDataPtr cx::VideoSourceSHM::getVtkImageData ( )
virtual

Implements cx::VideoSource.

Definition at line 64 of file cxVideoSourceSHM.cpp.

int cx::VideoSourceSHM::height ( ) const
inline

Definition at line 62 of file cxVideoSourceSHM.h.

bool cx::VideoSourceSHM::isConnected ( ) const
virtual

return true when a connection to the data source is established.

Implements cx::VideoSource.

Definition at line 124 of file cxVideoSourceSHM.cpp.

bool cx::VideoSourceSHM::isStreaming ( ) const
virtual

return true when the source is streaming data.

Implements cx::VideoSource.

Definition at line 129 of file cxVideoSourceSHM.cpp.

void cx::VideoSourceSHM::setResolution ( double  mmPerPixel)
virtual

Set the resolution of the incoming video in mm/pixel

Reimplemented from cx::VideoSource.

Definition at line 204 of file cxVideoSourceSHM.cpp.

void cx::VideoSourceSHM::start ( )
virtual

start streaming

Implements cx::VideoSource.

Definition at line 86 of file cxVideoSourceSHM.cpp.

void cx::VideoSourceSHM::stop ( )
virtual

stop streaming

Implements cx::VideoSource.

Definition at line 104 of file cxVideoSourceSHM.cpp.

void cx::VideoSourceSHM::update ( )
protected

Grabs latest video source frame (if it exists) and signals a new frame Must call release on this when buffer no longer is needed

Definition at line 138 of file cxVideoSourceSHM.cpp.

bool cx::VideoSourceSHM::validData ( ) const
virtual

return true is data stream is ok to display. This is a heuristic based on the data rate.

Implements cx::VideoSource.

Definition at line 118 of file cxVideoSourceSHM.cpp.

int cx::VideoSourceSHM::width ( ) const
inline

Definition at line 61 of file cxVideoSourceSHM.h.

Member Data Documentation

int cx::VideoSourceSHM::mImageColorDepth
protected

Definition at line 90 of file cxVideoSourceSHM.h.

int cx::VideoSourceSHM::mImageHeight
protected

Definition at line 89 of file cxVideoSourceSHM.h.

int cx::VideoSourceSHM::mImageWidth
protected

Definition at line 88 of file cxVideoSourceSHM.h.


The documentation for this class was generated from the following files: