29 #if defined( CINDER_MAC )
30 #if defined( __OBJC__ )
31 @class CaptureImplQtKit;
32 @class QTCaptureDevice;
34 class CaptureImplQtKit;
35 class QTCaptureDevice;
37 #elif defined( CINDER_COCOA_TOUCH_SIMULATOR )
38 #if defined( __OBJC__ )
39 @class CaptureImplCocoaDummy;
41 class CaptureImplCocoaDummy;
43 #elif defined( CINDER_COCOA_TOUCH_DEVICE )
44 #if defined( __OBJC__ )
45 @class CaptureImplAvFoundation;
47 class CaptureImplAvFoundation;
49 #elif defined( CINDER_MSW )
51 class CaptureImplDirectShow;
64 typedef std::shared_ptr<Device>
DeviceRef;
100 static const std::vector<DeviceRef>&
getDevices(
bool forceRefresh =
false );
106 #if defined( CINDER_COCOA )
125 #if defined( CINDER_COCOA )
128 #if defined( CINDER_COCOA_TOUCH )
129 virtual bool isFrontFacing()
const = 0;
142 #if defined( CINDER_MAC )
143 CaptureImplQtKit *mImpl;
144 #elif defined( CINDER_COCOA_TOUCH_SIMULATOR )
145 CaptureImplCocoaDummy *mImpl;
146 #elif defined( CINDER_COCOA_TOUCH_DEVICE )
147 CaptureImplAvFoundation *mImpl;
148 #elif defined( CINDER_MSW )
virtual Capture::DeviceIdentifier getUniqueId() const =0
Returns the OS-specific unique identifier.
virtual ~Device()
Definition: Capture.h:115
Definition: CaptureImplDirectShow.h:32
virtual bool checkAvailable() const =0
Returns whether the device is available for use.
void * getNative()
Definition: AppCocoaTouch.mm:1051
void stop()
Stop capturing video.
Definition: Capture.cpp:110
bool checkNewFrame() const
Returns whether there is a new video frame available since the last call to checkNewFrame() ...
Definition: Capture.cpp:128
virtual ~Obj()
Definition: Capture.cpp:87
int DeviceIdentifier
Definition: Capture.h:109
GLsizei const GLchar ** string
Definition: GLee.h:2427
const Capture::DeviceRef getDevice() const
Returns the associated Device for this instace of Capture.
Definition: Capture.cpp:162
static CaptureRef create(int32_t width, int32_t height, const DeviceRef device=DeviceRef())
Definition: Capture.h:66
std::shared_ptr< Obj > Capture::* unspecified_bool_type
Emulates shared_ptr-like behavior.
Definition: Capture.h:158
Area getBounds() const
Returns the bounding rectangle of the capture imagee, which is Area( 0, 0, width, height ) ...
Definition: Capture.h:92
GLenum GLsizei width
Definition: GLee.h:969
Capture()
Definition: Capture.h:68
Definition: Capture.h:138
void reset()
Emulates shared_ptr-like behavior.
Definition: Capture.h:160
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 poll...
Definition: Capture.cpp:45
Surface8u getSurface() const
Returns a Surface representing the current captured frame.
Definition: Capture.cpp:137
std::string mName
Definition: Capture.h:134
GLenum GLsizei GLsizei height
Definition: GLee.h:1029
Definition: Capture.h:167
Obj(int32_t width, int32_t height, const Capture::DeviceRef device)
Definition: Capture.cpp:78
static DeviceRef findDeviceByName(const std::string &name)
Finds a particular device based on its name.
Definition: Capture.cpp:54
static DeviceRef findDeviceByNameContains(const std::string &nameFragment)
Finds the first device whose name contains the string nameFragment.
Definition: Capture.cpp:65
~Capture()
Definition: Capture.h:71
float getAspectRatio() const
Returns the aspect ratio of the capture imagee, which is its width / height.
Definition: Capture.h:90
Device()
Returns an OS-specific pointer. QTCaptureDevice* on Mac OS X, AVCaptureDevice* on iOS...
Definition: Capture.h:133
GLuint const GLchar * name
Definition: GLee.h:2259
void start()
Begin capturing video.
Definition: Capture.cpp:101
const std::string & getName() const
Returns the human-readable name of the device.
Definition: Capture.h:117
virtual bool isConnected() const =0
Returns whether the device is currently connected.
Definition: Capture.h:113
Definition: Exception.h:32
int32_t getWidth() const
Returns the width of the captured image in pixels.
Definition: Capture.cpp:146
bool isCapturing()
Is the device capturing video.
Definition: Capture.cpp:119
std::shared_ptr< Device > DeviceRef
Definition: Capture.h:63
Vec2i getSize() const
Returns the size of the captured image in pixels.
Definition: Capture.h:88
std::shared_ptr< Obj > mObj
Definition: Capture.h:153
Definition: Capture.h:164
int32_t getHeight() const
Returns the height of the captured image in pixels.
Definition: Capture.cpp:154
std::shared_ptr< class Capture > CaptureRef
Definition: Capture.h:59
Vec2< int > Vec2i
Definition: Vector.h:1313
Definition: Capture.h:170