Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::VideoSource Class Referenceabstract

Abstract base class for acquiring video frame data. More...

#include <mitkVideoSource.h>

Inheritance diagram for mitk::VideoSource:
Collaboration diagram for mitk::VideoSource:

Public Member Functions

 mitkClassMacroItkParent (VideoSource, itk::Object)
 
virtual void FetchFrame ()
 Fetch the next frame from the capture device. More...
 
virtual unsigned char * GetVideoTexture ()=0
 Get a pointer to the current video frame pixel data. More...
 
virtual void StartCapturing ()
 Start video capturing. More...
 
virtual void StopCapturing ()
 Stop video capturing. More...
 
virtual bool IsCapturingEnabled () const
 Query whether video capturing is currently active. More...
 
virtual int GetImageWidth ()
 Get the width of the current video frame. More...
 
virtual int GetImageHeight ()
 Get the height of the current video frame. More...
 
virtual unsigned long GetFrameCount () const
 Get the number of frames captured since the last start. More...
 
virtual bool GetCapturePaused () const
 Query whether capturing is currently paused. More...
 
virtual void PauseCapturing ()
 Toggle the capture pause state. More...
 

Protected Member Functions

 VideoSource ()
 
 ~VideoSource () override
 

Protected Attributes

unsigned char * m_CurrentVideoTexture
 
int m_CaptureWidth
 
int m_CaptureHeight
 
bool m_CapturingInProcess
 
unsigned long m_FrameCount
 
bool m_CapturePaused
 

Detailed Description

Abstract base class for acquiring video frame data.

Provides an interface for starting, stopping, and pausing video capture, as well as fetching frames and retrieving video texture data. Subclasses must implement GetVideoTexture() and typically override FetchFrame().

Definition at line 33 of file mitkVideoSource.h.

Constructor & Destructor Documentation

◆ VideoSource()

mitk::VideoSource::VideoSource ( )
protected

init member

◆ ~VideoSource()

mitk::VideoSource::~VideoSource ( )
overrideprotected

deletes m_CurrentVideoTexture (if not 0)

Member Function Documentation

◆ FetchFrame()

virtual void mitk::VideoSource::FetchFrame ( )
virtual

Fetch the next frame from the capture device.

In this base implementation, only the frame counter is incremented. Subclasses should override to perform actual frame acquisition.

◆ GetCapturePaused()

virtual bool mitk::VideoSource::GetCapturePaused ( ) const
virtual

Query whether capturing is currently paused.

Returns
true if paused.

◆ GetFrameCount()

virtual unsigned long mitk::VideoSource::GetFrameCount ( ) const
virtual

Get the number of frames captured since the last start.

Returns
The frame count.

◆ GetImageHeight()

virtual int mitk::VideoSource::GetImageHeight ( )
virtual

Get the height of the current video frame.

Returns
The frame height in pixels, or 0 if unknown.

◆ GetImageWidth()

virtual int mitk::VideoSource::GetImageWidth ( )
virtual

Get the width of the current video frame.

Returns
The frame width in pixels, or 0 if unknown.

◆ GetVideoTexture()

virtual unsigned char* mitk::VideoSource::GetVideoTexture ( )
pure virtual

Get a pointer to the current video frame pixel data.

The returned buffer is suitable for OpenGL texture upload.

Returns
Pointer to the RGBA/RGB pixel data array.

◆ IsCapturingEnabled()

virtual bool mitk::VideoSource::IsCapturingEnabled ( ) const
virtual

Query whether video capturing is currently active.

Returns
true if capturing is in progress.

◆ mitkClassMacroItkParent()

mitk::VideoSource::mitkClassMacroItkParent ( VideoSource  ,
itk::Object   
)

◆ PauseCapturing()

virtual void mitk::VideoSource::PauseCapturing ( )
virtual

Toggle the capture pause state.

While paused, FetchFrame() should provide the same frame repeatedly. Subclasses overriding this method must toggle m_CapturePaused.

◆ StartCapturing()

virtual void mitk::VideoSource::StartCapturing ( )
virtual

Start video capturing.

Sets m_CapturingInProcess to true and resets the frame count. Subclasses overriding this method should call the base implementation.

◆ StopCapturing()

virtual void mitk::VideoSource::StopCapturing ( )
virtual

Stop video capturing.

Sets m_CapturingInProcess to false and resets the frame count. Subclasses overriding this method should call the base implementation.

Member Data Documentation

◆ m_CaptureHeight

int mitk::VideoSource::m_CaptureHeight
protected

should be filled when the first frame is available default: 0

Definition at line 136 of file mitkVideoSource.h.

◆ m_CapturePaused

bool mitk::VideoSource::m_CapturePaused
protected

Saves if the capturing is currently paused, i.e. this will not fetch any further frames but provide the current frame as long as m_CapturePaused is true default: false

Definition at line 157 of file mitkVideoSource.h.

◆ m_CaptureWidth

int mitk::VideoSource::m_CaptureWidth
protected

should be filled when the first frame is available default: 0

Definition at line 130 of file mitkVideoSource.h.

◆ m_CapturingInProcess

bool mitk::VideoSource::m_CapturingInProcess
protected

saves if capturing is in procress default: false

Definition at line 142 of file mitkVideoSource.h.

◆ m_CurrentVideoTexture

unsigned char* mitk::VideoSource::m_CurrentVideoTexture
protected

finally this is what the video source must create: a video texture pointer default: 0

Definition at line 124 of file mitkVideoSource.h.

◆ m_FrameCount

unsigned long mitk::VideoSource::m_FrameCount
protected

Saves the current frame count. Incremented in FetchFrame(). Reset to 0 when StartCapturing() or StopCapturing() is called. default: 0

Definition at line 149 of file mitkVideoSource.h.


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