Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaptureImplCocoaDummy.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012, The Cinder Project: http://libcinder.org All rights reserved.
3  This code is intended for use with the Cinder C++ library: http://libcinder.org
4 
5  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
6  the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and
9  the following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
11  the following disclaimer in the documentation and/or other materials provided with the distribution.
12 
13  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
14  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
15  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
16  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
17  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20  POSSIBILITY OF SUCH DAMAGE.
21 */
22 
23 #pragma once
24 
25 #include "cinder/Cinder.h"
26 #include "cinder/Surface.h"
27 #include "cinder/Capture.h"
28 #include <vector>
29 
30 #import <Foundation/Foundation.h>
31 
32 namespace cinder {
33 
36  public:
37  CaptureImplCocoaDummyDevice( const std::string &name, const Capture::DeviceIdentifier &uniqueId, bool frontFacing )
38  : Capture::Device(), mUniqueId( uniqueId ), mFrontFacing( frontFacing )
39  {
40  mName = name;
41  }
42 
43  bool checkAvailable() const { return true; }
44  bool isConnected() const { return true; }
45  Capture::DeviceIdentifier getUniqueId() const { return mUniqueId; }
46  bool isFrontFacing() const { return mFrontFacing; }
47  void* getNative() const { return NULL; }
48  private:
49  Capture::DeviceIdentifier mUniqueId;
50  bool mFrontFacing;
51 };
52 
53 } //namespace
54 
55 @interface CaptureImplCocoaDummy : NSObject {
56  bool mCapturing;
57  cinder::Surface8u mSurface;
59 }
60 
61 + (const std::vector<cinder::Capture::DeviceRef>&)getDevices:(BOOL)forceRefresh;
62 
63 - (id)initWithDevice:(const cinder::Capture::DeviceRef)device width:(int)width height:(int)height;
64 - (void)prepareStartCapture;
65 - (void)startCapture;
66 - (void)stopCapture;
67 - (bool)isCapturing;
68 - (cinder::Surface8u)getCurrentFrame;
69 - (bool)checkNewFrame;
70 - (const cinder::Capture::DeviceRef)getDevice;
71 - (int32_t)getWidth;
72 - (int32_t)getHeight;
73 
74 @end
Definition: Capture.h:61
int DeviceIdentifier
Definition: Capture.h:109
GLsizei const GLchar ** string
Definition: GLee.h:2427
CaptureImplCocoaDummyDevice(const std::string &name, const Capture::DeviceIdentifier &uniqueId, bool frontFacing)
Definition: CaptureImplCocoaDummy.h:37
bool isFrontFacing() const
Definition: CaptureImplCocoaDummy.h:46
Capture::DeviceIdentifier getUniqueId() const
Returns the OS-specific unique identifier.
Definition: CaptureImplCocoaDummy.h:45
typedef void(APIENTRYP GLEEPFNGLBLENDCOLORPROC)(GLclampf red
bool checkAvailable() const
Returns whether the device is available for use.
Definition: CaptureImplCocoaDummy.h:43
std::string mName
Definition: Capture.h:134
std::shared_ptr< class Device > DeviceRef
Definition: Device.h:36
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
bool isConnected() const
Returns whether the device is currently connected.
Definition: CaptureImplCocoaDummy.h:44
Definition: Capture.h:113
GLuint id
Definition: GLee.h:2035
std::shared_ptr< Device > DeviceRef
Definition: Capture.h:63
This class implements a stubbed-out Capture implementation in order to allow an iOS app which require...
Definition: CaptureImplCocoaDummy.h:35
void * getNative() const
Definition: CaptureImplCocoaDummy.h:47