reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofDirectShowGrabber Class Reference

#include <ofDirectShowGrabber.h>

Inheritance diagram for ofDirectShowGrabber:
ofBaseVideoGrabber ofBaseVideo ofBaseHasPixels_< unsigned char > ofBaseUpdates ofAbstractHasPixels

Public Member Functions

 ofDirectShowGrabber ()
 
virtual ~ofDirectShowGrabber ()
 
std::vector< ofVideoDevicelistDevices () const
 Get a list of available video grabber devices.
 
bool setup (int w, int h)
 Set up the grabber with the requested width and height.
 
void update ()
 Update the object's state.
 
bool isFrameNew () const
 
bool isInitialized () const
 Determine if the video source is initialized.
 
bool setPixelFormat (ofPixelFormat pixelFormat)
 Set the requested ofPixelFormat.
 
ofPixelFormat getPixelFormat () const
 
ofPixelsgetPixels ()
 Get a reference to the underlying ofPixels.
 
const ofPixelsgetPixels () const
 Get a const reference to the underlying ofPixels.
 
void close ()
 Close the video source.
 
void clearMemory ()
 
void videoSettings ()
 Request a native GUI for video grabber settings.
 
float getWidth () const
 Get the video grabber's width.
 
float getHeight () const
 Get the video grabber's height.
 
void setVerbose (bool bTalkToMe)
 Set the video grabber's hardware verbosity level.
 
void setDeviceID (int _deviceID)
 Set the video grabber's device ID.
 
void setDesiredFrameRate (int framerate)
 Set the video grabber's desired frame rate.
 
- Public Member Functions inherited from ofBaseVideoGrabber
virtual ~ofBaseVideoGrabber ()
 Destroy the ofBaseVideoGrabber.
 
virtual ofTexturegetTexturePtr ()
 Get the video grabber's internal ofTexture pointer if available.
 
- Public Member Functions inherited from ofBaseVideo
virtual ~ofBaseVideo ()
 Destroy the ofBaseVideo.
 
- Public Member Functions inherited from ofBaseHasPixels_< unsigned char >
virtual ~ofBaseHasPixels_ ()
 Destroy the ofAbstractHasPixels.
 
- Public Member Functions inherited from ofAbstractHasPixels
virtual ~ofAbstractHasPixels ()
 Destroy the ofAbstractHasPixels.
 
- Public Member Functions inherited from ofBaseUpdates
virtual ~ofBaseUpdates ()
 Destroy the ofBaseUpdates.
 

Protected Attributes

bool bChooseDevice
 
int deviceID
 
bool bVerbose
 
bool bGrabberInited
 
ofPixels pixels
 
int attemptFramerate
 
bool bIsFrameNew
 
int width
 
int height
 

Constructor & Destructor Documentation

◆ ofDirectShowGrabber()

ofDirectShowGrabber::ofDirectShowGrabber ( )

◆ ~ofDirectShowGrabber()

virtual ofDirectShowGrabber::~ofDirectShowGrabber ( )
virtual

Member Function Documentation

◆ clearMemory()

void ofDirectShowGrabber::clearMemory ( )

◆ close()

void ofDirectShowGrabber::close ( )
virtual

Close the video source.

Implements ofBaseVideo.

◆ getHeight()

float ofDirectShowGrabber::getHeight ( ) const
virtual

Get the video grabber's height.

Returns
the video grabber's height.

Implements ofBaseVideoGrabber.

◆ getPixelFormat()

ofPixelFormat ofDirectShowGrabber::getPixelFormat ( ) const
virtual
Returns
the current ofPixelFormat.

Implements ofBaseVideo.

◆ getPixels() [1/2]

ofPixels & ofDirectShowGrabber::getPixels ( )
virtual

Get a reference to the underlying ofPixels.

Returns
a reference the underlying ofPixels.

Implements ofBaseHasPixels_< unsigned char >.

◆ getPixels() [2/2]

const ofPixels & ofDirectShowGrabber::getPixels ( ) const
virtual

