Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion example-ofxUVC/Project.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@ OF_PATH = ../../..
//THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
#include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"

OTHER_LDFLAGS = $(OF_CORE_LIBS)
//ICONS - NEW IN 0072
ICON_NAME_DEBUG = icon-debug.icns
ICON_NAME_RELEASE = icon.icns
ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/

//IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to:
//ICON_FILE_PATH = bin/data/

OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS)
HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
455 changes: 84 additions & 371 deletions example-ofxUVC/example-ofxUVC.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -22,8 +23,8 @@
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
<Testables>
Expand All @@ -39,8 +40,8 @@
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
Expand Down
6 changes: 4 additions & 2 deletions example-ofxUVC/openFrameworks-Info.plist
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.openFrameworks</string>
<string>cc.openFrameworks.ofapp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand All @@ -16,5 +16,7 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleIconFile</key>
<string>${ICON}</string>
</dict>
</plist>
28 changes: 16 additions & 12 deletions example-ofxUVC/src/testApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@
//--------------------------------------------------------------
void testApp::setup(){

yaml.load("camera_settings.yml");
//yaml.load("camera_settings.yml");

int cameraToUse;
yaml.doc["cameraToUse"] >> cameraToUse;
//yaml.doc["cameraToUse"] >> cameraToUse;

int vendorId, productId, interfaceNum;
yaml.doc["cameras"][cameraToUse]["vendorId"] >> vendorId;
yaml.doc["cameras"][cameraToUse]["productId"] >> productId;
yaml.doc["cameras"][cameraToUse]["interfaceNum"] >> interfaceNum;
yaml.doc["cameras"][cameraToUse]["name"] >> cameraName;
yaml.doc["cameras"][cameraToUse]["width"] >> camWidth;
yaml.doc["cameras"][cameraToUse]["height"] >> camHeight;
// CHECK bin/data/camera_settings.yaml for some proper values
int vendorId = 0x46d, productId = 0x821, interfaceNum = 0x2;
cameraName = "Logitech Camera #2";
camWidth = 640;
camHeight = 360;
//yaml.doc["cameras"][cameraToUse]["vendorId"] >> vendorId;
//yaml.doc["cameras"][cameraToUse]["productId"] >> productId;
//yaml.doc["cameras"][cameraToUse]["interfaceNum"] >> interfaceNum;
//yaml.doc["cameras"][cameraToUse]["name"] >> cameraName;
//yaml.doc["cameras"][cameraToUse]["width"] >> camWidth;
//yaml.doc["cameras"][cameraToUse]["height"] >> camHeight;

vidGrabber.initGrabber(camWidth, camHeight);
vidGrabber.setup(camWidth, camHeight);

int deviceId = 0;
vector<string> availableCams = vidGrabber.listVideoDevices();
Expand All @@ -29,7 +33,7 @@ void testApp::setup(){

vidGrabber.setDeviceID(deviceId);

focus = 0.5;
focus = 0.1;

uvcControl.useCamera(vendorId, productId, interfaceNum);
uvcControl.setAutoExposure(true);
Expand All @@ -42,7 +46,7 @@ void testApp::update(){
vidGrabber.update();
if(vidGrabber.isFrameNew())
{
tex.loadData(vidGrabber.getPixelsRef());
tex.loadData(vidGrabber.getPixels());
}
controls = uvcControl.getCameraControls();
}
Expand Down
4 changes: 2 additions & 2 deletions example-ofxUVC/src/testApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "ofMain.h"
#include "ofxUVC.h"
//#include "ofxQTKitVideoGrabber.h"
#include "ofxYAML.h"
//#include "ofxYAML.h"

/*
struct ofxUVCCameraSetting {
Expand Down Expand Up @@ -41,7 +41,7 @@ class testApp : public ofBaseApp{
ofTexture tex;

ofxUVC uvcControl;
ofxYAML yaml;
//ofxYAML yaml;
string cameraName;

int camWidth, camHeight;
Expand Down