PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
List of all members | Public Types | Public Member Functions | Protected Attributes
ICCapturingListener Class Reference

Class that listens for incoming framegrabber images. More...

#include <src/PlusDataCollection/ICCapturing/ICCapturingListener.h>

Inheritance diagram for ICCapturingListener:
Inheritance graph
[legend]
Collaboration diagram for ICCapturingListener:
Collaboration graph
[legend]

Public Types

typedef bool(* ICCapturingSourceNewFramePtr) (unsigned char *imageData, unsigned long dataSize, unsigned long frameNumber)
 

Public Member Functions

virtual void frameReady (DShowLib::Grabber &caller, smart_ptr< DShowLib::MemBuffer > pBuffer, DWORD FrameNumber)
 
 ICCapturingListener ()
 
virtual void overlayCallback (DShowLib::Grabber &caller, smart_ptr< DShowLib::OverlayBitmap > pBitmap, const DShowLib::tsMediaSampleDesc &MediaSampleDesc)
 
void saveImage (smart_ptr< DShowLib::MemBuffer > pBuffer, DWORD currFrame)
 
void setBufferSize (unsigned long NumBuffers)
 
void SetICCapturingSourceNewFrameCallback (ICCapturingSourceNewFramePtr cb)
 
 ~ICCapturingListener ()
 

Protected Attributes

ICCapturingSourceNewFramePtr ICCapturingSourceNewFrameCallback
 
std::vector< bool > m_BufferWritten
 

Detailed Description

Class that listens for incoming framegrabber images.

Definition at line 17 of file ICCapturingListener.h.

Member Typedef Documentation

◆ ICCapturingSourceNewFramePtr

typedef bool(* ICCapturingListener::ICCapturingSourceNewFramePtr) (unsigned char *imageData, unsigned long dataSize, unsigned long frameNumber)

Callback function that is executed each time a frame is grabbed

Definition at line 39 of file ICCapturingListener.h.

Constructor & Destructor Documentation

◆ ICCapturingListener()

ICCapturingListener::ICCapturingListener ( )

Constructor

Definition at line 19 of file ICCapturingListener.cxx.

◆ ~ICCapturingListener()

ICCapturingListener::~ICCapturingListener ( )

Destructor

Definition at line 25 of file ICCapturingListener.cxx.

Member Function Documentation

◆ frameReady()

void ICCapturingListener::frameReady ( DShowLib::Grabber &  caller,
smart_ptr< DShowLib::MemBuffer >  pBuffer,
DWORD  FrameNumber 
)
virtual

Overridden GrabberListener method for calling the saveImage method to save the image buffer to disk

The frameReady() method calls the saveImage method to save the image buffer to disk.

Definition at line 47 of file ICCapturingListener.cxx.

◆ overlayCallback()

void ICCapturingListener::overlayCallback ( DShowLib::Grabber &  caller,
smart_ptr< DShowLib::OverlayBitmap >  pBitmap,
const DShowLib::tsMediaSampleDesc &  MediaSampleDesc 
)
virtual

Overridden GrabberListener method for drawing the number of the current frame

The overlayCallback() method draws the number of the current frame. The frame count is a member of the tsMediaSampleDesc structure that is passed to overlayCallback() by the Grabber.

Definition at line 34 of file ICCapturingListener.cxx.

◆ saveImage()

void ICCapturingListener::saveImage ( smart_ptr< DShowLib::MemBuffer >  pBuffer,
DWORD  currFrame 
)

Save one image and mark it as saved

The image passed by the MemBuffer pointer is saved to a BMP file.

Definition at line 72 of file ICCapturingListener.cxx.

◆ setBufferSize()

void ICCapturingListener::setBufferSize ( unsigned long  NumBuffers)

Setup the buffersize

Initialize the array of bools that is used to memorize, which buffers were processed in the frameReady() method. The size of the array is specified by the parameter NumBuffers. It should be equal to the number of buffers in the FrameHandlerSink. All members of m_BufferWritten are initialized to false. This means that no buffers have been processed.

Definition at line 64 of file ICCapturingListener.cxx.

◆ SetICCapturingSourceNewFrameCallback()

void ICCapturingListener::SetICCapturingSourceNewFrameCallback ( ICCapturingSourceNewFramePtr  cb)
inline

Set new frame callback function

Definition at line 42 of file ICCapturingListener.h.

Member Data Documentation

◆ ICCapturingSourceNewFrameCallback

ICCapturingSourceNewFramePtr ICCapturingListener::ICCapturingSourceNewFrameCallback
protected

Pointer to the callback function that is executed each time a frame is grabbed

Definition at line 49 of file ICCapturingListener.h.

◆ m_BufferWritten

std::vector<bool> ICCapturingListener::m_BufferWritten
protected

Array of flags which buffers have been saved

Definition at line 46 of file ICCapturingListener.h.


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