PlusLib
2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
|
Class that listens for incoming framegrabber images. More...
#include <src/PlusDataCollection/ICCapturing/ICCapturingListener.h>
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 |
Class that listens for incoming framegrabber images.
Definition at line 17 of file ICCapturingListener.h.
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.
ICCapturingListener::ICCapturingListener | ( | ) |
Constructor
Definition at line 19 of file ICCapturingListener.cxx.
ICCapturingListener::~ICCapturingListener | ( | ) |
Destructor
Definition at line 25 of file ICCapturingListener.cxx.
|
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.
|
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.
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.
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.
|
inline |
Set new frame callback function
Definition at line 42 of file ICCapturingListener.h.
|
protected |
Pointer to the callback function that is executed each time a frame is grabbed
Definition at line 49 of file ICCapturingListener.h.
|
protected |
Array of flags which buffers have been saved
Definition at line 46 of file ICCapturingListener.h.