cinder::Capture Class Reference

#include <Capture.h>

List of all members.

Classes

class  Device
struct  Obj

Public Types

typedef std::shared_ptr< DeviceDeviceRef
typedef std::string DeviceIdentifier
typedef int DeviceIdentifier

Public Member Functions

 Capture ()
 Capture (int32_t width, int32_t height, const DeviceRef device=DeviceRef())
 ~Capture ()
void start ()
 Begin capturing video.
void stop ()
 Stop capturing video.
bool isCapturing ()
 Is the device capturing video.
bool checkNewFrame () const
 Returns whether there is a new video frame available since the last call to checkNewFrame().
int32_t getWidth () const
 Returns the width of the captured image in pixels.
int32_t getHeight () const
 Returns the height of the captured image in pixels.
Vec2i getSize () const
 Returns the size of the captured image in pixels.
float getAspectRatio () const
 Returns the aspect ratio of the capture imagee, which is its width / height.
Area getBounds () const
 Returns the bounding rectangle of the capture imagee, which is Area( 0, 0, width, height ).
Surface8u getSurface () const
 Returns a Surface representing the current captured frame.
const Capture::DeviceRef getDevice () const
 Returns the associated Device for this instace of Capture.

Static Public Member Functions

static const std::vector
< DeviceRef > & 
getDevices (bool forceRefresh=false)
 Returns a vector of all Devices connected to the system. If forceRefresh then the system will be polled for connected devices.
static DeviceRef findDeviceByName (const std::string &name)
 Finds a particular device based on its name.
static DeviceRef findDeviceByNameContains (const std::string &nameFragment)
 Finds the first device whose name contains the string nameFragment.

Protected Attributes

std::shared_ptr< ObjmObj



typedef std::shared_ptr< Obj >
Capture::* 
unspecified_bool_type
 Emulates shared_ptr-like behavior.
 operator unspecified_bool_type () const
 Emulates shared_ptr-like behavior.
void reset ()
 Emulates shared_ptr-like behavior.

Member Typedef Documentation

typedef std::shared_ptr<Device> cinder::Capture::DeviceRef
typedef std::string cinder::Capture::DeviceIdentifier
typedef std::shared_ptr<Obj> Capture::* cinder::Capture::unspecified_bool_type

Emulates shared_ptr-like behavior.


Constructor & Destructor Documentation

cinder::Capture::Capture (  ) 
cinder::Capture::Capture ( int32_t  width,
int32_t  height,
const DeviceRef  device = DeviceRef() 
)
cinder::Capture::~Capture (  ) 

Member Function Documentation

void cinder::Capture::start (  ) 

Begin capturing video.

void cinder::Capture::stop (  ) 

Stop capturing video.

bool cinder::Capture::isCapturing (  ) 

Is the device capturing video.

bool cinder::Capture::checkNewFrame (  )  const

Returns whether there is a new video frame available since the last call to checkNewFrame().

int32_t cinder::Capture::getWidth (  )  const

Returns the width of the captured image in pixels.

int32_t cinder::Capture::getHeight (  )  const

Returns the height of the captured image in pixels.

Vec2i cinder::Capture::getSize (  )  const

Returns the size of the captured image in pixels.

float cinder::Capture::getAspectRatio (  )  const

Returns the aspect ratio of the capture imagee, which is its width / height.

Area cinder::Capture::getBounds (  )  const

Returns the bounding rectangle of the capture imagee, which is Area( 0, 0, width, height ).

Surface8u cinder::Capture::getSurface (  )  const

Returns a Surface representing the current captured frame.

const Capture::DeviceRef cinder::Capture::getDevice (  )  const

Returns the associated Device for this instace of Capture.

const vector< Capture::DeviceRef > & cinder::Capture::getDevices ( bool  forceRefresh = false  )  [static]

Returns a vector of all Devices connected to the system. If forceRefresh then the system will be polled for connected devices.

Capture::DeviceRef cinder::Capture::findDeviceByName ( const std::string &  name  )  [static]

Finds a particular device based on its name.

Capture::DeviceRef cinder::Capture::findDeviceByNameContains ( const std::string &  nameFragment  )  [static]

Finds the first device whose name contains the string nameFragment.

cinder::Capture::operator unspecified_bool_type (  )  const

Emulates shared_ptr-like behavior.

void cinder::Capture::reset (  ) 

Emulates shared_ptr-like behavior.


Member Data Documentation

std::shared_ptr<Obj> cinder::Capture::mObj [protected]

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