Get a const reference to the underlying ofPixels.

Returns
a const reference the underlying ofPixels.

Implements ofBaseHasPixels_< unsigned char >.

◆ getWidth()

float ofDirectShowGrabber::getWidth ( ) const
virtual

Get the video grabber's width.

Returns
the video grabber's width.

Implements ofBaseVideoGrabber.

◆ isFrameNew()

bool ofDirectShowGrabber::isFrameNew ( ) const
virtual
Returns
true if the pixel data was updated since the last call to update().

Implements ofBaseVideo.

◆ isInitialized()

bool ofDirectShowGrabber::isInitialized ( ) const
virtual

Determine if the video source is initialized.

Video sources such as cameras are often initialized with a setup() method. Video sources such as movie players are often initialized with a load() method.

Returns
true if the video source is initialized.

Implements ofBaseVideo.

◆ listDevices()

std::vector< ofVideoDevice > ofDirectShowGrabber::listDevices ( ) const
virtual

Get a list of available video grabber devices.

Returns
a std::vector of ofVideoDevice objects.

Implements ofBaseVideoGrabber.

◆ setDesiredFrameRate()

void ofDirectShowGrabber::setDesiredFrameRate ( int  framerate)
virtual

Set the video grabber's desired frame rate.

Many video grabbers support user-specified frame rates. This frame rate should be considered a hint for the video grabber and is not guaranteed.

Parameters
frameratethe desired frame rate.

Reimplemented from ofBaseVideoGrabber.

◆ setDeviceID()

void ofDirectShowGrabber::setDeviceID ( int  deviceID)
virtual

Set the video grabber's device ID.

In most cases, a user can choose a specific grabber source by ID. This device ID information should be available to the user via the listDevices() method.

Parameters
deviceIDThe device ID provided by listDevices().

Reimplemented from ofBaseVideoGrabber.

◆ setPixelFormat()

bool ofDirectShowGrabber::setPixelFormat ( ofPixelFormat  pixelFormat)
virtual

Set the requested ofPixelFormat.

Parameters
pixelFormatthe requested ofPixelFormat.
Returns
true if the format was successfully changed.

Implements ofBaseVideo.

◆ setup()

bool ofDirectShowGrabber::setup ( int  w,
int  h 
)
virtual

Set up the grabber with the requested width and height.

Some video grabbers may take the requested width and height as a hint and choose the closest dimensions to those requested. Users can check the actual width and height by calling getWidth() and getHeight() respectively after a successful setup.

Parameters
wthe requested width.
hthe requested height.
Returns
true if the video grabber was set up successfully.

Implements ofBaseVideoGrabber.

◆ setVerbose()

void ofDirectShowGrabber::setVerbose ( bool  bTalkToMe)
virtual

Set the video grabber's hardware verbosity level.

Parameters
bTalkToMetrue if verbose grabber logging feedback is required.

Reimplemented from ofBaseVideoGrabber.

◆ update()

void ofDirectShowGrabber::update ( )
virtual

Update the object's state.

Implements ofBaseUpdates.

◆ videoSettings()

void ofDirectShowGrabber::videoSettings ( void  )
virtual

Request a native GUI for video grabber settings.

Note
This feature may not be implemented by all video grabbers.

Reimplemented from ofBaseVideoGrabber.

Member Data Documentation

◆ attemptFramerate

int ofDirectShowGrabber::attemptFramerate
protected

◆ bChooseDevice

bool ofDirectShowGrabber::bChooseDevice
protected

◆ bGrabberInited

bool ofDirectShowGrabber::bGrabberInited
protected

◆ bIsFrameNew

bool ofDirectShowGrabber::bIsFrameNew
protected

◆ bVerbose

bool ofDirectShowGrabber::bVerbose
protected

◆ deviceID

int ofDirectShowGrabber::deviceID
protected

◆ height

int ofDirectShowGrabber::height
protected

◆ pixels

ofPixels ofDirectShowGrabber::pixels
protected

◆ width

int ofDirectShowGrabber::width
protected

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