reference

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

ofBaseVideoGrabber Class Referenceabstract

A base class representing a video device such as a camera. More...

#include <ofVideoBaseTypes.h>

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

Public Member Functions

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

Detailed Description

A base class representing a video device such as a camera.

Constructor & Destructor Documentation

◆ ~ofBaseVideoGrabber()

ofBaseVideoGrabber::~ofBaseVideoGrabber ( )
virtual

Destroy the ofBaseVideoGrabber.

Member Function Documentation

◆ getHeight()

virtual float ofBaseVideoGrabber::getHeight ( ) const
pure virtual

Get the video grabber's height.

Returns
the video grabber's height.

Implemented in ofDirectShowGrabber, ofGstVideoGrabber, and ofVideoGrabber.

◆ getTexturePtr()

virtual ofTexture * ofBaseVideoGrabber::getTexturePtr ( )
inlinevirtual

Get the video grabber's internal ofTexture pointer if available.

Note
Subclasses should implement this method only if internal API can upload video grabber pixels directly to an ofTexture.
Returns
the internal ofTexture pointer or nullptr if not available.

Reimplemented in ofGstVideoGrabber.

◆ getWidth()

virtual float ofBaseVideoGrabber::getWidth ( ) const
pure virtual

Get the video grabber's width.

Returns
the video grabber's width.

Implemented in ofDirectShowGrabber, ofGstVideoGrabber, and ofVideoGrabber.

◆ listDevices()

virtual std::vector< ofVideoDevice > ofBaseVideoGrabber::listDevices ( ) const
pure virtual

Get a list of available video grabber devices.

Returns
a std::vector of ofVideoDevice objects.

Implemented in ofDirectShowGrabber, ofGstVideoGrabber, and ofVideoGrabber.

◆ setDesiredFrameRate()

void ofBaseVideoGrabber::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 in ofDirectShowGrabber, ofGstVideoGrabber, and ofVideoGrabber.

◆ setDeviceID()

void ofBaseVideoGrabber::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 in ofDirectShowGrabber, ofVideoGrabber, and ofGstVideoGrabber.

◆ setup()

virtual bool ofBaseVideoGrabber::setup ( int  w,
int  h 
)
pure 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.

Implemented in ofDirectShowGrabber, ofGstVideoGrabber, and ofVideoGrabber.

◆ setVerbose()

void ofBaseVideoGrabber::setVerbose ( bool  bTalkToMe)
virtual

Set the video grabber's hardware verbosity level.

Parameters
bTalkToMetrue if verbose grabber logging feedback is required.

Reimplemented in ofDirectShowGrabber, ofVideoGrabber, and ofGstVideoGrabber.

◆ videoSettings()

void ofBaseVideoGrabber::videoSettings ( void  )
virtual

Request a native GUI for video grabber settings.

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

Reimplemented in ofDirectShowGrabber, ofGstVideoGrabber, and ofVideoGrabber.


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