diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5228a71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.class +distribution +*.DS_Store diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/daniel.mode1v3 b/KinectJNI_v0002/KinectJNI.xcodeproj/daniel.mode1v3 new file mode 100644 index 0000000..c6063d7 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/daniel.mode1v3 @@ -0,0 +1,1455 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + 6598C50D129066C8009C53C6 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 291 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 89D0F0260F392F48007831A7 + 6564A70912B9B6DF0003A8AC + 6564A70A12B9B6DF0003A8AC + 6564A70B12B9B6DF0003A8AC + 6564A70C12B9B6DF0003A8AC + 6564A70E12B9B6DF0003A8AC + 6598C511129067A9009C53C6 + 6564A7D012B9BD040003A8AC + 6564A7D112B9BD040003A8AC + 65D35FC6129076F30032D2A2 + 65D35FC7129076F80032D2A2 + 89D0F0200F392F20007831A7 + 89D0F1390F3948A9007831A7 + 29B97323FDCFA39411CA2CEA + 1058C7A0FEA54F0111CA2CBB + 1058C7A2FEA54F0111CA2CBB + 19C28FACFE9D520D11CA2CBB + 1C37FBAC04509CD000000102 + 6564A7F912BA4AED0003A8AC + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 11 + 10 + 1 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {291, 706}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {308, 724}} + GroupTreeTableConfiguration + + MainColumn + 291 + + RubberWindowFrame + 0 113 1440 765 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 308pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + Example.java + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + Example.java + _historyCapacity + 0 + bookmark + 6564A80E12BA4AED0003A8AC + history + + 65415BC31290A99F00F30EBD + 65415D011290AED400F30EBD + 65415E281290B75800F30EBD + 65415E2A1290B75800F30EBD + 65415EAD1290D5D400F30EBD + 65415EAE1290D5D400F30EBD + 65C5B8931290E43200E79FA5 + 6564A6BC12B9B5D50003A8AC + 6564A6C512B9B5FD0003A8AC + 6564A71E12B9B7080003A8AC + 6564A72112B9B7080003A8AC + 6564A77312B9B8B90003A8AC + 6564A7A612B9BAF80003A8AC + 6564A7C312B9BCBE0003A8AC + 6564A7C412B9BCBE0003A8AC + 6564A7C512B9BCBE0003A8AC + 6564A7C612B9BCBE0003A8AC + 6564A7C712B9BCBE0003A8AC + 6564A7E612B9BDF20003A8AC + 6564A7FA12BA4AED0003A8AC + 6564A7FB12BA4AED0003A8AC + 6564A7FC12BA4AED0003A8AC + 6564A7FE12BA4AED0003A8AC + 6564A7FF12BA4AED0003A8AC + 6564A80012BA4AED0003A8AC + 6564A80112BA4AED0003A8AC + 6564A80212BA4AED0003A8AC + 6564A80312BA4AED0003A8AC + 6564A80412BA4AED0003A8AC + 6564A80512BA4AED0003A8AC + 6564A80612BA4AED0003A8AC + 6564A80712BA4AED0003A8AC + 6564A80812BA4AED0003A8AC + 6564A80912BA4AED0003A8AC + 6564A80B12BA4AED0003A8AC + 6564A80C12BA4AED0003A8AC + 6564A80D12BA4AED0003A8AC + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {1127, 651}} + RubberWindowFrame + 0 113 1440 765 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 651pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 656}, {1127, 68}} + RubberWindowFrame + 0 113 1440 765 0 0 1440 878 + + Module + XCDetailModule + Proportion + 68pt + + + Proportion + 1127pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + 6564A72412B9B7080003A8AC + 1CE0B1FE06471DED0097A5F4 + 6564A72512B9B7080003A8AC + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 6564A72612B9B7080003A8AC + 6564A72712B9B7080003A8AC + 1C78EAAD065D492600B07095 + 1CD10A99069EF8BA00B06720 + 6598C50E129066C8009C53C6 + /Users/daniel/Dropbox/kinect/KinectJNI_v0002/KinectJNI.xcodeproj + + WindowString + 0 113 1440 765 0 0 1440 878 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + NativeKinect.cpp + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {1440, 635}} + RubberWindowFrame + 0 114 1440 764 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 635pt + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 640}, {1440, 83}} + RubberWindowFrame + 0 114 1440 764 0 0 1440 878 + + Module + PBXBuildResultsModule + Proportion + 83pt + + + Proportion + 723pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + 6598C50E129066C8009C53C6 + 6564A6D412B9B6740003A8AC + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 0 114 1440 764 0 0 1440 878 + WindowToolGUID + 6598C50E129066C8009C53C6 + WindowToolIsVisible + + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debugger + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {316, 203}} + {{316, 0}, {378, 203}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 203}} + {{0, 203}, {694, 178}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 381}} + PBXDebugSessionStackFrameViewKey + + DebugVariablesTableConfiguration + + Name + 120 + Value + 85 + Summary + 148 + + Frame + {{316, 0}, {378, 203}} + RubberWindowFrame + 148 337 694 422 0 0 1440 878 + + RubberWindowFrame + 148 337 694 422 0 0 1440 878 + + Module + PBXDebugSessionModule + Proportion + 381pt + + + Proportion + 381pt + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + + TableOfContents + + 1CD10A99069EF8BA00B06720 + 6564A6D512B9B6740003A8AC + 1C162984064C10D400B95A72 + 6564A6D612B9B6740003A8AC + 6564A6D712B9B6740003A8AC + 6564A6D812B9B6740003A8AC + 6564A6D912B9B6740003A8AC + 6564A6DA12B9B6740003A8AC + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 148 337 694 422 0 0 1440 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debuggerConsole + IsVertical + + Layout + + + Dock + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {1006, 495}} + RubberWindowFrame + 159 256 1006 536 0 0 1440 878 + + Module + PBXDebugCLIModule + Proportion + 495pt + + + Proportion + 495pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + + TableOfContents + + 1C78EAAD065D492600B07095 + 6564A6DB12B9B6740003A8AC + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 159 256 1006 536 0 0 1440 878 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/daniel.pbxuser b/KinectJNI_v0002/KinectJNI.xcodeproj/daniel.pbxuser new file mode 100644 index 0000000..0a11f15 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/daniel.pbxuser @@ -0,0 +1,882 @@ +// !$*UTF8*$! +{ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = 89D0F2C50F40E784007831A7 /* KinectJNI */; + activeTarget = 89D0F1C90F3B704E007831A7 /* KinectJNI */; + addToTargets = ( + 89D0F0480F393A6F007831A7 /* Compile Java */, + ); + codeSenseManager = 89D0F2CF0F40E7A1007831A7 /* Code sense */; + executables = ( + 89D0F2C50F40E784007831A7 /* KinectJNI */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; + PBXFileTableDataSourceColumnWidthsKey = ( + 22, + 300, + 776, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXExecutablesDataSource_ActiveFlagID, + PBXExecutablesDataSource_NameID, + PBXExecutablesDataSource_CommentsID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 888, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 848, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 314160652; + PBXWorkspaceStateSaveDate = 314160652; + }; + perUserProjectItems = { + 65415BC31290A99F00F30EBD /* PBXTextBookmark */ = 65415BC31290A99F00F30EBD /* PBXTextBookmark */; + 65415D011290AED400F30EBD /* PBXTextBookmark */ = 65415D011290AED400F30EBD /* PBXTextBookmark */; + 65415E281290B75800F30EBD /* PBXTextBookmark */ = 65415E281290B75800F30EBD /* PBXTextBookmark */; + 65415E2A1290B75800F30EBD /* PBXTextBookmark */ = 65415E2A1290B75800F30EBD /* PBXTextBookmark */; + 65415EAD1290D5D400F30EBD /* PBXTextBookmark */ = 65415EAD1290D5D400F30EBD /* PBXTextBookmark */; + 65415EAE1290D5D400F30EBD /* PBXTextBookmark */ = 65415EAE1290D5D400F30EBD /* PBXTextBookmark */; + 6564A6BC12B9B5D50003A8AC /* PBXTextBookmark */ = 6564A6BC12B9B5D50003A8AC /* PBXTextBookmark */; + 6564A6C512B9B5FD0003A8AC /* PBXTextBookmark */ = 6564A6C512B9B5FD0003A8AC /* PBXTextBookmark */; + 6564A71E12B9B7080003A8AC /* PBXTextBookmark */ = 6564A71E12B9B7080003A8AC /* PBXTextBookmark */; + 6564A72112B9B7080003A8AC /* PBXTextBookmark */ = 6564A72112B9B7080003A8AC /* PBXTextBookmark */; + 6564A77312B9B8B90003A8AC /* PBXTextBookmark */ = 6564A77312B9B8B90003A8AC /* PBXTextBookmark */; + 6564A7A612B9BAF80003A8AC /* PBXTextBookmark */ = 6564A7A612B9BAF80003A8AC /* PBXTextBookmark */; + 6564A7C312B9BCBE0003A8AC /* PBXTextBookmark */ = 6564A7C312B9BCBE0003A8AC /* PBXTextBookmark */; + 6564A7C412B9BCBE0003A8AC /* PBXTextBookmark */ = 6564A7C412B9BCBE0003A8AC /* PBXTextBookmark */; + 6564A7C512B9BCBE0003A8AC /* PBXTextBookmark */ = 6564A7C512B9BCBE0003A8AC /* PBXTextBookmark */; + 6564A7C612B9BCBE0003A8AC /* PBXTextBookmark */ = 6564A7C612B9BCBE0003A8AC /* PBXTextBookmark */; + 6564A7C712B9BCBE0003A8AC /* PBXTextBookmark */ = 6564A7C712B9BCBE0003A8AC /* PBXTextBookmark */; + 6564A7E612B9BDF20003A8AC /* PBXTextBookmark */ = 6564A7E612B9BDF20003A8AC /* PBXTextBookmark */; + 6564A7FA12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A7FA12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A7FB12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A7FB12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A7FC12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A7FC12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A7FE12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A7FE12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A7FF12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A7FF12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80012BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80012BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80112BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80112BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80212BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80212BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80312BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80312BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80412BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80412BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80512BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80512BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80612BA4AED0003A8AC /* PlistBookmark */ = 6564A80612BA4AED0003A8AC /* PlistBookmark */; + 6564A80712BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80712BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80812BA4AED0003A8AC /* PBXBookmark */ = 6564A80812BA4AED0003A8AC /* PBXBookmark */; + 6564A80912BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80912BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80B12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80B12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80C12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80C12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80D12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80D12BA4AED0003A8AC /* PBXTextBookmark */; + 6564A80E12BA4AED0003A8AC /* PBXTextBookmark */ = 6564A80E12BA4AED0003A8AC /* PBXTextBookmark */; + 65C5B8931290E43200E79FA5 /* PBXTextBookmark */ = 65C5B8931290E43200E79FA5 /* PBXTextBookmark */; + }; + sourceControlManager = 89D0F2CE0F40E7A1007831A7 /* Source Control */; + userBuildSettings = { + }; + }; + 653A255112906EFD007E71A5 /* Manifest */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{37, 0}"; + sepNavVisRange = "{0, 37}"; + }; + }; + 65415B6F1290A84E00F30EBD /* cameras.mm */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.objcpp; + name = cameras.mm; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/libfreenect/cameras.mm; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 5408}}"; + sepNavSelRange = "{450, 0}"; + sepNavVisRange = "{0, 896}"; + sepNavWindowFrame = "{{86, 33}, {1330, 770}}"; + }; + }; + 65415B701290A84E00F30EBD /* cameras.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = cameras.h; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/libfreenect/cameras.h; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 437}}"; + sepNavSelRange = "{561, 0}"; + sepNavVisRange = "{0, 570}"; + }; + }; + 65415B711290A84E00F30EBD /* inits.mm */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.objcpp; + name = inits.mm; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/libfreenect/inits.mm; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 1963}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 518}"; + }; + }; + 65415BC31290A99F00F30EBD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65D3600812907AB50032D2A2 /* NSObjCRuntime.h */; + name = "NSObjCRuntime.h: 180"; + rLen = 0; + rLoc = 6179; + rType = 0; + vrLen = 1426; + vrLoc = 5631; + }; + 65415D011290AED400F30EBD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415B701290A84E00F30EBD /* cameras.h */; + name = "cameras.h: 27"; + rLen = 0; + rLoc = 561; + rType = 0; + vrLen = 570; + vrLoc = 0; + }; + 65415D061290AEFC00F30EBD /* ofxKinect.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = ofxKinect.h; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/ofxKinect.h; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 1157}}"; + sepNavSelRange = "{554, 195}"; + sepNavVisRange = "{407, 818}"; + }; + }; + 65415D071290AEFC00F30EBD /* ofxKinect.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = ofxKinect.cpp; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/ofxKinect.cpp; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 3328}}"; + sepNavSelRange = "{701, 0}"; + sepNavVisRange = "{1115, 630}"; + }; + }; + 65415DF01290B2D000F30EBD /* ofxThread.mm */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.objcpp; + name = ofxThread.mm; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/ofxThread/src/ofxThread.mm; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 1495}}"; + sepNavSelRange = "{227, 0}"; + sepNavVisRange = "{0, 862}"; + }; + }; + 65415DF11290B2D100F30EBD /* ofxThread.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = ofxThread.h; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/ofxThread/src/ofxThread.h; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 793}}"; + sepNavSelRange = "{114, 0}"; + sepNavVisRange = "{0, 719}"; + }; + }; + 65415DF41290B31100F30EBD /* ofConstants.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = ofConstants.h; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/src/ofxThread/src/ofConstants.h; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 5096}}"; + sepNavSelRange = "{1120, 0}"; + sepNavVisRange = "{829, 1373}"; + }; + }; + 65415E281290B75800F30EBD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415DF41290B31100F30EBD /* ofConstants.h */; + name = "ofConstants.h: 47"; + rLen = 0; + rLoc = 1120; + rType = 0; + vrLen = 1373; + vrLoc = 829; + }; + 65415E2A1290B75800F30EBD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415DF01290B2D000F30EBD /* ofxThread.mm */; + name = "ofxThread.mm: 9"; + rLen = 0; + rLoc = 227; + rType = 0; + vrLen = 862; + vrLoc = 0; + }; + 65415EAD1290D5D400F30EBD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415DF11290B2D100F30EBD /* ofxThread.h */; + name = "ofxThread.h: 7"; + rLen = 0; + rLoc = 114; + rType = 0; + vrLen = 719; + vrLoc = 0; + }; + 65415EAE1290D5D400F30EBD /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415D061290AEFC00F30EBD /* ofxKinect.h */; + name = "ofxKinect.h: 32"; + rLen = 195; + rLoc = 554; + rType = 0; + vrLen = 818; + vrLoc = 407; + }; + 6564A6BC12B9B5D50003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415B6F1290A84E00F30EBD /* cameras.mm */; + name = "cameras.mm: 18"; + rLen = 0; + rLoc = 450; + rType = 0; + vrLen = 896; + vrLoc = 0; + }; + 6564A6C512B9B5FD0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415D071290AEFC00F30EBD /* ofxKinect.cpp */; + name = "ofxKinect.cpp: 32"; + rLen = 0; + rLoc = 701; + rType = 0; + vrLen = 630; + vrLoc = 1115; + }; + 6564A70012B9B6DF0003A8AC /* cameras.c */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 10569}}"; + sepNavSelRange = "{6513, 0}"; + sepNavVisRange = "{611, 815}"; + }; + }; + 6564A70212B9B6DF0003A8AC /* freenect_internal.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1379, 2041}}"; + sepNavSelRange = "{3859, 0}"; + sepNavVisRange = "{3046, 998}"; + }; + }; + 6564A70712B9B6DF0003A8AC /* usb_libusb10.c */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 3289}}"; + sepNavSelRange = "{1199, 0}"; + sepNavVisRange = "{175, 1180}"; + }; + }; + 6564A70812B9B6DF0003A8AC /* usb_libusb10.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1379, 1131}}"; + sepNavSelRange = "{1143, 0}"; + sepNavVisRange = "{973, 214}"; + sepNavWindowFrame = "{{38, 82}, {1330, 770}}"; + }; + }; + 6564A70D12B9B6DF0003A8AC /* libusb.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 17251}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 1654}"; + }; + }; + 6564A71E12B9B7080003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65D3607412907E910032D2A2 /* NativeKinect.h */; + name = "NativeKinect.h: 10"; + rLen = 0; + rLoc = 152; + rType = 0; + vrLen = 152; + vrLoc = 0; + }; + 6564A72112B9B7080003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65D3607512907E910032D2A2 /* NativeKinect.cpp */; + name = "NativeKinect.cpp: 4"; + rLen = 1; + rLoc = 40; + rType = 0; + vrLen = 384; + vrLoc = 0; + }; + 6564A75E12B9B82C0003A8AC /* org_openkinect_Context.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 2613}}"; + sepNavSelRange = "{5061, 0}"; + sepNavVisRange = "{5036, 632}"; + sepNavWindowFrame = "{{61, 61}, {1330, 770}}"; + }; + }; + 6564A75F12B9B82C0003A8AC /* org_openkinect_Context.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 793}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 747}"; + }; + }; + 6564A76012B9B82C0003A8AC /* org_openkinect_Device.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1379, 1339}}"; + sepNavSelRange = "{2383, 0}"; + sepNavVisRange = "{0, 1640}"; + }; + }; + 6564A76112B9B82C0003A8AC /* org_openkinect_Device.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 1144}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 735}"; + }; + }; + 6564A77312B9B8B90003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A70712B9B6DF0003A8AC /* usb_libusb10.c */; + name = "usb_libusb10.c: 31"; + rLen = 0; + rLoc = 1199; + rType = 0; + vrLen = 1180; + vrLoc = 175; + }; + 6564A79712B9BAB10003A8AC /* libfreenect.hpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 2080}}"; + sepNavSelRange = "{2216, 27}"; + sepNavVisRange = "{1658, 1125}"; + }; + }; + 6564A79812B9BAB10003A8AC /* libfreenect.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 2145}}"; + sepNavSelRange = "{1773, 25}"; + sepNavVisRange = "{3810, 1498}"; + }; + }; + 6564A7A612B9BAF80003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A70012B9B6DF0003A8AC /* cameras.c */; + name = "cameras.c: 244"; + rLen = 0; + rLoc = 6513; + rType = 0; + vrLen = 815; + vrLoc = 611; + }; + 6564A7C312B9BCBE0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A76112B9B82C0003A8AC /* org_openkinect_Device.h */; + name = "org_openkinect_Device.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 735; + vrLoc = 0; + }; + 6564A7C412B9BCBE0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A76012B9B82C0003A8AC /* org_openkinect_Device.cpp */; + name = "org_openkinect_Device.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1182; + vrLoc = 77; + }; + 6564A7C512B9BCBE0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A75F12B9B82C0003A8AC /* org_openkinect_Context.h */; + name = "org_openkinect_Context.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 747; + vrLoc = 0; + }; + 6564A7C612B9BCBE0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A79712B9BAB10003A8AC /* libfreenect.hpp */; + name = "libfreenect.hpp: 68"; + rLen = 27; + rLoc = 2216; + rType = 0; + vrLen = 1125; + vrLoc = 1658; + }; + 6564A7C712B9BCBE0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A79812B9BAB10003A8AC /* libfreenect.h */; + name = "libfreenect.h: 50"; + rLen = 25; + rLoc = 1773; + rType = 0; + vrLen = 1498; + vrLoc = 3810; + }; + 6564A7CF12B9BD040003A8AC /* Example.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 2535}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 1603}"; + }; + }; + 6564A7D212B9BD040003A8AC /* Acceleration.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{1237, 0}"; + sepNavVisRange = "{0, 1240}"; + }; + }; + 6564A7D412B9BD040003A8AC /* Context.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 1755}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{1125, 579}"; + }; + }; + 6564A7D512B9BD040003A8AC /* DepthFormat.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 1229}"; + }; + }; + 6564A7D612B9BD040003A8AC /* Device.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 2340}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{1566, 798}"; + }; + }; + 6564A7D712B9BD040003A8AC /* Image.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 494}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{408, 840}"; + }; + }; + 6564A7D812B9BD040003A8AC /* LEDStatus.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 1290}"; + }; + }; + 6564A7DA12B9BD040003A8AC /* LogLevel.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 1249}"; + }; + }; + 6564A7E612B9BDF20003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A75E12B9B82C0003A8AC /* org_openkinect_Context.cpp */; + name = "org_openkinect_Context.cpp: 173"; + rLen = 0; + rLoc = 5061; + rType = 0; + vrLen = 632; + vrLoc = 5036; + }; + 6564A7FA12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7D712B9BD040003A8AC /* Image.java */; + name = "Image.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 840; + vrLoc = 408; + }; + 6564A7FB12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7D412B9BD040003A8AC /* Context.java */; + name = "Context.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 579; + vrLoc = 1125; + }; + 6564A7FC12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7FD12BA4AED0003A8AC /* find-classrefs.sh */; + name = "find-classrefs.sh: 30"; + rLen = 0; + rLoc = 1202; + rType = 0; + vrLen = 1215; + vrLoc = 0; + }; + 6564A7FD12BA4AED0003A8AC /* find-classrefs.sh */ = { + isa = PBXFileReference; + name = "find-classrefs.sh"; + path = "/Users/daniel/Dropbox/kinect/KinectJNI_v0002/make/find-classrefs.sh"; + sourceTree = ""; + }; + 6564A7FE12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7D812B9BD040003A8AC /* LEDStatus.java */; + name = "LEDStatus.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1290; + vrLoc = 0; + }; + 6564A7FF12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65D35FCA129077490032D2A2 /* KinectJNI.java */; + name = "KinectJNI.java: 18"; + rLen = 0; + rLoc = 401; + rType = 0; + vrLen = 935; + vrLoc = 0; + }; + 6564A80012BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7D612B9BD040003A8AC /* Device.java */; + name = "Device.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 798; + vrLoc = 1566; + }; + 6564A80112BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7D512B9BD040003A8AC /* DepthFormat.java */; + name = "DepthFormat.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1229; + vrLoc = 0; + }; + 6564A80212BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A70D12B9B6DF0003A8AC /* libusb.h */; + name = "libusb.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1654; + vrLoc = 0; + }; + 6564A80312BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65D35FCF129077670032D2A2 /* NativeKinect.java */; + name = "NativeKinect.java: 30"; + rLen = 0; + rLoc = 667; + rType = 0; + vrLen = 726; + vrLoc = 0; + }; + 6564A80412BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 653A255112906EFD007E71A5 /* Manifest */; + name = "Manifest: 1"; + rLen = 0; + rLoc = 37; + rType = 0; + vrLen = 37; + vrLoc = 0; + }; + 6564A80512BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 89C3F2910F5250A300B0048E /* English */; + name = "English: 15"; + rLen = 0; + rLoc = 157; + rType = 0; + vrLen = 157; + vrLoc = 0; + }; + 6564A80612BA4AED0003A8AC /* PlistBookmark */ = { + isa = PlistBookmark; + fRef = 89D0F0230F392F20007831A7 /* Info.plist */; + fallbackIsa = PBXBookmark; + isK = 0; + kPath = ( + ); + name = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/resources/Info.plist; + rLen = 0; + rLoc = 9223372036854775807; + }; + 6564A80712BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 89D0F0220F392F20007831A7 /* English */; + name = "InfoPlist.strings: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 86; + vrLoc = 0; + }; + 6564A80812BA4AED0003A8AC /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = 89D0F1BE0F3B68AD007831A7 /* GenericApp.icns */; + }; + 6564A80912BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A80A12BA4AED0003A8AC /* build.xml */; + name = "build.xml: 60"; + rLen = 3; + rLoc = 1488; + rType = 0; + vrLen = 1311; + vrLoc = 983; + }; + 6564A80A12BA4AED0003A8AC /* build.xml */ = { + isa = PBXFileReference; + name = build.xml; + path = /Users/daniel/Dropbox/kinect/KinectJNI_v0002/make/build.xml; + sourceTree = ""; + }; + 6564A80B12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7D212B9BD040003A8AC /* Acceleration.java */; + name = "Acceleration.java: 34"; + rLen = 0; + rLoc = 1237; + rType = 0; + vrLen = 1240; + vrLoc = 0; + }; + 6564A80C12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7DA12B9BD040003A8AC /* LogLevel.java */; + name = "LogLevel.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1249; + vrLoc = 0; + }; + 6564A80D12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7CF12B9BD040003A8AC /* Example.java */; + name = "Example.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1603; + vrLoc = 0; + }; + 6564A80E12BA4AED0003A8AC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 6564A7CF12B9BD040003A8AC /* Example.java */; + name = "Example.java: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1603; + vrLoc = 0; + }; + 65C5B8931290E43200E79FA5 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65415B711290A84E00F30EBD /* inits.mm */; + name = "inits.mm: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 518; + vrLoc = 0; + }; + 65D35FCA129077490032D2A2 /* KinectJNI.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{401, 0}"; + sepNavVisRange = "{0, 935}"; + }; + }; + 65D35FCF129077670032D2A2 /* NativeKinect.java */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{667, 0}"; + sepNavVisRange = "{0, 726}"; + sepNavWindowFrame = "{{38, 92}, {1134, 760}}"; + }; + }; + 65D3600812907AB50032D2A2 /* NSObjCRuntime.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = NSObjCRuntime.h; + path = /System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h; + sourceTree = ""; + }; + 65D3607412907E910032D2A2 /* NativeKinect.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 418}}"; + sepNavSelRange = "{152, 0}"; + sepNavVisRange = "{0, 152}"; + sepNavWindowFrame = "{{15, 113}, {1134, 760}}"; + }; + }; + 65D3607512907E910032D2A2 /* NativeKinect.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1379, 603}}"; + sepNavSelRange = "{164, 1}"; + sepNavVisRange = "{0, 361}"; + }; + }; + 89D0F0220F392F20007831A7 /* English */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1066, 594}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 86}"; + sepNavWindowFrame = "{{38, 92}, {1134, 760}}"; + }; + }; + 89D0F0230F392F20007831A7 /* Info.plist */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {863, 821}}"; + sepNavSelRange = "{332, 0}"; + sepNavVisRange = "{0, 1078}"; + sepNavWindowFrame = "{{15, -5}, {922, 878}}"; + }; + }; + 89D0F0480F393A6F007831A7 /* Compile Java */ = { + activeExec = 0; + }; + 89D0F04F0F393AD9007831A7 /* Compile Native */ = { + activeExec = 0; + }; + 89D0F1C90F3B704E007831A7 /* KinectJNI */ = { + activeExec = 0; + }; + 89D0F2C50F40E784007831A7 /* KinectJNI */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + "PBXLSLaunchAction-0" = { + PBXLSLaunchAction = 0; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXLSRunLaunchConfig; + commandLineArgs = ( + ); + displayName = "Executable Runner"; + environment = { + }; + identifier = com.apple.Xcode.launch.runConfig; + remoteHostInfo = ""; + startActionInfo = ""; + }; + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + dylibVariantSuffix = ""; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = KinectJNI; + savedGlobals = { + }; + showTypeColumn = 0; + sourceDirectories = ( + ); + startupPath = "<>"; + }; + 89D0F2CE0F40E7A1007831A7 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + 89D0F2CF0F40E7A1007831A7 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 8D1107260486CEB800E47090 /* Assemble Application */ = { + activeExec = 0; + executables = ( + 89D0F2C50F40E784007831A7 /* KinectJNI */, + ); + }; +} diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/default.pbxuser b/KinectJNI_v0002/KinectJNI.xcodeproj/default.pbxuser new file mode 100644 index 0000000..a0efb26 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/default.pbxuser @@ -0,0 +1,151 @@ +// !$*UTF8*$! +{ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = 89D0F2C50F40E784007831A7 /* KinectJNI */; + activeTarget = 89D0F1C90F3B704E007831A7 /* KinectJNI */; + codeSenseManager = 89D0F2CF0F40E7A1007831A7 /* Code sense */; + executables = ( + 89D0F2C50F40E784007831A7 /* KinectJNI */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; + PBXFileTableDataSourceColumnWidthsKey = ( + 22, + 300, + 131, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXExecutablesDataSource_ActiveFlagID, + PBXExecutablesDataSource_NameID, + PBXExecutablesDataSource_CommentsID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 243, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 203, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 255911812; + PBXWorkspaceStateSaveDate = 255911812; + }; + sourceControlManager = 89D0F2CE0F40E7A1007831A7 /* Source Control */; + userBuildSettings = { + }; + }; + 89D0F0230F392F20007831A7 /* Info.plist */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {863, 821}}"; + sepNavSelRange = "{332, 0}"; + sepNavVisRange = "{0, 1078}"; + sepNavWindowFrame = "{{15, -5}, {922, 878}}"; + }; + }; + 89D0F0480F393A6F007831A7 /* Compile Java */ = { + activeExec = 0; + }; + 89D0F04F0F393AD9007831A7 /* Compile Native */ = { + activeExec = 0; + }; + 89D0F1C90F3B704E007831A7 /* KinectJNI */ = { + activeExec = 0; + }; + 89D0F2C50F40E784007831A7 /* KinectJNI */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + "PBXLSLaunchAction-0" = { + PBXLSLaunchAction = 0; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXLSRunLaunchConfig; + commandLineArgs = ( + ); + displayName = "Executable Runner"; + environment = { + }; + identifier = com.apple.Xcode.launch.runConfig; + remoteHostInfo = ""; + startActionInfo = ""; + }; + }; + customDataFormattersEnabled = 1; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + dylibVariantSuffix = ""; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = "KinectJNI"; + sourceDirectories = ( + ); + startupPath = "<>"; + }; + 89D0F2CE0F40E7A1007831A7 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + }; + }; + 89D0F2CF0F40E7A1007831A7 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 8D1107260486CEB800E47090 /* Assemble Application */ = { + activeExec = 0; + executables = ( + 89D0F2C50F40E784007831A7 /* KinectJNI */, + ); + }; +} diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/itpstudent.mode1v3 b/KinectJNI_v0002/KinectJNI.xcodeproj/itpstudent.mode1v3 new file mode 100644 index 0000000..61abe9c --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/itpstudent.mode1v3 @@ -0,0 +1,1392 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + C92E5B2C12B95A3F00817239 + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-target-popup + active-buildstyle-popup + action + NSToolbarFlexibleSpaceItem + buildOrClean + build-and-goOrGo + com.apple.ide.PBXToolbarStopButton + get-info + toggle-editor + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 329 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 89D0F0260F392F48007831A7 + 89D0F0280F392F48007831A7 + 89D0F0200F392F20007831A7 + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 1 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {329, 577}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {346, 595}} + GroupTreeTableConfiguration + + MainColumn + 329 + + RubberWindowFrame + 566 410 947 636 0 0 1920 1178 + + Module + PBXSmartGroupTreeModule + Proportion + 346pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + NativeKinect.cpp + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + NativeKinect.cpp + _historyCapacity + 0 + bookmark + C94B6D7512D5055D00AE6F57 + history + + C94B6D7412D5055D00AE6F57 + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {596, 417}} + RubberWindowFrame + 566 410 947 636 0 0 1920 1178 + + Module + PBXNavigatorGroup + Proportion + 417pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 422}, {596, 173}} + RubberWindowFrame + 566 410 947 636 0 0 1920 1178 + + Module + XCDetailModule + Proportion + 173pt + + + Proportion + 596pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + C94B6D7612D5055D00AE6F57 + 1CE0B1FE06471DED0097A5F4 + C94B6D7712D5055D00AE6F57 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + C92E5B2D12B95A3F00817239 + /Users/itpstudent/Dropbox/kinect/github/shiffman.libfreenect/libfreenect/wrappers/java/processing/KinectJNI_v0002/KinectJNI.xcodeproj + + WindowString + 566 410 947 636 0 0 1920 1178 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + NativeKinect.cpp + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {1054, 125}} + RubberWindowFrame + 587 616 1054 407 0 0 1920 1178 + + Module + PBXNavigatorGroup + Proportion + 125pt + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 130}, {1054, 236}} + RubberWindowFrame + 587 616 1054 407 0 0 1920 1178 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 366pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + C92E5B2D12B95A3F00817239 + C94B6D7312D5054E00AE6F57 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowString + 587 616 1054 407 0 0 1920 1178 + WindowToolGUID + C92E5B2D12B95A3F00817239 + WindowToolIsVisible + + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debugger + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {316, 185}} + {{316, 0}, {378, 185}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 185}} + {{0, 185}, {694, 196}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 381}} + PBXDebugSessionStackFrameViewKey + + DebugVariablesTableConfiguration + + Name + 120 + Value + 85 + Summary + 148 + + Frame + {{316, 0}, {378, 185}} + RubberWindowFrame + 587 601 694 422 0 0 1920 1178 + + RubberWindowFrame + 587 601 694 422 0 0 1920 1178 + + Module + PBXDebugSessionModule + Proportion + 381pt + + + Proportion + 381pt + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + + TableOfContents + + 1CD10A99069EF8BA00B06720 + C92E5B3112B95AA000817239 + 1C162984064C10D400B95A72 + C92E5B3212B95AA000817239 + C92E5B3312B95AA000817239 + C92E5B3412B95AA000817239 + C92E5B3512B95AA000817239 + C92E5B3612B95AA000817239 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 587 601 694 422 0 0 1920 1178 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + + + + Identifier + windowTool.find + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD0528D0623707200166675 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {781, 167}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 50% + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{8, 0}, {773, 254}} + RubberWindowFrame + 62 385 781 470 0 0 1440 878 + + Module + PBXProjectFindModule + Proportion + 50% + + + Proportion + 428pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C530D57069F1CE1000CFCEE + 1C530D58069F1CE1000CFCEE + 1C530D59069F1CE1000CFCEE + 1CDD528C0622207200134675 + 1C530D5A069F1CE1000CFCEE + 1CE0B1FE06471DED0097A5F4 + 1CD0528E0623707200166675 + + WindowString + 62 385 781 470 0 0 1440 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + 0 + + + Identifier + MENUSEPARATOR + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debuggerConsole + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {650, 209}} + RubberWindowFrame + 587 773 650 250 0 0 1920 1178 + + Module + PBXDebugCLIModule + Proportion + 209pt + + + Proportion + 209pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + + TableOfContents + + 1C78EAAD065D492600B07095 + C92E5B3712B95AA000817239 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 587 773 650 250 0 0 1920 1178 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/itpstudent.pbxuser b/KinectJNI_v0002/KinectJNI.xcodeproj/itpstudent.pbxuser new file mode 100644 index 0000000..0cdf784 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/itpstudent.pbxuser @@ -0,0 +1,180 @@ +// !$*UTF8*$! +{ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + activeBuildConfigurationName = Debug; + activeExecutable = 89D0F2C50F40E784007831A7 /* KinectJNI */; + activeTarget = 89D0F1C90F3B704E007831A7 /* KinectJNI */; + codeSenseManager = 89D0F2CF0F40E7A1007831A7 /* Code sense */; + executables = ( + 89D0F2C50F40E784007831A7 /* KinectJNI */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; + PBXFileTableDataSourceColumnWidthsKey = ( + 22, + 300, + 131, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXExecutablesDataSource_ActiveFlagID, + PBXExecutablesDataSource_NameID, + PBXExecutablesDataSource_CommentsID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 357, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 203, + 60, + 20, + 48, + 43, + 43, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXTargetDataSource_PrimaryAttribute, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 315950397; + PBXWorkspaceStateSaveDate = 315950397; + }; + perUserProjectItems = { + C94B6D7412D5055D00AE6F57 /* PBXTextBookmark */ = C94B6D7412D5055D00AE6F57 /* PBXTextBookmark */; + C94B6D7512D5055D00AE6F57 /* PBXTextBookmark */ = C94B6D7512D5055D00AE6F57 /* PBXTextBookmark */; + }; + sourceControlManager = 89D0F2CE0F40E7A1007831A7 /* Source Control */; + userBuildSettings = { + }; + }; + 65D3607512907E910032D2A2 /* NativeKinect.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {993, 266}}"; + sepNavSelRange = "{165, 82}"; + sepNavVisRange = "{137, 111}"; + }; + }; + 89D0F0230F392F20007831A7 /* Info.plist */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {863, 821}}"; + sepNavSelRange = "{332, 0}"; + sepNavVisRange = "{0, 1078}"; + sepNavWindowFrame = "{{15, -5}, {922, 878}}"; + }; + }; + 89D0F0480F393A6F007831A7 /* Compile Java */ = { + activeExec = 0; + }; + 89D0F04F0F393AD9007831A7 /* Compile Native */ = { + activeExec = 0; + }; + 89D0F1C90F3B704E007831A7 /* KinectJNI */ = { + activeExec = 0; + }; + 89D0F2C50F40E784007831A7 /* KinectJNI */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + "PBXLSLaunchAction-0" = { + PBXLSLaunchAction = 0; + PBXLSLaunchStartAction = 1; + PBXLSLaunchStdioStyle = 2; + PBXLSLaunchStyle = 0; + class = PBXLSRunLaunchConfig; + commandLineArgs = ( + ); + displayName = "Executable Runner"; + environment = { + }; + identifier = com.apple.Xcode.launch.runConfig; + remoteHostInfo = ""; + startActionInfo = ""; + }; + }; + customDataFormattersEnabled = 1; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + dylibVariantSuffix = ""; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = KinectJNI; + sourceDirectories = ( + ); + startupPath = "<>"; + }; + 89D0F2CE0F40E7A1007831A7 /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + }; + }; + 89D0F2CF0F40E7A1007831A7 /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + 8D1107260486CEB800E47090 /* Assemble Application */ = { + activeExec = 0; + executables = ( + 89D0F2C50F40E784007831A7 /* KinectJNI */, + ); + }; + C94B6D7412D5055D00AE6F57 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + comments = "error: shiffman_kinect_NativeKinect.h: No such file or directory"; + fRef = 65D3607512907E910032D2A2 /* NativeKinect.cpp */; + rLen = 1; + rLoc = 11; + rType = 1; + }; + C94B6D7512D5055D00AE6F57 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 65D3607512907E910032D2A2 /* NativeKinect.cpp */; + name = "NativeKinect.cpp: 12"; + rLen = 82; + rLoc = 165; + rType = 0; + vrLen = 361; + vrLoc = 0; + }; +} diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/project.pbxproj b/KinectJNI_v0002/KinectJNI.xcodeproj/project.pbxproj new file mode 100644 index 0000000..d7f10d3 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/project.pbxproj @@ -0,0 +1,799 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXAggregateTarget section */ + 89D0F1C90F3B704E007831A7 /* KinectJNI */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 89D0F1D20F3B7080007831A7 /* Build configuration list for PBXAggregateTarget "KinectJNI" */; + buildPhases = ( + ); + dependencies = ( + 89D0F1D10F3B7062007831A7 /* PBXTargetDependency */, + 89D0F1CF0F3B7062007831A7 /* PBXTargetDependency */, + 89D0F1CD0F3B7062007831A7 /* PBXTargetDependency */, + ); + name = KinectJNI; + productName = KinectJNI; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 24A9FEEC18D7A56A002751BD /* libusb-1.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 24A9FEEB18D7A56A002751BD /* libusb-1.0.a */; }; + 65415BAE1290A8AD00F30EBD /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65415BAD1290A8AD00F30EBD /* Carbon.framework */; }; + 65415BB01290A8AD00F30EBD /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65415BAF1290A8AD00F30EBD /* CoreFoundation.framework */; }; + 65415BB21290A8AD00F30EBD /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65415BB11290A8AD00F30EBD /* CoreServices.framework */; }; + 65415BF11290AB1500F30EBD /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65415BF01290AB1500F30EBD /* IOKit.framework */; }; + 65415CC21290AB4D00F30EBD /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65415CC11290AB4D00F30EBD /* AGL.framework */; }; + 65415CC41290AB4D00F30EBD /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65415CC31290AB4D00F30EBD /* AppKit.framework */; }; + 65415CC61290AB4D00F30EBD /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65415CC51290AB4D00F30EBD /* ApplicationServices.framework */; }; + 6564A71012B9B6DF0003A8AC /* cameras.c in Sources */ = {isa = PBXBuildFile; fileRef = 6564A70012B9B6DF0003A8AC /* cameras.c */; }; + 6564A71112B9B6DF0003A8AC /* core.c in Sources */ = {isa = PBXBuildFile; fileRef = 6564A70112B9B6DF0003A8AC /* core.c */; }; + 6564A71212B9B6DF0003A8AC /* freenect_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6564A70212B9B6DF0003A8AC /* freenect_internal.h */; }; + 6564A71512B9B6DF0003A8AC /* tilt.c in Sources */ = {isa = PBXBuildFile; fileRef = 6564A70612B9B6DF0003A8AC /* tilt.c */; }; + 6564A71612B9B6DF0003A8AC /* usb_libusb10.c in Sources */ = {isa = PBXBuildFile; fileRef = 6564A70712B9B6DF0003A8AC /* usb_libusb10.c */; }; + 6564A71712B9B6DF0003A8AC /* usb_libusb10.h in Headers */ = {isa = PBXBuildFile; fileRef = 6564A70812B9B6DF0003A8AC /* usb_libusb10.h */; }; + 6564A71812B9B6DF0003A8AC /* libusb.h in Headers */ = {isa = PBXBuildFile; fileRef = 6564A70D12B9B6DF0003A8AC /* libusb.h */; }; + 6564A71912B9B6DF0003A8AC /* usb-1.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6564A70F12B9B6DF0003A8AC /* usb-1.0.a */; }; + 6564A76212B9B82C0003A8AC /* org_openkinect_Context.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6564A75E12B9B82C0003A8AC /* org_openkinect_Context.cpp */; }; + 6564A76312B9B82C0003A8AC /* org_openkinect_Context.h in Headers */ = {isa = PBXBuildFile; fileRef = 6564A75F12B9B82C0003A8AC /* org_openkinect_Context.h */; }; + 6564A76412B9B82C0003A8AC /* org_openkinect_Device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6564A76012B9B82C0003A8AC /* org_openkinect_Device.cpp */; }; + 6564A76512B9B82C0003A8AC /* org_openkinect_Device.h in Headers */ = {isa = PBXBuildFile; fileRef = 6564A76112B9B82C0003A8AC /* org_openkinect_Device.h */; }; + 6564A79912B9BAB10003A8AC /* libfreenect.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 6564A79712B9BAB10003A8AC /* libfreenect.hpp */; }; + 6564A79A12B9BAB10003A8AC /* libfreenect.h in Headers */ = {isa = PBXBuildFile; fileRef = 6564A79812B9BAB10003A8AC /* libfreenect.h */; }; + 65D3607612907E910032D2A2 /* NativeKinect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D3607412907E910032D2A2 /* NativeKinect.h */; }; + 65D3607712907E910032D2A2 /* NativeKinect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65D3607512907E910032D2A2 /* NativeKinect.cpp */; }; + 89C3F2920F5250A300B0048E /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 89C3F2900F5250A300B0048E /* Credits.rtf */; }; + 89D0F0240F392F20007831A7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 89D0F0210F392F20007831A7 /* InfoPlist.strings */; }; + 89D0F0410F39306C007831A7 /* JavaApplicationStub in Copy Executable */ = {isa = PBXBuildFile; fileRef = 89D0F03E0F39304A007831A7 /* JavaApplicationStub */; }; + 89D0F05C0F39404F007831A7 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 89D0F0850F394066007831A7 /* JavaNativeFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89D0F0840F394066007831A7 /* JavaNativeFoundation.framework */; }; + 89D0F11C0F394183007831A7 /* libKinect.jnilib in Copy Java Resources */ = {isa = PBXBuildFile; fileRef = 89D0F0500F393AD9007831A7 /* libKinect.jnilib */; }; + 89D0F1870F3A2442007831A7 /* JavaVM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89D0F1860F3A2442007831A7 /* JavaVM.framework */; }; + 89D0F1BF0F3B68AD007831A7 /* GenericApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 89D0F1BE0F3B68AD007831A7 /* GenericApp.icns */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 89D0F1CC0F3B7062007831A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8D1107260486CEB800E47090; + remoteInfo = "Assemble Application"; + }; + 89D0F1CE0F3B7062007831A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 89D0F04F0F393AD9007831A7; + remoteInfo = "Compile Native"; + }; + 89D0F1D00F3B7062007831A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 89D0F0480F393A6F007831A7; + remoteInfo = "Compile Java"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 89D0F0440F393070007831A7 /* Copy Executable */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 6; + files = ( + 89D0F0410F39306C007831A7 /* JavaApplicationStub in Copy Executable */, + ); + name = "Copy Executable"; + runOnlyForDeploymentPostprocessing = 0; + }; + 89D0F11F0F394189007831A7 /* Copy Java Resources */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 15; + files = ( + 89D0F11C0F394183007831A7 /* libKinect.jnilib in Copy Java Resources */, + ); + name = "Copy Java Resources"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 24A9FEEB18D7A56A002751BD /* libusb-1.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libusb-1.0.a"; path = "src/libusb/osx/libs/libusb-1.0.a"; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 653A255112906EFD007E71A5 /* Manifest */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Manifest; sourceTree = ""; }; + 65415BAD1290A8AD00F30EBD /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 65415BAF1290A8AD00F30EBD /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; + 65415BB11290A8AD00F30EBD /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; + 65415BF01290AB1500F30EBD /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = ../../../../../../../../../System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 65415CC11290AB4D00F30EBD /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = ../../../../../../../../../System/Library/Frameworks/AGL.framework; sourceTree = SDKROOT; }; + 65415CC31290AB4D00F30EBD /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = ../../../../../../../../../System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 65415CC51290AB4D00F30EBD /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = ../../../../../../../../../System/Library/Frameworks/ApplicationServices.framework; sourceTree = SDKROOT; }; + 6564A70012B9B6DF0003A8AC /* cameras.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cameras.c; sourceTree = ""; }; + 6564A70112B9B6DF0003A8AC /* core.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = core.c; sourceTree = ""; }; + 6564A70212B9B6DF0003A8AC /* freenect_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = freenect_internal.h; sourceTree = ""; }; + 6564A70512B9B6DF0003A8AC /* libfreenect.pc.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = libfreenect.pc.in; sourceTree = ""; }; + 6564A70612B9B6DF0003A8AC /* tilt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tilt.c; sourceTree = ""; }; + 6564A70712B9B6DF0003A8AC /* usb_libusb10.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = usb_libusb10.c; sourceTree = ""; }; + 6564A70812B9B6DF0003A8AC /* usb_libusb10.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = usb_libusb10.h; sourceTree = ""; }; + 6564A70D12B9B6DF0003A8AC /* libusb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libusb.h; sourceTree = ""; }; + 6564A70F12B9B6DF0003A8AC /* usb-1.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "usb-1.0.a"; sourceTree = ""; }; + 6564A72812B9B72C0003A8AC /* usb-1.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "usb-1.0.a"; path = "src/libusb/osx/libs/usb-1.0.a"; sourceTree = ""; }; + 6564A75E12B9B82C0003A8AC /* org_openkinect_Context.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = org_openkinect_Context.cpp; sourceTree = ""; }; + 6564A75F12B9B82C0003A8AC /* org_openkinect_Context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = org_openkinect_Context.h; sourceTree = ""; }; + 6564A76012B9B82C0003A8AC /* org_openkinect_Device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = org_openkinect_Device.cpp; sourceTree = ""; }; + 6564A76112B9B82C0003A8AC /* org_openkinect_Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = org_openkinect_Device.h; sourceTree = ""; }; + 6564A79712B9BAB10003A8AC /* libfreenect.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libfreenect.hpp; sourceTree = ""; }; + 6564A79812B9BAB10003A8AC /* libfreenect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libfreenect.h; sourceTree = ""; }; + 6564A7CF12B9BD040003A8AC /* Example.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Example.java; sourceTree = ""; }; + 6564A7D212B9BD040003A8AC /* Acceleration.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Acceleration.java; sourceTree = ""; }; + 6564A7D312B9BD040003A8AC /* ColorFormat.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = ColorFormat.java; sourceTree = ""; }; + 6564A7D412B9BD040003A8AC /* Context.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Context.java; sourceTree = ""; }; + 6564A7D512B9BD040003A8AC /* DepthFormat.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = DepthFormat.java; sourceTree = ""; }; + 6564A7D612B9BD040003A8AC /* Device.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Device.java; sourceTree = ""; }; + 6564A7D712B9BD040003A8AC /* Image.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Image.java; sourceTree = ""; }; + 6564A7D812B9BD040003A8AC /* LEDStatus.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = LEDStatus.java; sourceTree = ""; }; + 6564A7D912B9BD040003A8AC /* Logger.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Logger.java; sourceTree = ""; }; + 6564A7DA12B9BD040003A8AC /* LogLevel.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = LogLevel.java; sourceTree = ""; }; + 65D35FCA129077490032D2A2 /* KinectJNI.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; name = KinectJNI.java; path = java/shiffman/kinect/KinectJNI.java; sourceTree = ""; }; + 65D35FCF129077670032D2A2 /* NativeKinect.java */ = {isa = PBXFileReference; explicitFileType = sourcecode.java; fileEncoding = 4; name = NativeKinect.java; path = java/shiffman/kinect/NativeKinect.java; sourceTree = ""; }; + 65D3607412907E910032D2A2 /* NativeKinect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeKinect.h; sourceTree = ""; }; + 65D3607512907E910032D2A2 /* NativeKinect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeKinect.cpp; sourceTree = ""; }; + 89B60E390F414E1200C86CA9 /* lib */ = {isa = PBXFileReference; lastKnownFileType = folder; name = lib; path = "Library/Xcode/Project Templates/Java/JNI Application/lib"; sourceTree = DEVELOPER_DIR; }; + 89C3F2910F5250A300B0048E /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; + 89D0F0220F392F20007831A7 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 89D0F0230F392F20007831A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 89D0F03E0F39304A007831A7 /* JavaApplicationStub */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = JavaApplicationStub; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub; sourceTree = ""; }; + 89D0F0500F393AD9007831A7 /* libKinect.jnilib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libKinect.jnilib; sourceTree = BUILT_PRODUCTS_DIR; }; + 89D0F0840F394066007831A7 /* JavaNativeFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaNativeFoundation.framework; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework; sourceTree = ""; }; + 89D0F0870F39408C007831A7 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = /System/Library/Frameworks/AddressBook.framework; sourceTree = ""; }; + 89D0F1390F3948A9007831A7 /* make */ = {isa = PBXFileReference; lastKnownFileType = folder; path = make; sourceTree = ""; }; + 89D0F1860F3A2442007831A7 /* JavaVM.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaVM.framework; path = /System/Library/Frameworks/JavaVM.framework; sourceTree = ""; }; + 89D0F1BE0F3B68AD007831A7 /* GenericApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = GenericApp.icns; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/GenericApp.icns; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* KinectJNI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KinectJNI.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 89D0F04E0F393AD9007831A7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 24A9FEEC18D7A56A002751BD /* libusb-1.0.a in Frameworks */, + 89D0F05C0F39404F007831A7 /* Cocoa.framework in Frameworks */, + 89D0F0850F394066007831A7 /* JavaNativeFoundation.framework in Frameworks */, + 89D0F1870F3A2442007831A7 /* JavaVM.framework in Frameworks */, + 65415BAE1290A8AD00F30EBD /* Carbon.framework in Frameworks */, + 65415BB01290A8AD00F30EBD /* CoreFoundation.framework in Frameworks */, + 65415BB21290A8AD00F30EBD /* CoreServices.framework in Frameworks */, + 65415BF11290AB1500F30EBD /* IOKit.framework in Frameworks */, + 65415CC21290AB4D00F30EBD /* AGL.framework in Frameworks */, + 65415CC41290AB4D00F30EBD /* AppKit.framework in Frameworks */, + 65415CC61290AB4D00F30EBD /* ApplicationServices.framework in Frameworks */, + 6564A71912B9B6DF0003A8AC /* usb-1.0.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { + isa = PBXGroup; + children = ( + 89D0F0870F39408C007831A7 /* AddressBook.framework */, + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + 89D0F1860F3A2442007831A7 /* JavaVM.framework */, + 89D0F0840F394066007831A7 /* JavaNativeFoundation.framework */, + ); + name = "Linked Frameworks"; + sourceTree = ""; + }; + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 24A9FEEB18D7A56A002751BD /* libusb-1.0.a */, + 6564A72812B9B72C0003A8AC /* usb-1.0.a */, + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 89D0F0500F393AD9007831A7 /* libKinect.jnilib */, + 8D1107320486CEB800E47090 /* KinectJNI.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* KinectJNI */ = { + isa = PBXGroup; + children = ( + 89D0F0260F392F48007831A7 /* Source */, + 89D0F0200F392F20007831A7 /* Resources */, + 89D0F1390F3948A9007831A7 /* make */, + 89B60E390F414E1200C86CA9 /* lib */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + 65415BAD1290A8AD00F30EBD /* Carbon.framework */, + 65415BAF1290A8AD00F30EBD /* CoreFoundation.framework */, + 65415BB11290A8AD00F30EBD /* CoreServices.framework */, + 65415BF01290AB1500F30EBD /* IOKit.framework */, + 65415CC11290AB4D00F30EBD /* AGL.framework */, + 65415CC31290AB4D00F30EBD /* AppKit.framework */, + 65415CC51290AB4D00F30EBD /* ApplicationServices.framework */, + ); + name = KinectJNI; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, + 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6564A6FF12B9B6DF0003A8AC /* libfreenect */ = { + isa = PBXGroup; + children = ( + 6564A79712B9BAB10003A8AC /* libfreenect.hpp */, + 6564A79812B9BAB10003A8AC /* libfreenect.h */, + 6564A70012B9B6DF0003A8AC /* cameras.c */, + 6564A70112B9B6DF0003A8AC /* core.c */, + 6564A70212B9B6DF0003A8AC /* freenect_internal.h */, + 6564A70512B9B6DF0003A8AC /* libfreenect.pc.in */, + 6564A70612B9B6DF0003A8AC /* tilt.c */, + 6564A70712B9B6DF0003A8AC /* usb_libusb10.c */, + 6564A70812B9B6DF0003A8AC /* usb_libusb10.h */, + ); + path = libfreenect; + sourceTree = ""; + }; + 6564A70912B9B6DF0003A8AC /* libusb */ = { + isa = PBXGroup; + children = ( + 6564A70A12B9B6DF0003A8AC /* osx */, + ); + path = libusb; + sourceTree = ""; + }; + 6564A70A12B9B6DF0003A8AC /* osx */ = { + isa = PBXGroup; + children = ( + 6564A70B12B9B6DF0003A8AC /* include */, + 6564A70E12B9B6DF0003A8AC /* libs */, + ); + path = osx; + sourceTree = ""; + }; + 6564A70B12B9B6DF0003A8AC /* include */ = { + isa = PBXGroup; + children = ( + 6564A70C12B9B6DF0003A8AC /* libusb-1.0 */, + ); + path = include; + sourceTree = ""; + }; + 6564A70C12B9B6DF0003A8AC /* libusb-1.0 */ = { + isa = PBXGroup; + children = ( + 6564A70D12B9B6DF0003A8AC /* libusb.h */, + ); + path = "libusb-1.0"; + sourceTree = ""; + }; + 6564A70E12B9B6DF0003A8AC /* libs */ = { + isa = PBXGroup; + children = ( + 6564A70F12B9B6DF0003A8AC /* usb-1.0.a */, + ); + path = libs; + sourceTree = ""; + }; + 6564A7D012B9BD040003A8AC /* org */ = { + isa = PBXGroup; + children = ( + 6564A7D112B9BD040003A8AC /* openkinect */, + ); + path = org; + sourceTree = ""; + }; + 6564A7D112B9BD040003A8AC /* openkinect */ = { + isa = PBXGroup; + children = ( + 6564A7D212B9BD040003A8AC /* Acceleration.java */, + 6564A7D312B9BD040003A8AC /* ColorFormat.java */, + 6564A7D412B9BD040003A8AC /* Context.java */, + 6564A7D512B9BD040003A8AC /* DepthFormat.java */, + 6564A7D612B9BD040003A8AC /* Device.java */, + 6564A7D712B9BD040003A8AC /* Image.java */, + 6564A7D812B9BD040003A8AC /* LEDStatus.java */, + 6564A7D912B9BD040003A8AC /* Logger.java */, + 6564A7DA12B9BD040003A8AC /* LogLevel.java */, + ); + path = openkinect; + sourceTree = ""; + }; + 6598C511129067A9009C53C6 /* java */ = { + isa = PBXGroup; + children = ( + 6564A7CF12B9BD040003A8AC /* Example.java */, + 6564A7D012B9BD040003A8AC /* org */, + 65D35FC6129076F30032D2A2 /* shiffman */, + ); + name = java; + sourceTree = ""; + }; + 65D35FC6129076F30032D2A2 /* shiffman */ = { + isa = PBXGroup; + children = ( + 65D35FC7129076F80032D2A2 /* kinect */, + ); + name = shiffman; + sourceTree = ""; + }; + 65D35FC7129076F80032D2A2 /* kinect */ = { + isa = PBXGroup; + children = ( + 65D35FCF129077670032D2A2 /* NativeKinect.java */, + 65D35FCA129077490032D2A2 /* KinectJNI.java */, + ); + name = kinect; + sourceTree = ""; + }; + 89D0F0200F392F20007831A7 /* Resources */ = { + isa = PBXGroup; + children = ( + 653A255112906EFD007E71A5 /* Manifest */, + 89C3F2900F5250A300B0048E /* Credits.rtf */, + 89D0F0230F392F20007831A7 /* Info.plist */, + 89D0F0210F392F20007831A7 /* InfoPlist.strings */, + 89D0F03E0F39304A007831A7 /* JavaApplicationStub */, + 89D0F1BE0F3B68AD007831A7 /* GenericApp.icns */, + ); + name = Resources; + path = resources; + sourceTree = ""; + }; + 89D0F0260F392F48007831A7 /* Source */ = { + isa = PBXGroup; + children = ( + 6564A6FF12B9B6DF0003A8AC /* libfreenect */, + 6564A70912B9B6DF0003A8AC /* libusb */, + 6598C511129067A9009C53C6 /* java */, + 89D0F0280F392F48007831A7 /* native */, + ); + name = Source; + path = src; + sourceTree = ""; + }; + 89D0F0280F392F48007831A7 /* native */ = { + isa = PBXGroup; + children = ( + 6564A75E12B9B82C0003A8AC /* org_openkinect_Context.cpp */, + 6564A75F12B9B82C0003A8AC /* org_openkinect_Context.h */, + 6564A76012B9B82C0003A8AC /* org_openkinect_Device.cpp */, + 6564A76112B9B82C0003A8AC /* org_openkinect_Device.h */, + 65D3607412907E910032D2A2 /* NativeKinect.h */, + 65D3607512907E910032D2A2 /* NativeKinect.cpp */, + ); + path = native; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 89D0F04C0F393AD9007831A7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 65D3607612907E910032D2A2 /* NativeKinect.h in Headers */, + 6564A71212B9B6DF0003A8AC /* freenect_internal.h in Headers */, + 6564A71712B9B6DF0003A8AC /* usb_libusb10.h in Headers */, + 6564A71812B9B6DF0003A8AC /* libusb.h in Headers */, + 6564A76312B9B82C0003A8AC /* org_openkinect_Context.h in Headers */, + 6564A76512B9B82C0003A8AC /* org_openkinect_Device.h in Headers */, + 6564A79912B9BAB10003A8AC /* libfreenect.hpp in Headers */, + 6564A79A12B9BAB10003A8AC /* libfreenect.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXLegacyTarget section */ + 89D0F0480F393A6F007831A7 /* Compile Java */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "-e -f \"${SRCROOT}/make/build.xml\" -debug \"$ACTION\""; + buildConfigurationList = 89D0F04B0F393AB7007831A7 /* Build configuration list for PBXLegacyTarget "Compile Java" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/ant; + buildWorkingDirectory = ""; + dependencies = ( + ); + name = "Compile Java"; + passBuildSettingsInEnvironment = 1; + productName = "Compile Java"; + }; +/* End PBXLegacyTarget section */ + +/* Begin PBXNativeTarget section */ + 89D0F04F0F393AD9007831A7 /* Compile Native */ = { + isa = PBXNativeTarget; + buildConfigurationList = 89D0F0530F393AF8007831A7 /* Build configuration list for PBXNativeTarget "Compile Native" */; + buildPhases = ( + 89D0F1360F394748007831A7 /* Run javah */, + 89D0F04C0F393AD9007831A7 /* Headers */, + 89D0F04D0F393AD9007831A7 /* Sources */, + 89D0F04E0F393AD9007831A7 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Compile Native"; + productName = "Compile Native"; + productReference = 89D0F0500F393AD9007831A7 /* libKinect.jnilib */; + productType = "com.apple.product-type.library.dynamic"; + }; + 8D1107260486CEB800E47090 /* Assemble Application */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Assemble Application" */; + buildPhases = ( + 89D0F0440F393070007831A7 /* Copy Executable */, + 89D0F11F0F394189007831A7 /* Copy Java Resources */, + 8D1107290486CEB800E47090 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Assemble Application"; + productInstallPath = "$(HOME)/Applications"; + productName = KinectJNI; + productReference = 8D1107320486CEB800E47090 /* KinectJNI.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "KinectJNI" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* KinectJNI */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 89D0F1C90F3B704E007831A7 /* KinectJNI */, + 89D0F0480F393A6F007831A7 /* Compile Java */, + 89D0F04F0F393AD9007831A7 /* Compile Native */, + 8D1107260486CEB800E47090 /* Assemble Application */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 89D0F0240F392F20007831A7 /* InfoPlist.strings in Resources */, + 89D0F1BF0F3B68AD007831A7 /* GenericApp.icns in Resources */, + 89C3F2920F5250A300B0048E /* Credits.rtf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 89D0F1360F394748007831A7 /* Run javah */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run javah"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# find the jar file to dig into\nJAR_TO_JAVAH=\"${BUILT_PRODUCTS_DIR}/AddressBook.jar\"\n\n# use a helper script to list all classes inside the jar, and all classes referenced by those classes\nCLASS_LIST=`\"${SRCROOT}/make/find-classrefs.sh\" \"${JAR_TO_JAVAH}\" | xargs`\n\n# run javah for all classes inside the jar, and all classes referenced by those classes\njavah -verbose -jni -classpath \"${JAR_TO_JAVAH}\" -d \"${DERIVED_SOURCES_DIR}\" ${CLASS_LIST}"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 89D0F04D0F393AD9007831A7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 65D3607712907E910032D2A2 /* NativeKinect.cpp in Sources */, + 6564A71012B9B6DF0003A8AC /* cameras.c in Sources */, + 6564A71112B9B6DF0003A8AC /* core.c in Sources */, + 6564A71512B9B6DF0003A8AC /* tilt.c in Sources */, + 6564A71612B9B6DF0003A8AC /* usb_libusb10.c in Sources */, + 6564A76212B9B82C0003A8AC /* org_openkinect_Context.cpp in Sources */, + 6564A76412B9B82C0003A8AC /* org_openkinect_Device.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 89D0F1CD0F3B7062007831A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8D1107260486CEB800E47090 /* Assemble Application */; + targetProxy = 89D0F1CC0F3B7062007831A7 /* PBXContainerItemProxy */; + }; + 89D0F1CF0F3B7062007831A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 89D0F04F0F393AD9007831A7 /* Compile Native */; + targetProxy = 89D0F1CE0F3B7062007831A7 /* PBXContainerItemProxy */; + }; + 89D0F1D10F3B7062007831A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 89D0F0480F393A6F007831A7 /* Compile Java */; + targetProxy = 89D0F1D00F3B7062007831A7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 89C3F2900F5250A300B0048E /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 89C3F2910F5250A300B0048E /* English */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + 89D0F0210F392F20007831A7 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 89D0F0220F392F20007831A7 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 89D0F0490F393A6F007831A7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = AddressBook; + }; + name = Debug; + }; + 89D0F04A0F393A6F007831A7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = kinect; + }; + name = Release; + }; + 89D0F0510F393ADA007831A7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = jnilib; + EXECUTABLE_PREFIX = lib; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"", + ); + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + HEADER_SEARCH_PATHS = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Headers\""; + INSTALL_PATH = /usr/local/lib; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/opt/local/lib/**", + "\"$(SRCROOT)/src/libs/libusb/osx/libs\"", + "\"$(SRCROOT)/src/libusb/osx/libs\"", + "$(SRCROOT)", + "$(PROJECT_DIR)/src/libusb/osx/libs", + ); + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + PREBINDING = NO; + PRODUCT_NAME = Kinect; + SDKROOT = macosx; + VALID_ARCHS = "x86_64 i386"; + }; + name = Debug; + }; + 89D0F0520F393ADA007831A7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + EXECUTABLE_EXTENSION = jnilib; + EXECUTABLE_PREFIX = lib; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/Frameworks\"", + ); + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + HEADER_SEARCH_PATHS = "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Headers\""; + INSTALL_PATH = /usr/local/lib; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "/opt/local/lib/**", + "\"$(SRCROOT)/src/libs/libusb/osx/libs\"", + "\"$(SRCROOT)/src/libusb/osx/libs\"", + "$(SRCROOT)", + "$(PROJECT_DIR)/src/libusb/osx/libs", + ); + OTHER_LDFLAGS = ( + "-framework", + Foundation, + "-framework", + AppKit, + ); + PREBINDING = NO; + PRODUCT_NAME = Kinect; + SDKROOT = macosx; + VALID_ARCHS = "x86_64 i386"; + }; + name = Release; + }; + 89D0F1CA0F3B704F007831A7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = KinectJNI; + }; + name = Debug; + }; + 89D0F1CB0F3B704F007831A7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = KinectJNI; + }; + name = Release; + }; + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + INFOPLIST_FILE = resources/Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = KinectJNI; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + INFOPLIST_FILE = resources/Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + PRODUCT_NAME = KinectJNI; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = macosx10.9; + VALID_ARCHS = i386; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + PRODUCT_NAME = ""; + SDKROOT = macosx10.9; + VALID_ARCHS = i386; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 89D0F04B0F393AB7007831A7 /* Build configuration list for PBXLegacyTarget "Compile Java" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 89D0F0490F393A6F007831A7 /* Debug */, + 89D0F04A0F393A6F007831A7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 89D0F0530F393AF8007831A7 /* Build configuration list for PBXNativeTarget "Compile Native" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 89D0F0510F393ADA007831A7 /* Debug */, + 89D0F0520F393ADA007831A7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 89D0F1D20F3B7080007831A7 /* Build configuration list for PBXAggregateTarget "KinectJNI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 89D0F1CA0F3B704F007831A7 /* Debug */, + 89D0F1CB0F3B704F007831A7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Assemble Application" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "KinectJNI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..10e6a94 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcshareddata/KinectJNI.xccheckout b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcshareddata/KinectJNI.xccheckout new file mode 100644 index 0000000..2116a38 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcshareddata/KinectJNI.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + D0A5F31C-560B-4B1D-9E5A-68C14E638541 + IDESourceControlProjectName + KinectJNI + IDESourceControlProjectOriginsDictionary + + FD432709-5EB2-4BCB-8069-50347650746C + https://github.com/shiffman/libfreenect.git + + IDESourceControlProjectPath + wrappers/java/processing/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + FD432709-5EB2-4BCB-8069-50347650746C + ../../../../../.. + + IDESourceControlProjectURL + https://github.com/shiffman/libfreenect.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + FD432709-5EB2-4BCB-8069-50347650746C + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + FD432709-5EB2-4BCB-8069-50347650746C + IDESourceControlWCCName + libfreenect + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcuserdata/jespera.xcuserdatad/UserInterfaceState.xcuserstate b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcuserdata/jespera.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..dbea513 Binary files /dev/null and b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcuserdata/jespera.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcuserdata/jespera.xcuserdatad/WorkspaceSettings.xcsettings b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcuserdata/jespera.xcuserdatad/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..659c876 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/project.xcworkspace/xcuserdata/jespera.xcuserdatad/WorkspaceSettings.xcsettings @@ -0,0 +1,10 @@ + + + + + HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges + + SnapshotAutomaticallyBeforeSignificantChanges + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Assemble Application.xcscheme b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Assemble Application.xcscheme new file mode 100644 index 0000000..9dd0350 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Assemble Application.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Compile Java.xcscheme b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Compile Java.xcscheme new file mode 100644 index 0000000..7245df7 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Compile Java.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Compile Native.xcscheme b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Compile Native.xcscheme new file mode 100644 index 0000000..ce10628 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/Compile Native.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/KinectJNI.xcscheme b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/KinectJNI.xcscheme new file mode 100644 index 0000000..f248530 --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/KinectJNI.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/xcschememanagement.plist b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..00548fa --- /dev/null +++ b/KinectJNI_v0002/KinectJNI.xcodeproj/xcuserdata/jespera.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,52 @@ + + + + + SchemeUserState + + Assemble Application.xcscheme + + orderHint + 3 + + Compile Java.xcscheme + + orderHint + 1 + + Compile Native.xcscheme + + orderHint + 2 + + KinectJNI.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 89D0F0480F393A6F007831A7 + + primary + + + 89D0F04F0F393AD9007831A7 + + primary + + + 89D0F1C90F3B704E007831A7 + + primary + + + 8D1107260486CEB800E47090 + + primary + + + + + diff --git a/KinectJNI_v0002/lib/eawt-stubs.jar b/KinectJNI_v0002/lib/eawt-stubs.jar new file mode 100644 index 0000000..160d62b Binary files /dev/null and b/KinectJNI_v0002/lib/eawt-stubs.jar differ diff --git a/KinectJNI_v0002/make/build.xml b/KinectJNI_v0002/make/build.xml new file mode 100644 index 0000000..ee4b478 --- /dev/null +++ b/KinectJNI_v0002/make/build.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "Nothing to do for install-headers phase" + + diff --git a/KinectJNI_v0002/make/find-classrefs.sh b/KinectJNI_v0002/make/find-classrefs.sh new file mode 100755 index 0000000..2217580 --- /dev/null +++ b/KinectJNI_v0002/make/find-classrefs.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# Prints all class references made by all classes in a Jar file +# Depends on the output formatting of javap + +# create a temporary working directory +dir=`mktemp -d $TMPDIR/classrefs.XXXXXX` + +asm_dump="$dir/asm_dump" +all_classes="$dir/all_classes" + +# for each class in a Jar file, dump the full assembly +javap -c -classpath "$1" `/usr/bin/jar tf "$1" | grep "\.class" | sort | xargs | sed -e 's/\.class//g'` > $asm_dump + +# dump the initial list of all classes in the Jar file +/usr/bin/jar tf $1 | grep "\.class" | sed -e 's/\.class//g' >> $all_classes + +# dump all static class references +cat $asm_dump | grep //class | awk -F"//class " '{print $2}' | sort | uniq >> $all_classes + +# dump all references to classes made in methods +cat $asm_dump | grep //Method | awk -F"//Method " '{print $2}' | sort | uniq | grep "\." | awk -F"." '{print $1}' | sort | uniq >> $all_classes + +# dump all references to classes by direct field access +cat $asm_dump | grep //Field | awk -F"//Field " '{print $2}' | sort | uniq | grep "\:L" | awk -F"\:L" '{print $2}' | sort | uniq | awk -F"\;" '{print $1}' >> $all_classes + +# sort and reformat +sort $all_classes | uniq | grep -v "\"" | sed -e 's/\//\./g' + +# cleanup +rm -rf $dir diff --git a/KinectJNI_v0002/resources/English.lproj/Credits.rtf b/KinectJNI_v0002/resources/English.lproj/Credits.rtf new file mode 100644 index 0000000..46576ef --- /dev/null +++ b/KinectJNI_v0002/resources/English.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/KinectJNI_v0002/resources/English.lproj/InfoPlist.strings b/KinectJNI_v0002/resources/English.lproj/InfoPlist.strings new file mode 100644 index 0000000..4354263 Binary files /dev/null and b/KinectJNI_v0002/resources/English.lproj/InfoPlist.strings differ diff --git a/KinectJNI_v0002/resources/Info.plist b/KinectJNI_v0002/resources/Info.plist new file mode 100644 index 0000000..4e1f288 --- /dev/null +++ b/KinectJNI_v0002/resources/Info.plist @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + JavaApplicationStub + CFBundleIconFile + GenericApp.icns + CFBundleIdentifier + shiffman.kinect.KinectJNI + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + KinectJNI + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CFBundleShortVersionString + 1.0 + Java + + ClassPath + $JAVAROOT/AddressBook.jar + JVMVersion + 1.5+ + MainClass + shiffman.kinect.KinectJNI + Properties + + apple.laf.useScreenMenuBar + true + + + + diff --git a/KinectJNI_v0002/resources/Manifest b/KinectJNI_v0002/resources/Manifest new file mode 100644 index 0000000..02ff0b6 --- /dev/null +++ b/KinectJNI_v0002/resources/Manifest @@ -0,0 +1 @@ +Main-Class: shiffman.kinect.KinectJNI \ No newline at end of file diff --git a/KinectJNI_v0002/src/Example.java b/KinectJNI_v0002/src/Example.java new file mode 100644 index 0000000..6ad8aff --- /dev/null +++ b/KinectJNI_v0002/src/Example.java @@ -0,0 +1,214 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +import java.io.File; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ShortBuffer; +import javax.imageio.ImageIO; +import org.openkinect.Context; +import org.openkinect.Device; +import org.openkinect.Acceleration; +import org.openkinect.Image; +import org.openkinect.LEDStatus; + +/** + * @author Michael Nischt + */ +public class Example +{ + public static void main(String[] args) throws IOException + { + final int width = 640, height = 480; + final BufferedImage color = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); + final BufferedImage depth = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); + //final BufferedImage depth = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_GRAY); + + + Context context = Context.getContext(); + + if(context.devices() < 1) + { + System.out.println("No Kinect devices found."); + return; + } + + Device device = context.getDevice(0); + + device.light(LEDStatus.LED_GREEN); + device.tilt(-5); + + device.depth(new Image() + { + public void data(ByteBuffer image) + { + ShortBuffer data = image.asShortBuffer(); + + for(int y=0; y>8) { + case 0: + b = 255; + g = 255-lb; + r = 255-lb; + break; + case 1: + b = 255; + g = lb; + r = 0; + break; + case 2: + b = 255-lb; + g = 255; + r = 0; + break; + case 3: + b = 0; + g = 255; + r = lb; + break; + case 4: + b = 0; + g = 255-lb; + r = 255; + break; + case 5: + b = 0; + g = 0; + r = 255-lb; + break; + default: + r = 0; + g = 0; + b = 0; + break; + } + + int pixel = (0xFF) << 24 + | (b & 0xFF) << 16 + | (g & 0xFF) << 8 + | (r & 0xFF) << 0; + + return pixel; + } + + static int depth2intensity(short depth) + { + int d = Math.round((1 - (depth / 2047f)) * 255f); + int pixel = (0xFF) << 24 + | (d & 0xFF) << 16 + | (d & 0xFF) << 8 + | (d & 0xFF) << 0; + + return pixel; + } + +} \ No newline at end of file diff --git a/KinectJNI_v0002/src/java/shiffman/kinect/KinectJNI.java b/KinectJNI_v0002/src/java/shiffman/kinect/KinectJNI.java new file mode 100644 index 0000000..be70df6 --- /dev/null +++ b/KinectJNI_v0002/src/java/shiffman/kinect/KinectJNI.java @@ -0,0 +1,39 @@ +// +// KinectJNI.java +// KinectJNI +// +// Created by Daniel Shiffman on 11/14/10. +// Copyright (c) 2010 ITP. All rights reserved. +// +// For information on setting Java configuration information, including +// setting Java properties, refer to the documentation at +// http://developer.apple.com/techpubs/java/java.html +// + +package shiffman.kinect; + +/** + * @author daniel + */ +public class KinectJNI { + public static void main(final String[] args) throws InterruptedException{ + System.out.println("FUCK YAH " + NativeKinect.getNum()); + + /*NativeKinect.init(); + + int counter = 0; + while (true) { + NativeKinect.update(); + int[] pixels = NativeKinect.getPixels(); + Thread.sleep(100); + + int color = pixels[pixels.length/2]; + System.out.println("COUNTER: " + counter + " GOT PIXELS: " + pixels.length + " A color: " + color); + counter++; + if (counter > 300) { + break; + } + } + NativeKinect.close();*/ + } +} diff --git a/KinectJNI_v0002/src/java/shiffman/kinect/NativeAddressBook.java b/KinectJNI_v0002/src/java/shiffman/kinect/NativeAddressBook.java new file mode 100644 index 0000000..d5a07c9 --- /dev/null +++ b/KinectJNI_v0002/src/java/shiffman/kinect/NativeAddressBook.java @@ -0,0 +1,36 @@ +// +// NativeAddressBook.java +// KinectJNI +// +// Created by Daniel Shiffman on 11/14/10. +// Copyright (c) 2010 ITP. All rights reserved. +// + +package shiffman.kinect; + +import java.util.*; + +/** + * Abstraction for the Mac OS X AddressBook API + * + * Creates a copy of contacts from the address book, and vends Person + * objects. Uses JNI to obtain simple Lists, Maps, Strings, and Number + * representations of + * + * @author daniel + */ +public class NativeAddressBook { + static { + // ensure native JNI library is loaded + System.loadLibrary("Kinect"); + } + + // JNI method which obtains the UID of the "me" card in Address Book.app + private static native int getNumber(); + + public static int getNum() { + return getNumber(); + } + + +} diff --git a/KinectJNI_v0002/src/java/shiffman/kinect/NativeKinect.java b/KinectJNI_v0002/src/java/shiffman/kinect/NativeKinect.java new file mode 100644 index 0000000..45296fa --- /dev/null +++ b/KinectJNI_v0002/src/java/shiffman/kinect/NativeKinect.java @@ -0,0 +1,35 @@ +// +// NativeAddressBook.java +// KinectJNI +// +// Created by Daniel Shiffman on 11/14/10. +// Copyright (c) 2010 ITP. All rights reserved. +// + +package shiffman.kinect; + +import java.util.*; + +/** + * Abstraction for the Mac OS X AddressBook API + * + * Creates a copy of contacts from the address book, and vends Person + * objects. Uses JNI to obtain simple Lists, Maps, Strings, and Number + * representations of + * + * @author daniel + */ +public class NativeKinect { + static { + // ensure native JNI library is loaded + System.loadLibrary("Kinect"); + } + + // JNI method which obtains the UID of the "me" card in Address Book.app + private static native int getNumber(); + + public static int getNum() { + return getNumber(); + } + +} diff --git a/KinectJNI_v0002/src/libfreenect/cameras.c b/KinectJNI_v0002/src/libfreenect/cameras.c new file mode 100644 index 0000000..5039d3b --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/cameras.c @@ -0,0 +1,786 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#include +#include +#include +#include + +#include "freenect_internal.h" + +struct pkt_hdr { + uint8_t magic[2]; + uint8_t pad; + uint8_t flag; + uint8_t unk1; + uint8_t seq; + uint8_t unk2; + uint8_t unk3; + uint32_t timestamp; +}; + +extern const struct caminit inits[]; +extern const int num_inits; + +static int stream_process(freenect_context *ctx, packet_stream *strm, uint8_t *pkt, int len) +{ + if (len < 12) + return 0; + + struct pkt_hdr *hdr = (void*)pkt; + uint8_t *data = pkt + sizeof(*hdr); + int datalen = len - sizeof(*hdr); + + if (hdr->magic[0] != 'R' || hdr->magic[1] != 'B') { + FN_LOG(strm->valid_frames < 2 ? LL_SPEW : LL_NOTICE, \ + "[Stream %02x] Invalid magic %02x%02x\n", strm->flag, hdr->magic[0], hdr->magic[1]); + return 0; + } + + FN_FLOOD("[Stream %02x] Packet with flag: %02x\n", strm->flag, hdr->flag); + + uint8_t sof = strm->flag|1; + uint8_t mof = strm->flag|2; + uint8_t eof = strm->flag|5; + + // sync if required, dropping packets until SOF + if (!strm->synced) { + if (hdr->flag != sof) { + FN_SPEW("[Stream %02x] Not synced yet...\n", strm->flag); + return 0; + } + strm->synced = 1; + strm->seq = hdr->seq; + strm->pkt_num = 0; + strm->valid_pkts = 0; + strm->got_pkts = 0; + } + + int got_frame = 0; + + // handle lost packets + if (strm->seq != hdr->seq) { + uint8_t lost = hdr->seq - strm->seq; + FN_LOG(strm->valid_frames < 2 ? LL_SPEW : LL_INFO, \ + "[Stream %02x] Lost %d packets\n", strm->flag, lost); + if (lost > 5) { + FN_LOG(strm->valid_frames < 2 ? LL_SPEW : LL_NOTICE, \ + "[Stream %02x] Lost too many packets, resyncing...\n", strm->flag); + strm->synced = 0; + return 0; + } + strm->seq = hdr->seq; + int left = strm->pkts_per_frame - strm->pkt_num; + if (left <= lost) { + strm->pkt_num = lost - left; + strm->valid_pkts = strm->got_pkts; + strm->got_pkts = 0; + got_frame = 1; + strm->timestamp = strm->last_timestamp; + strm->valid_frames++; + } else { + strm->pkt_num += lost; + } + } + + // check the header to make sure it's what we expect + if (!(strm->pkt_num == 0 && hdr->flag == sof) && + !(strm->pkt_num == strm->pkts_per_frame-1 && hdr->flag == eof) && + !(strm->pkt_num > 0 && strm->pkt_num < strm->pkts_per_frame-1 && hdr->flag == mof)) { + FN_LOG(strm->valid_frames < 2 ? LL_SPEW : LL_NOTICE, \ + "[Stream %02x] Inconsistent flag %02x with %d packets in buf (%d total), resyncing...\n", + strm->flag, hdr->flag, strm->pkt_num, strm->pkts_per_frame); + strm->synced = 0; + return got_frame; + } + + // copy data + if (datalen > strm->pkt_size) { + FN_LOG(strm->valid_frames < 2 ? LL_SPEW : LL_WARNING, \ + "[Stream %02x] Expected %d data bytes, but got %d. Dropping...\n", strm->flag, strm->pkt_size, datalen); + return got_frame; + } + + if (datalen != strm->pkt_size && hdr->flag != eof) + FN_LOG(strm->valid_frames < 2 ? LL_SPEW : LL_WARNING, \ + "[Stream %02x] Expected %d data bytes, but got only %d\n", strm->flag, strm->pkt_size, datalen); + + uint8_t *dbuf = strm->raw_buf + strm->pkt_num * strm->pkt_size; + memcpy(dbuf, data, datalen); + + strm->pkt_num++; + strm->seq++; + strm->got_pkts++; + + strm->last_timestamp = fn_le32(hdr->timestamp); + + if (strm->pkt_num == strm->pkts_per_frame) { + strm->pkt_num = 0; + strm->valid_pkts = strm->got_pkts; + strm->got_pkts = 0; + strm->timestamp = strm->last_timestamp; + strm->valid_frames++; + return 1; + } else { + return got_frame; + } +} + +static void stream_initbufs(freenect_context *ctx, packet_stream *strm, int rlen, int plen) +{ + if (strm->usr_buf) { + strm->lib_buf = NULL; + strm->proc_buf = strm->usr_buf; + } else { + strm->lib_buf = malloc(plen); + strm->proc_buf = strm->lib_buf; + } + + if (rlen == 0) { + strm->split_bufs = 0; + strm->raw_buf = strm->proc_buf; + } else { + strm->split_bufs = 1; + strm->raw_buf = malloc(rlen); + } +} + +static void stream_freebufs(freenect_context *ctx, packet_stream *strm) +{ + if (strm->split_bufs) + free(strm->raw_buf); + if (strm->lib_buf) + free(strm->lib_buf); + + strm->raw_buf = NULL; + strm->proc_buf = NULL; + strm->lib_buf = NULL; +} + +static int stream_setbuf(freenect_context *ctx, packet_stream *strm, void *pbuf) +{ + if (!strm->running) { + strm->usr_buf = pbuf; + return 0; + } else { + if (!pbuf && !strm->lib_buf) { + FN_ERROR("Attempted to set buffer to NULL but stream was started with no internal buffer\n"); + return -1; + } + strm->usr_buf = pbuf; + + if (!pbuf) + strm->proc_buf = strm->lib_buf; + else + strm->proc_buf = pbuf; + + if (!strm->split_bufs) + strm->raw_buf = strm->proc_buf; + return 0; + } +} + +// Unpack buffer of (vw bit) data into padded 16bit buffer. +static inline void convert_packed_to_16bit(uint8_t *raw, uint16_t *frame, int vw, int len) +{ + int mask = (1 << vw) - 1; + uint32_t buffer = 0; + int bitsIn = 0; + while (len--) { + while (bitsIn < vw) { + buffer = (buffer << 8) | *(raw++); + bitsIn += 8; + } + bitsIn -= vw; + *(frame++) = (buffer >> bitsIn) & mask; + } +} + +// Unpack buffer of (vw bit) data into 8bit buffer, dropping LSBs +static inline void convert_packed_to_8bit(uint8_t *raw, uint8_t *frame, int vw, int len) +{ + uint32_t buffer = 0; + int bitsIn = 0; + while (len--) { + while (bitsIn < vw) { + buffer = (buffer << 8) | *(raw++); + bitsIn += 8; + } + bitsIn -= vw; + *(frame++) = buffer >> (bitsIn+vw-8); + } +} + +static void depth_process(freenect_device *dev, uint8_t *pkt, int len) +{ + freenect_context *ctx = dev->parent; + + if (len == 0) + return; + + if (!dev->depth.running) + return; + + int got_frame = stream_process(ctx, &dev->depth, pkt, len); + + if (!got_frame) + return; + + FN_SPEW("Got depth frame %d/%d packets arrived, TS %08x\n", + dev->depth.valid_pkts, dev->depth.pkts_per_frame, dev->depth.timestamp); + + switch (dev->depth_format) { + case FREENECT_DEPTH_11BIT: + convert_packed_to_16bit(dev->depth.raw_buf, dev->depth.proc_buf, 11, FREENECT_FRAME_PIX); + break; + case FREENECT_DEPTH_10BIT: + convert_packed_to_16bit(dev->depth.raw_buf, dev->depth.proc_buf, 10, FREENECT_FRAME_PIX); + break; + case FREENECT_DEPTH_10BIT_PACKED: + case FREENECT_DEPTH_11BIT_PACKED: + break; + } + if (dev->depth_cb) + dev->depth_cb(dev, dev->depth.proc_buf, dev->depth.timestamp); +} + +static void convert_bayer_to_rgb(uint8_t *raw_buf, uint8_t *proc_buf) +{ + int x,y; + /* Pixel arrangement: + * G R G R G R G R + * B G B G B G B G + * G R G R G R G R + * B G B G B G B G + * G R G R G R G R + * B G B G B G B G + * + * To convert a Bayer-pattern into RGB you have to handle four pattern + * configurations: + * 1) 2) 3) 4) + * B1 B1 G1 B2 R1 G1 R2 R1 <- previous line + * R1 G1 R2 G2 R1 G3 G2 B1 G3 B1 G1 B2 <- current line + * B2 B3 G4 B4 R3 G4 R4 R2 <- next line + * ^ ^ ^ + * | | next pixel + * | current pixel + * previous pixel + * + * The RGB values (r,g,b) for each configuration are calculated as + * follows: + * + * 1) r = (R1 + R2) / 2 + * g = G1 + * b = (B1 + B2) / 2 + * + * 2) r = R1 + * g = (G1 + G2 + G3 + G4) / 4 + * b = (B1 + B2 + B3 + B4) / 4 + * + * 3) r = (R1 + R2 + R3 + R4) / 4 + * g = (G1 + G2 + G3 + G4) / 4 + * b = B1 + * + * 4) r = (R1 + R2) / 2 + * g = G1 + * b = (B1 + B2) / 2 + * + * To efficiently calculate these values, two 32bit integers are used + * as "shift-buffers". One integer to store the 3 horizontal bayer pixel + * values (previous, current, next) of the current line. The other + * integer to store the vertical average value of the bayer pixels + * (previous, current, next) of the previous and next line. + * + * The boundary conditions for the first and last line and the first + * and last column are solved via mirroring the second and second last + * line and the second and second last column. + * + * To reduce slow memory access, the values of a rgb pixel are packet + * into a 32bit variable and transfered together. + */ + + uint8_t *dst = proc_buf; // pointer to destination + + uint8_t *prevLine; // pointer to previous, current and next line + uint8_t *curLine; // of the source bayer pattern + uint8_t *nextLine; + + // storing horizontal values in hVals: + // previous << 16, current << 8, next + uint32_t hVals; + // storing vertical averages in vSums: + // previous << 16, current << 8, next + uint32_t vSums; + + // init curLine and nextLine pointers + curLine = raw_buf; + nextLine = curLine + 640; + for (y = 0; y < 480; ++y) { + + if ((y > 0) && (y < 479)) + prevLine = curLine - 640; // normal case + else if (y == 0) + prevLine = nextLine; // top boundary case + else + nextLine = prevLine; // bottom boundary case + + // init horizontal shift-buffer with current value + hVals = (*(curLine++) << 8); + // handle left column boundary case + hVals |= (*curLine << 16); + // init vertical average shift-buffer with current values average + vSums = ((*(prevLine++) + *(nextLine++)) << 7) & 0xFF00; + // handle left column boundary case + vSums |= ((*prevLine + *nextLine) << 15) & 0xFF0000; + + // store if line is odd or not + uint8_t yOdd = y & 1; + // the right column boundary case is not handled inside this loop + // thus the "639" + for (x = 0; x < 639; ++x) { + // place next value in shift buffers + hVals |= *(curLine++); + vSums |= (*(prevLine++) + *(nextLine++)) >> 1; + + // calculate the horizontal sum as this sum is needed in + // any configuration + uint8_t hSum = ((uint8_t)(hVals >> 16) + (uint8_t)(hVals)) >> 1; + + if (yOdd == 0) { + if ((x & 1) == 0) { + // Configuration 1 + *(dst++) = hSum; // r + *(dst++) = hVals >> 8; // g + *(dst++) = vSums >> 8; // b + } else { + // Configuration 2 + *(dst++) = hVals >> 8; + *(dst++) = (hSum + (uint8_t)(vSums >> 8)) >> 1; + *(dst++) = ((uint8_t)(vSums >> 16) + (uint8_t)(vSums)) >> 1; + } + } else { + if ((x & 1) == 0) { + // Configuration 3 + *(dst++) = ((uint8_t)(vSums >> 16) + (uint8_t)(vSums)) >> 1; + *(dst++) = (hSum + (uint8_t)(vSums >> 8)) >> 1; + *(dst++) = hVals >> 8; + } else { + // Configuration 4 + *(dst++) = vSums >> 8; + *(dst++) = hVals >> 8; + *(dst++) = hSum; + } + } + + // shift the shift-buffers + hVals <<= 8; + vSums <<= 8; + } // end of for x loop + // right column boundary case, mirroring second last column + hVals |= (uint8_t)(hVals >> 16); + vSums |= (uint8_t)(vSums >> 16); + + // the horizontal sum simplifies to the second last column value + uint8_t hSum = (uint8_t)(hVals); + + if (yOdd == 0) { + if ((x & 1) == 0) { + *(dst++) = hSum; + *(dst++) = hVals >> 8; + *(dst++) = vSums >> 8; + } else { + *(dst++) = hVals >> 8; + *(dst++) = (hSum + (uint8_t)(vSums >> 8)) >> 1; + *(dst++) = vSums; + } + } else { + if ((x & 1) == 0) { + *(dst++) = vSums; + *(dst++) = (hSum + (uint8_t)(vSums >> 8)) >> 1; + *(dst++) = hVals >> 8; + } else { + *(dst++) = vSums >> 8; + *(dst++) = hVals >> 8; + *(dst++) = hSum; + } + } + + } // end of for y loop +} + +static void video_process(freenect_device *dev, uint8_t *pkt, int len) +{ + freenect_context *ctx = dev->parent; + + if (len == 0) + return; + + if (!dev->video.running) + return; + + int got_frame = stream_process(ctx, &dev->video, pkt, len); + + if (!got_frame) + return; + + FN_SPEW("Got RGB frame %d/%d packets arrived, TS %08x\n", dev->video.valid_pkts, + dev->video.pkts_per_frame, dev->video.timestamp); + + switch (dev->video_format) { + case FREENECT_VIDEO_RGB: + convert_bayer_to_rgb(dev->video.raw_buf, dev->video.proc_buf); + break; + case FREENECT_VIDEO_BAYER: + break; + case FREENECT_VIDEO_IR_10BIT: + convert_packed_to_16bit(dev->video.raw_buf, dev->video.proc_buf, 10, FREENECT_IR_FRAME_PIX); + break; + case FREENECT_VIDEO_IR_10BIT_PACKED: + break; + case FREENECT_VIDEO_IR_8BIT: + convert_packed_to_8bit(dev->video.raw_buf, dev->video.proc_buf, 10, FREENECT_IR_FRAME_PIX); + break; + } + + if (dev->video_cb) + dev->video_cb(dev, dev->video.proc_buf, dev->video.timestamp); +} + +typedef struct { + uint8_t magic[2]; + uint16_t len; + uint16_t cmd; + uint16_t tag; +} cam_hdr; + +static int send_cmd(freenect_device *dev, uint16_t cmd, void *cmdbuf, unsigned int cmd_len, void *replybuf, unsigned int reply_len) +{ + freenect_context *ctx = dev->parent; + int res, actual_len; + uint8_t obuf[0x400]; + uint8_t ibuf[0x200]; + cam_hdr *chdr = (void*)obuf; + cam_hdr *rhdr = (void*)ibuf; + + if (cmd_len & 1 || cmd_len > (0x400 - sizeof(*chdr))) { + FN_ERROR("send_cmd: Invalid command length (0x%x)\n", cmd_len); + return -1; + } + + chdr->magic[0] = 0x47; + chdr->magic[1] = 0x4d; + chdr->cmd = fn_le16(cmd); + chdr->tag = fn_le16(dev->cam_tag); + chdr->len = fn_le16(cmd_len / 2); + + memcpy(obuf+sizeof(*chdr), cmdbuf, cmd_len); + + res = fnusb_control(&dev->usb_cam, 0x40, 0, 0, 0, obuf, cmd_len + sizeof(*chdr)); + FN_SPEW("Control cmd=%04x tag=%04x len=%04x: %d\n", cmd, dev->cam_tag, cmd_len, res); + if (res < 0) { + FN_ERROR("send_cmd: Output control transfer failed (%d)\n", res); + return res; + } + + do { + actual_len = fnusb_control(&dev->usb_cam, 0xc0, 0, 0, 0, ibuf, 0x200); + } while (actual_len == 0); + FN_SPEW("Control reply: %d\n", res); + if (actual_len < sizeof(*rhdr)) { + FN_ERROR("send_cmd: Input control transfer failed (%d)\n", res); + return res; + } + actual_len -= sizeof(*rhdr); + + if (rhdr->magic[0] != 0x52 || rhdr->magic[1] != 0x42) { + FN_ERROR("send_cmd: Bad magic %02x %02x\n", rhdr->magic[0], rhdr->magic[1]); + return -1; + } + if (rhdr->cmd != chdr->cmd) { + FN_ERROR("send_cmd: Bad cmd %02x != %02x\n", rhdr->cmd, chdr->cmd); + return -1; + } + if (rhdr->tag != chdr->tag) { + FN_ERROR("send_cmd: Bad tag %04x != %04x\n", rhdr->tag, chdr->tag); + return -1; + } + if (fn_le16(rhdr->len) != (actual_len/2)) { + FN_ERROR("send_cmd: Bad len %04x != %04x\n", fn_le16(rhdr->len), (int)(actual_len/2)); + return -1; + } + + if (actual_len > reply_len) { + FN_WARNING("send_cmd: Data buffer is %d bytes long, but got %d bytes\n", reply_len, actual_len); + memcpy(replybuf, ibuf+sizeof(*rhdr), reply_len); + } else { + memcpy(replybuf, ibuf+sizeof(*rhdr), actual_len); + } + + dev->cam_tag++; + + return actual_len; +} + +static int write_register(freenect_device *dev, uint16_t reg, uint16_t data) +{ + freenect_context *ctx = dev->parent; + uint16_t reply[2]; + uint16_t cmd[2]; + int res; + + cmd[0] = fn_le16(reg); + cmd[1] = fn_le16(data); + + FN_DEBUG("Write Reg 0x%04x <= 0x%02x\n", reg, data); + res = send_cmd(dev, 0x03, cmd, 4, reply, 4); + if (res < 0) + return res; + if (res != 2) { + FN_WARNING("send_cmd returned %d [%04x %04x], 0000 expected\n", res, reply[0], reply[1]); + } + return 0; +} + +int freenect_start_depth(freenect_device *dev) +{ + freenect_context *ctx = dev->parent; + int res; + + if (dev->depth.running) + return -1; + + switch (dev->depth_format) { + case FREENECT_DEPTH_11BIT: + stream_initbufs(ctx, &dev->depth, FREENECT_DEPTH_11BIT_PACKED_SIZE, FREENECT_DEPTH_11BIT_SIZE); + dev->depth.pkts_per_frame = DEPTH_PKTS_11_BIT_PER_FRAME; + break; + case FREENECT_DEPTH_10BIT: + stream_initbufs(ctx, &dev->depth, FREENECT_DEPTH_10BIT_PACKED_SIZE, FREENECT_DEPTH_10BIT_SIZE); + dev->depth.pkts_per_frame = DEPTH_PKTS_10_BIT_PER_FRAME; + break; + case FREENECT_DEPTH_11BIT_PACKED: + stream_initbufs(ctx, &dev->depth, 0, FREENECT_DEPTH_11BIT_PACKED_SIZE); + dev->depth.pkts_per_frame = DEPTH_PKTS_11_BIT_PER_FRAME; + break; + case FREENECT_DEPTH_10BIT_PACKED: + stream_initbufs(ctx, &dev->depth, 0, FREENECT_DEPTH_11BIT_PACKED_SIZE); + dev->depth.pkts_per_frame = DEPTH_PKTS_10_BIT_PER_FRAME; + break; + } + + dev->depth.pkt_size = DEPTH_PKTDSIZE; + dev->depth.synced = 0; + dev->depth.flag = 0x70; + dev->depth.valid_frames = 0; + + res = fnusb_start_iso(&dev->usb_cam, &dev->depth_isoc, depth_process, 0x82, NUM_XFERS, PKTS_PER_XFER, DEPTH_PKTBUF); + if (res < 0) + return res; + + write_register(dev, 0x06, 0x00); // reset depth stream + switch (dev->depth_format) { + case FREENECT_DEPTH_11BIT: + case FREENECT_DEPTH_11BIT_PACKED: + write_register(dev, 0x12, 0x03); + break; + case FREENECT_DEPTH_10BIT: + case FREENECT_DEPTH_10BIT_PACKED: + write_register(dev, 0x12, 0x02); + break; + } + write_register(dev, 0x13, 0x01); + write_register(dev, 0x14, 0x1e); + write_register(dev, 0x06, 0x02); // start depth stream + + dev->depth.running = 1; + return 0; +} + +int freenect_start_video(freenect_device *dev) +{ + freenect_context *ctx = dev->parent; + int res; + + if (dev->video.running) + return -1; + + switch (dev->video_format) { + case FREENECT_VIDEO_RGB: + stream_initbufs(ctx, &dev->video, FREENECT_VIDEO_BAYER_SIZE, FREENECT_VIDEO_RGB_SIZE); + dev->video.pkts_per_frame = VIDEO_PKTS_PER_FRAME; + break; + case FREENECT_VIDEO_BAYER: + stream_initbufs(ctx, &dev->video, 0, FREENECT_VIDEO_BAYER_SIZE); + dev->video.pkts_per_frame = VIDEO_PKTS_PER_FRAME; + break; + case FREENECT_VIDEO_IR_8BIT: + stream_initbufs(ctx, &dev->video, FREENECT_VIDEO_IR_10BIT_PACKED_SIZE, FREENECT_VIDEO_IR_8BIT_SIZE); + dev->video.pkts_per_frame = VIDEO_PKTS_PER_FRAME_IR; + break; + case FREENECT_VIDEO_IR_10BIT: + stream_initbufs(ctx, &dev->video, FREENECT_VIDEO_IR_10BIT_PACKED_SIZE, FREENECT_VIDEO_BAYER_SIZE); + dev->video.pkts_per_frame = VIDEO_PKTS_PER_FRAME_IR; + break; + case FREENECT_VIDEO_IR_10BIT_PACKED: + stream_initbufs(ctx, &dev->video, 0, FREENECT_VIDEO_IR_10BIT_PACKED_SIZE); + dev->video.pkts_per_frame = VIDEO_PKTS_PER_FRAME_IR; + break; + } + + dev->video.pkt_size = VIDEO_PKTDSIZE; + dev->video.synced = 0; + dev->video.flag = 0x80; + dev->video.valid_frames = 0; + + res = fnusb_start_iso(&dev->usb_cam, &dev->video_isoc, video_process, 0x81, NUM_XFERS, PKTS_PER_XFER, VIDEO_PKTBUF); + if (res < 0) + return res; + + write_register(dev, 0x05, 0x00); // reset video stream + write_register(dev, 0x0c, 0x00); + write_register(dev, 0x0d, 0x01); + write_register(dev, 0x0e, 0x1e); // 30Hz bayer + switch (dev->video_format) { + case FREENECT_VIDEO_RGB: + case FREENECT_VIDEO_BAYER: + write_register(dev, 0x05, 0x01); // start video stream + break; + case FREENECT_VIDEO_IR_8BIT: + case FREENECT_VIDEO_IR_10BIT: + case FREENECT_VIDEO_IR_10BIT_PACKED: + write_register(dev, 0x05, 0x03); // start video stream + break; + } + write_register(dev, 0x47, 0x00); // disable Hflip + + dev->video.running = 1; + return 0; +} + +int freenect_stop_depth(freenect_device *dev) +{ + freenect_context *ctx = dev->parent; + int res; + + if (!dev->depth.running) + return -1; + + dev->depth.running = 0; + write_register(dev, 0x06, 0x00); // stop depth stream + + res = fnusb_stop_iso(&dev->usb_cam, &dev->depth_isoc); + if (res < 0) { + FN_ERROR("Failed to stop depth isochronous stream: %d\n", res); + return res; + } + + stream_freebufs(ctx, &dev->depth); + return 0; +} + +int freenect_stop_video(freenect_device *dev) +{ + freenect_context *ctx = dev->parent; + int res; + + if (!dev->video.running) + return -1; + + dev->video.running = 0; + write_register(dev, 0x05, 0x00); // stop video stream + + res = fnusb_stop_iso(&dev->usb_cam, &dev->video_isoc); + if (res < 0) { + FN_ERROR("Failed to stop RGB isochronous stream: %d\n", res); + return res; + } + + stream_freebufs(ctx, &dev->video); + return 0; +} + +void freenect_set_depth_callback(freenect_device *dev, freenect_depth_cb cb) +{ + dev->depth_cb = cb; +} + +void freenect_set_video_callback(freenect_device *dev, freenect_video_cb cb) +{ + dev->video_cb = cb; +} + +int freenect_set_video_format(freenect_device *dev, freenect_video_format fmt) +{ + freenect_context *ctx = dev->parent; + if (dev->video.running) { + FN_ERROR("Tried to set video format while stream is active\n"); + return -1; + } + + switch (fmt) { + case FREENECT_VIDEO_RGB: + case FREENECT_VIDEO_BAYER: + case FREENECT_VIDEO_IR_8BIT: + case FREENECT_VIDEO_IR_10BIT: + case FREENECT_VIDEO_IR_10BIT_PACKED: + dev->video_format = fmt; + return 0; + default: + FN_ERROR("Invalid video format %d\n", fmt); + return -1; + } +} + +int freenect_set_depth_format(freenect_device *dev, freenect_depth_format fmt) +{ + freenect_context *ctx = dev->parent; + if (dev->depth.running) { + FN_ERROR("Tried to set depth format while stream is active\n"); + return -1; + } + switch (fmt) { + case FREENECT_DEPTH_11BIT: + case FREENECT_DEPTH_10BIT: + case FREENECT_DEPTH_11BIT_PACKED: + case FREENECT_DEPTH_10BIT_PACKED: + dev->depth_format = fmt; + return 0; + default: + FN_ERROR("Invalid depth format %d\n", fmt); + return -1; + } + return 0; +} + +int freenect_set_depth_buffer(freenect_device *dev, void *buf) +{ + return stream_setbuf(dev->parent, &dev->depth, buf); +} + +int freenect_set_video_buffer(freenect_device *dev, void *buf) +{ + return stream_setbuf(dev->parent, &dev->video, buf); +} diff --git a/KinectJNI_v0002/src/libfreenect/core.c b/KinectJNI_v0002/src/libfreenect/core.c new file mode 100644 index 0000000..eeb2ea2 --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/core.c @@ -0,0 +1,197 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#include +#include +#include +#include +#include + +#include "freenect_internal.h" + +int freenect_init(freenect_context **ctx, freenect_usb_context *usb_ctx) +{ + *ctx = malloc(sizeof(freenect_context)); + if (!ctx) + return -1; + + memset(*ctx, 0, sizeof(freenect_context)); + + (*ctx)->log_level = LL_WARNING; + return fnusb_init(&(*ctx)->usb, usb_ctx); +} + +int freenect_shutdown(freenect_context *ctx) +{ + while (ctx->first) { + FN_NOTICE("Device %p open during shutdown, closing...\n", ctx->first); + freenect_close_device(ctx->first); + } + + fnusb_shutdown(&ctx->usb); + free(ctx); + return 0; +} + +int freenect_process_events(freenect_context *ctx) +{ + return fnusb_process_events(&ctx->usb); +} + +int freenect_num_devices(freenect_context *ctx) +{ + libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices + ssize_t cnt = libusb_get_device_list (ctx->usb.ctx, &devs); //get the list of devices + + if (cnt < 0) + return (-1); + + int nr = 0, i = 0; + struct libusb_device_descriptor desc; + for (i = 0; i < cnt; ++i) + { + int r = libusb_get_device_descriptor (devs[i], &desc); + if (r < 0) + continue; + if (desc.idVendor == VID_MICROSOFT && desc.idProduct == PID_NUI_CAMERA) + nr++; + } + + libusb_free_device_list (devs, 1); // free the list, unref the devices in it + + return (nr); +} + +int freenect_open_device(freenect_context *ctx, freenect_device **dev, int index) +{ + int res; + freenect_device *pdev = malloc(sizeof(freenect_device)); + if (!pdev) + return -1; + + memset(pdev, 0, sizeof(*pdev)); + + pdev->parent = ctx; + + res = fnusb_open_subdevices(pdev, index); + + if (res < 0) { + free(pdev); + return res; + } + + if (!ctx->first) { + ctx->first = pdev; + } else { + freenect_device *prev = ctx->first; + while (prev->next) + prev = prev->next; + prev->next = pdev; + } + + *dev = pdev; + return 0; +} + +int freenect_close_device(freenect_device *dev) +{ + freenect_context *ctx = dev->parent; + int res; + + // stop streams, if active + freenect_stop_depth(dev); + freenect_stop_video(dev); + + res = fnusb_close_subdevices(dev); + if (res < 0) { + FN_ERROR("fnusb_close_subdevices failed: %d\n", res); + return res; + } + + freenect_device *last = NULL; + freenect_device *cur = ctx->first; + + while (cur && cur != dev) { + last = cur; + cur = cur->next; + } + + if (!cur) { + FN_ERROR("device %p not found in linked list for this context!\n", dev); + return -1; + } + + if (last) + last->next = cur->next; + else + ctx->first = cur->next; + + free(dev); + return 0; +} + +void freenect_set_user(freenect_device *dev, void *user) +{ + dev->user_data = user; +} + +void *freenect_get_user(freenect_device *dev) +{ + return dev->user_data; +} + +void freenect_set_log_level(freenect_context *ctx, freenect_loglevel level) +{ + ctx->log_level = level; +} + +void freenect_set_log_callback(freenect_context *ctx, freenect_log_cb cb) +{ + ctx->log_cb = cb; +} + +void fn_log(freenect_context *ctx, freenect_loglevel level, const char *fmt, ...) +{ + va_list ap; + + if (level > ctx->log_level) + return; + + if (ctx->log_cb) { + char msgbuf[1024]; + + va_start(ap, fmt); + vsnprintf(msgbuf, 1024, fmt, ap); + msgbuf[1023] = 0; + va_end(ap); + + ctx->log_cb(ctx, level, msgbuf); + } else { + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + } +} diff --git a/KinectJNI_v0002/src/libfreenect/freenect_internal.h b/KinectJNI_v0002/src/libfreenect/freenect_internal.h new file mode 100644 index 0000000..504a5b8 --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/freenect_internal.h @@ -0,0 +1,156 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#ifndef FREENECT_INTERNAL_H +#define FREENECT_INTERNAL_H + +#include + +#include "libfreenect.h" + +typedef void (*fnusb_iso_cb)(freenect_device *dev, uint8_t *buf, int len); + +#include "usb_libusb10.h" + +struct _freenect_context { + freenect_loglevel log_level; + freenect_log_cb log_cb; + fnusb_ctx usb; + freenect_device *first; +}; + +#define LL_FATAL FREENECT_LOG_FATAL +#define LL_ERROR FREENECT_LOG_ERROR +#define LL_WARNING FREENECT_LOG_WARNING +#define LL_NOTICE FREENECT_LOG_NOTICE +#define LL_INFO FREENECT_LOG_INFO +#define LL_DEBUG FREENECT_LOG_DEBUG +#define LL_SPEW FREENECT_LOG_SPEW +#define LL_FLOOD FREENECT_LOG_FLOOD + +void fn_log(freenect_context *ctx, freenect_loglevel level, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); + +#define FN_LOG(level, ...) fn_log(ctx, level, __VA_ARGS__) + +#define FN_FATAL(...) FN_LOG(LL_FATAL, __VA_ARGS__) +#define FN_ERROR(...) FN_LOG(LL_ERROR, __VA_ARGS__) +#define FN_WARNING(...) FN_LOG(LL_WARNING, __VA_ARGS__) +#define FN_NOTICE(...) FN_LOG(LL_NOTICE, __VA_ARGS__) +#define FN_INFO(...) FN_LOG(LL_INFO, __VA_ARGS__) +#define FN_DEBUG(...) FN_LOG(LL_DEBUG, __VA_ARGS__) +#define FN_SPEW(...) FN_LOG(LL_SPEW, __VA_ARGS__) +#define FN_FLOOD(...) FN_LOG(LL_FLOOD, __VA_ARGS__) + +#ifdef FN_BIGENDIAN +static inline uint16_t fn_le16(uint16_t d) +{ + return (d<<8) | (d>>8); +} +static inline uint32_t fn_le32(uint32_t d) +{ + return (d<<24) | ((d<<8)&0xFF0000) | ((d>>8)&0xFF00) | (d>>24); +} +#else +#define fn_le16(x) (x) +#define fn_le32(x) (x) +#endif + +#define FRAME_H FREENECT_FRAME_H +#define FRAME_W FREENECT_FRAME_W +#define FRAME_PIX FREENECT_FRAME_PIX + +#define DEPTH_PKTSIZE 1760 +#define VIDEO_PKTSIZE 1920 + +#define DEPTH_PKTDSIZE (DEPTH_PKTSIZE-12) +#define VIDEO_PKTDSIZE (VIDEO_PKTSIZE-12) + +#define DEPTH_PKTS_10_BIT_PER_FRAME ((FREENECT_DEPTH_10BIT_PACKED_SIZE+DEPTH_PKTDSIZE-1)/DEPTH_PKTDSIZE) +#define DEPTH_PKTS_11_BIT_PER_FRAME ((FREENECT_DEPTH_11BIT_PACKED_SIZE+DEPTH_PKTDSIZE-1)/DEPTH_PKTDSIZE) +#define VIDEO_PKTS_PER_FRAME ((FRAME_PIX+VIDEO_PKTDSIZE-1)/VIDEO_PKTDSIZE) +#define VIDEO_PKTS_PER_FRAME_IR ((FREENECT_VIDEO_IR_10BIT_PACKED_SIZE+VIDEO_PKTDSIZE-1)/VIDEO_PKTDSIZE) + +#define VID_MICROSOFT 0x45e +#define PID_NUI_CAMERA 0x02ae +#define PID_NUI_MOTOR 0x02b0 + +typedef struct { + int running; + uint8_t flag; + int synced; + uint8_t seq; + int got_pkts; + int pkt_num; + int pkts_per_frame; + int pkt_size; + int valid_pkts; + int valid_frames; + uint32_t last_timestamp; + uint32_t timestamp; + int split_bufs; + void *lib_buf; + void *usr_buf; + uint8_t *raw_buf; + void *proc_buf; +} packet_stream; + +struct _freenect_device { + freenect_context *parent; + freenect_device *next; + void *user_data; + + // Cameras + fnusb_dev usb_cam; + fnusb_isoc_stream depth_isoc; + fnusb_isoc_stream video_isoc; + + freenect_depth_cb depth_cb; + freenect_video_cb video_cb; + freenect_video_format video_format; + freenect_depth_format depth_format; + + int cam_inited; + uint16_t cam_tag; + + packet_stream depth; + packet_stream video; + + // Audio + // Motor + fnusb_dev usb_motor; + freenect_raw_tilt_state raw_state; +}; + +struct caminit { + uint16_t command; + uint16_t tag; + int cmdlen; + int replylen; + uint8_t cmddata[1024]; + uint8_t replydata[1024]; +}; + +#endif diff --git a/KinectJNI_v0002/src/libfreenect/libfreenect.h b/KinectJNI_v0002/src/libfreenect/libfreenect.h new file mode 100644 index 0000000..ef27b81 --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/libfreenect.h @@ -0,0 +1,164 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#ifndef LIBFREENECT_H +#define LIBFREENECT_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define FREENECT_FRAME_W 640 +#define FREENECT_FRAME_H 480 +#define FREENECT_FRAME_PIX (FREENECT_FRAME_H*FREENECT_FRAME_W) + +#define FREENECT_IR_FRAME_W 640 +#define FREENECT_IR_FRAME_H 488 +#define FREENECT_IR_FRAME_PIX (FREENECT_IR_FRAME_H*FREENECT_IR_FRAME_W) + +#define FREENECT_VIDEO_RGB_SIZE (FREENECT_FRAME_PIX*3) +#define FREENECT_VIDEO_BAYER_SIZE (FREENECT_FRAME_PIX) +#define FREENECT_VIDEO_IR_8BIT_SIZE (FREENECT_IR_FRAME_PIX) +#define FREENECT_VIDEO_IR_10BIT_SIZE (FREENECT_IR_FRAME_PIX*sizeof(uint16_t)) +#define FREENECT_VIDEO_IR_10BIT_PACKED_SIZE 390400 + +#define FREENECT_DEPTH_11BIT_SIZE (FREENECT_FRAME_PIX*sizeof(uint16_t)) +#define FREENECT_DEPTH_10BIT_SIZE FREENECT_DEPTH_11BIT_SIZE +#define FREENECT_DEPTH_11BIT_PACKED_SIZE 422400 +#define FREENECT_DEPTH_10BIT_PACKED_SIZE 384000 + +#define FREENECT_COUNTS_PER_G 819 + +typedef enum { + FREENECT_VIDEO_RGB = 0, + FREENECT_VIDEO_BAYER = 1, + FREENECT_VIDEO_IR_8BIT = 2, + FREENECT_VIDEO_IR_10BIT = 3, + FREENECT_VIDEO_IR_10BIT_PACKED = 4, +} freenect_video_format; + +typedef enum { + LED_OFF = 0, + LED_GREEN = 1, + LED_RED = 2, + LED_YELLOW = 3, + LED_BLINK_YELLOW = 4, + LED_BLINK_GREEN = 5, + LED_BLINK_RED_YELLOW = 6 +} freenect_led_options; + +typedef enum { + FREENECT_DEPTH_11BIT = 0, + FREENECT_DEPTH_10BIT = 1, + FREENECT_DEPTH_11BIT_PACKED = 2, + FREENECT_DEPTH_10BIT_PACKED = 3, +} freenect_depth_format; + +typedef enum { + TILT_STATUS_STOPPED = 0x00, + TILT_STATUS_LIMIT = 0x01, + TILT_STATUS_MOVING = 0x04 +} freenect_tilt_status_code; + +typedef struct { + int16_t accelerometer_x; + int16_t accelerometer_y; + int16_t accelerometer_z; + int8_t tilt_angle; + freenect_tilt_status_code tilt_status; +} freenect_raw_tilt_state; + +struct _freenect_context; +typedef struct _freenect_context freenect_context; + +struct _freenect_device; +typedef struct _freenect_device freenect_device; + +// usb backend specific section +#include "libusb.h" +typedef libusb_context freenect_usb_context; +// + +typedef enum { + FREENECT_LOG_FATAL = 0, + FREENECT_LOG_ERROR, + FREENECT_LOG_WARNING, + FREENECT_LOG_NOTICE, + FREENECT_LOG_INFO, + FREENECT_LOG_DEBUG, + FREENECT_LOG_SPEW, + FREENECT_LOG_FLOOD, +} freenect_loglevel; + +int freenect_init(freenect_context **ctx, freenect_usb_context *usb_ctx); +int freenect_shutdown(freenect_context *ctx); + +typedef void (*freenect_log_cb)(freenect_context *dev, freenect_loglevel level, const char *msg); + +void freenect_set_log_level(freenect_context *ctx, freenect_loglevel level); +void freenect_set_log_callback(freenect_context *ctx, freenect_log_cb cb); + +int freenect_process_events(freenect_context *ctx); + +int freenect_num_devices(freenect_context *ctx); +int freenect_open_device(freenect_context *ctx, freenect_device **dev, int index); +int freenect_close_device(freenect_device *dev); + +void freenect_set_user(freenect_device *dev, void *user); +void *freenect_get_user(freenect_device *dev); + +typedef void (*freenect_depth_cb)(freenect_device *dev, void *depth, uint32_t timestamp); +typedef void (*freenect_video_cb)(freenect_device *dev, void *video, uint32_t timestamp); + +void freenect_set_depth_callback(freenect_device *dev, freenect_depth_cb cb); +void freenect_set_video_callback(freenect_device *dev, freenect_video_cb cb); + +int freenect_set_depth_format(freenect_device *dev, freenect_depth_format fmt); +int freenect_set_video_format(freenect_device *dev, freenect_video_format fmt); + +int freenect_set_depth_buffer(freenect_device *dev, void *buf); +int freenect_set_video_buffer(freenect_device *dev, void *buf); + +int freenect_start_depth(freenect_device *dev); +int freenect_start_video(freenect_device *dev); +int freenect_stop_depth(freenect_device *dev); +int freenect_stop_video(freenect_device *dev); + +int freenect_update_tilt_state(freenect_device *dev); +freenect_raw_tilt_state* freenect_get_tilt_state(freenect_device *dev); +double freenect_get_tilt_degs(freenect_raw_tilt_state *state); +int freenect_set_tilt_degs(freenect_device *dev, double angle); +int freenect_set_led(freenect_device *dev, freenect_led_options option); +void freenect_get_mks_accel(freenect_raw_tilt_state *state, double* x, double* y, double* z); + +#ifdef __cplusplus +} +#endif + +#endif // + diff --git a/KinectJNI_v0002/src/libfreenect/libfreenect.hpp b/KinectJNI_v0002/src/libfreenect/libfreenect.hpp new file mode 100644 index 0000000..4189d01 --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/libfreenect.hpp @@ -0,0 +1,155 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace Freenect { + class Noncopyable { + public: + Noncopyable() {} + ~Noncopyable() {} + private: + Noncopyable( const Noncopyable& ); + const Noncopyable& operator=( const Noncopyable& ); + }; + + class FreenectDeviceState { + friend class FreenectDevice; + FreenectDeviceState(freenect_raw_tilt_state *_state): + m_state(_state) + {} + public: + void getAccelerometers(double* x, double* y, double* z) { + freenect_get_mks_accel(m_state, x, y, z); + } + double getTiltDegs() { + return freenect_get_tilt_degs(m_state); + } + private: + freenect_raw_tilt_state *m_state; + }; + + class FreenectDevice : Noncopyable { + public: + FreenectDevice(freenect_context *_ctx, int _index) { + if(freenect_open_device(_ctx, &m_dev, _index) != 0) throw std::runtime_error("Cannot open Kinect"); + freenect_set_user(m_dev, this); + freenect_set_video_format(m_dev, FREENECT_VIDEO_RGB); + freenect_set_depth_format(m_dev, FREENECT_DEPTH_11BIT); + freenect_set_depth_callback(m_dev, freenect_depth_callback); + freenect_set_video_callback(m_dev, freenect_video_callback); + } + ~FreenectDevice() { + if(freenect_close_device(m_dev) != 0) throw std::runtime_error("Cannot shutdown Kinect"); + } + void startVideo() { + if(freenect_start_video(m_dev) != 0) throw std::runtime_error("Cannot start RGB callback"); + } + void stopVideo() { + if(freenect_stop_video(m_dev) != 0) throw std::runtime_error("Cannot stop RGB callback"); + } + void startDepth() { + if(freenect_start_depth(m_dev) != 0) throw std::runtime_error("Cannot start depth callback"); + } + void stopDepth() { + if(freenect_stop_depth(m_dev) != 0) throw std::runtime_error("Cannot stop depth callback"); + } + void setTiltDegrees(double _angle) { + if(freenect_set_tilt_degs(m_dev, _angle) != 0) throw std::runtime_error("Cannot set angle in degrees"); + } + void setLed(freenect_led_options _option) { + if(freenect_set_led(m_dev, _option) != 0) throw std::runtime_error("Cannot set led"); + } + void updateState() { + if (freenect_update_tilt_state(m_dev) != 0) throw std::runtime_error("Cannot update device state"); + } + FreenectDeviceState getState() const { + return FreenectDeviceState(freenect_get_tilt_state(m_dev)); + } + // Do not call directly even in child + virtual void VideoCallback(void *video, uint32_t timestamp) = 0; + // Do not call directly even in child + virtual void DepthCallback(void *depth, uint32_t timestamp) = 0; + private: + freenect_device *m_dev; + static void freenect_depth_callback(freenect_device *dev, void *depth, uint32_t timestamp) { + FreenectDevice* device = static_cast(freenect_get_user(dev)); + device->DepthCallback(depth, timestamp); + } + static void freenect_video_callback(freenect_device *dev, void *video, uint32_t timestamp) { + FreenectDevice* device = static_cast(freenect_get_user(dev)); + device->VideoCallback(video, timestamp); + } + }; + + template class Freenect : Noncopyable { + public: + Freenect() : m_stop(false) { + if(freenect_init(&m_ctx, NULL) != 0) throw std::runtime_error("Cannot initialize freenect library"); + if(pthread_create(&m_thread, NULL, pthread_callback, (void*)this) != 0) throw std::runtime_error("Cannot initialize freenect thread"); + } + ~Freenect() { + for(typename std::map::iterator it = m_devices.begin() ; it != m_devices.end() ; ++it) { + delete it->second; + } + m_stop = true; + pthread_join(m_thread, NULL); + if(freenect_shutdown(m_ctx) != 0) throw std::runtime_error("Cannot cleanup freenect library"); + } + T& createDevice(int _index) { + m_devices.insert(std::make_pair(_index, new T(m_ctx, _index))); + return *(m_devices.at(_index)); + } + void deleteDevice(int _index) { + m_devices.erase(_index); + } + int deviceCount() { + return freenect_num_devices(m_ctx); + } + // Do not call directly, thread runs here + void operator()() { + while(!m_stop) { + if(freenect_process_events(m_ctx) != 0) throw std::runtime_error("Cannot process freenect events"); + } + } + static void *pthread_callback(void *user_data) { + Freenect* freenect = static_cast*>(user_data); + (*freenect)(); + } + private: + freenect_context *m_ctx; + volatile bool m_stop; + pthread_t m_thread; + std::map m_devices; + }; + +} + diff --git a/KinectJNI_v0002/src/libfreenect/libfreenect.pc.in b/KinectJNI_v0002/src/libfreenect/libfreenect.pc.in new file mode 100644 index 0000000..2e21899 --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/libfreenect.pc.in @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/@PROJECT_LIBRARY_INSTALL_DIR@ +includedir=${prefix}/@PROJECT_INCLUDE_INSTALL_DIR@ + +Name: @CMAKE_PROJECT_NAME@ +Description: Interface to the Microsoft Kinect sensor device. +Requires: libusb-1.0 +Version: @PROJECT_APIVER@ +Libs: -L${libdir} -lfreenect +Cflags: -I${includedir} diff --git a/KinectJNI_v0002/src/libfreenect/tilt.c b/KinectJNI_v0002/src/libfreenect/tilt.c new file mode 100644 index 0000000..6892e56 --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/tilt.c @@ -0,0 +1,103 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#include +#include +#include +#include +#include + +#include "freenect_internal.h" + +// The kinect can tilt from +31 to -31 degrees in what looks like 1 degree increments +// The control input looks like 2*desired_degrees +#define MAX_TILT_ANGLE 31 +#define MIN_TILT_ANGLE (-31) + +#define GRAVITY 9.80665 + +freenect_raw_tilt_state* freenect_get_tilt_state(freenect_device *dev) +{ + return &dev->raw_state; +} + +int freenect_update_tilt_state(freenect_device *dev) +{ + freenect_context *ctx = dev->parent; + uint8_t buf[10]; + uint16_t ux, uy, uz; + int ret = fnusb_control(&dev->usb_motor, 0xC0, 0x32, 0x0, 0x0, buf, 10); + if (ret != 10) { + FN_ERROR("Error in accelerometer reading, libusb_control_transfer returned %d\n", ret); + return ret < 0 ? ret : -1; + } + + ux = ((uint16_t)buf[2] << 8) | buf[3]; + uy = ((uint16_t)buf[4] << 8) | buf[5]; + uz = ((uint16_t)buf[6] << 8) | buf[7]; + + dev->raw_state.accelerometer_x = (int16_t)ux; + dev->raw_state.accelerometer_y = (int16_t)uy; + dev->raw_state.accelerometer_z = (int16_t)uz; + dev->raw_state.tilt_angle = (int8_t)buf[8]; + dev->raw_state.tilt_status = buf[9]; + + return ret; +} + +int freenect_set_tilt_degs(freenect_device *dev, double angle) +{ + int ret; + uint8_t empty[0x1]; + + angle = (angleMAX_TILT_ANGLE) ? MAX_TILT_ANGLE : angle); + angle = angle * 2; + + ret = fnusb_control(&dev->usb_motor, 0x40, 0x31, (uint16_t)angle, 0x0, empty, 0x0); + return ret; +} + +int freenect_set_led(freenect_device *dev, freenect_led_options option) +{ + int ret; + uint8_t empty[0x1]; + ret = fnusb_control(&dev->usb_motor, 0x40, 0x06, (uint16_t)option, 0x0, empty, 0x0); + return ret; +} + +double freenect_get_tilt_degs(freenect_raw_tilt_state *state) +{ + return ((double)state->tilt_angle) / 2.; +} + +void freenect_get_mks_accel(freenect_raw_tilt_state *state, double* x, double* y, double* z) +{ + //the documentation for the accelerometer (http://www.kionix.com/Product%20Sheets/KXSD9%20Product%20Brief.pdf) + //states there are 819 counts/g + *x = (double)state->accelerometer_x/FREENECT_COUNTS_PER_G*GRAVITY; + *y = (double)state->accelerometer_y/FREENECT_COUNTS_PER_G*GRAVITY; + *z = (double)state->accelerometer_z/FREENECT_COUNTS_PER_G*GRAVITY; +} diff --git a/KinectJNI_v0002/src/libfreenect/usb_libusb10.c b/KinectJNI_v0002/src/libfreenect/usb_libusb10.c new file mode 100644 index 0000000..0052190 --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/usb_libusb10.c @@ -0,0 +1,261 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#include +#include +#include +#include +#include "libusb.h" +#include "freenect_internal.h" + +int fnusb_init(fnusb_ctx *ctx, freenect_usb_context *usb_ctx) +{ + int res; + if (!usb_ctx) { + res = libusb_init(&ctx->ctx); + if (res >= 0) { + ctx->should_free_ctx = 1; + return 0; + } else { + ctx->should_free_ctx = 0; + ctx->ctx = NULL; + return res; + } + } else { + ctx->ctx = usb_ctx; + ctx->should_free_ctx = 0; + return 0; + } +} + +int fnusb_shutdown(fnusb_ctx *ctx) +{ + //int res; + if (ctx->should_free_ctx) { + libusb_exit(ctx->ctx); + ctx->ctx = NULL; + } + return 0; +} + +int fnusb_process_events(fnusb_ctx *ctx) +{ + return libusb_handle_events(ctx->ctx); +} + +int fnusb_open_subdevices(freenect_device *dev, int index) +{ + freenect_context *ctx = dev->parent; + + dev->usb_cam.parent = dev; + dev->usb_cam.dev = NULL; + dev->usb_motor.parent = dev; + dev->usb_motor.dev = NULL; + + libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices + ssize_t cnt = libusb_get_device_list (dev->parent->usb.ctx, &devs); //get the list of devices + if (cnt < 0) + return -1; + + int i = 0, nr_cam = 0, nr_mot = 0; + int res; + struct libusb_device_descriptor desc; + + for (i = 0; i < cnt; i++) { + int r = libusb_get_device_descriptor (devs[i], &desc); + if (r < 0) + continue; + + if (desc.idVendor != VID_MICROSOFT) + continue; + + // Search for the camera + if (!dev->usb_cam.dev && desc.idProduct == PID_NUI_CAMERA) { + // If the index given by the user matches our camera index + if (nr_cam == index) { + res = libusb_open (devs[i], &dev->usb_cam.dev); + if (res < 0 || !dev->usb_cam.dev) { + FN_ERROR("Could not open camera: %d\n", res); + dev->usb_cam.dev = NULL; + break; + } + res = libusb_claim_interface (dev->usb_cam.dev, 0); + if (res < 0) { + FN_ERROR("Could not claim interface on camera: %d\n", res); + libusb_close(dev->usb_cam.dev); + dev->usb_cam.dev = NULL; + break; + } + } else { + nr_cam++; + } + } + + // Search for the motor + if (!dev->usb_motor.dev && desc.idProduct == PID_NUI_MOTOR) { + // If the index given by the user matches our camera index + if (nr_mot == index) { + res = libusb_open (devs[i], &dev->usb_motor.dev); + if (res < 0 || !dev->usb_motor.dev) { + FN_ERROR("Could not open motor: %d\n", res); + dev->usb_motor.dev = NULL; + break; + } + res = libusb_claim_interface (dev->usb_motor.dev, 0); + if (res < 0) { + FN_ERROR("Could not claim interface on motor: %d\n", res); + libusb_close(dev->usb_motor.dev); + dev->usb_motor.dev = NULL; + break; + } + } else { + nr_mot++; + } + } + } + + libusb_free_device_list (devs, 1); // free the list, unref the devices in it + + if (dev->usb_cam.dev && dev->usb_motor.dev) { + return 0; + } else { + if (dev->usb_cam.dev) { + libusb_release_interface(dev->usb_cam.dev, 0); + libusb_close(dev->usb_cam.dev); + } + if (dev->usb_motor.dev) { + libusb_release_interface(dev->usb_motor.dev, 0); + libusb_close(dev->usb_motor.dev); + } + return -1; + } +} + +int fnusb_close_subdevices(freenect_device *dev) +{ + if (dev->usb_cam.dev) { + libusb_release_interface(dev->usb_cam.dev, 0); + libusb_close(dev->usb_cam.dev); + dev->usb_cam.dev = NULL; + } + if (dev->usb_motor.dev) { + libusb_release_interface(dev->usb_motor.dev, 0); + libusb_close(dev->usb_motor.dev); + dev->usb_motor.dev = NULL; + } + return 0; +} + +static void iso_callback(struct libusb_transfer *xfer) +{ + int i; + fnusb_isoc_stream *strm = xfer->user_data; + + if (strm->dead) { + freenect_context *ctx = strm->parent->parent->parent; + strm->dead_xfers++; + FN_SPEW("EP %02x transfer complete, %d left\n", xfer->endpoint, strm->num_xfers - strm->dead_xfers); + return; + } + + if(xfer->status == LIBUSB_TRANSFER_COMPLETED) { + uint8_t *buf = (void*)xfer->buffer; + for (i=0; ipkts; i++) { + strm->cb(strm->parent->parent, buf, xfer->iso_packet_desc[i].actual_length); + buf += strm->len; + } + libusb_submit_transfer(xfer); + } else { + freenect_context *ctx = strm->parent->parent->parent; + FN_WARNING("Isochronous transfer error: %d\n", xfer->status); + strm->dead_xfers++; + } +} + +int fnusb_start_iso(fnusb_dev *dev, fnusb_isoc_stream *strm, fnusb_iso_cb cb, int ep, int xfers, int pkts, int len) +{ + freenect_context *ctx = dev->parent->parent; + int ret, i; + + strm->parent = dev; + strm->cb = cb; + strm->num_xfers = xfers; + strm->pkts = pkts; + strm->len = len; + strm->buffer = malloc(xfers * pkts * len); + strm->xfers = malloc(sizeof(struct libusb_transfer*) * xfers); + strm->dead = 0; + strm->dead_xfers = 0; + + uint8_t *bufp = strm->buffer; + + for (i=0; ixfers[i] = libusb_alloc_transfer(pkts); + + libusb_fill_iso_transfer(strm->xfers[i], dev->dev, ep, bufp, pkts * len, pkts, iso_callback, strm, 0); + + libusb_set_iso_packet_lengths(strm->xfers[i], len); + + ret = libusb_submit_transfer(strm->xfers[i]); + if (ret < 0) + FN_WARNING("Failed to submit isochronous transfer %d: %d\n", i, ret); + + bufp += pkts*len; + } + + return 0; + +} + +int fnusb_stop_iso(fnusb_dev *dev, fnusb_isoc_stream *strm) +{ + freenect_context *ctx = dev->parent->parent; + int i; + + strm->dead = 1; + + for (i=0; inum_xfers; i++) + libusb_cancel_transfer(strm->xfers[i]); + + while (strm->dead_xfers < strm->num_xfers) { + libusb_handle_events(ctx->usb.ctx); + } + + for (i=0; inum_xfers; i++) + libusb_free_transfer(strm->xfers[i]); + + free(strm->buffer); + free(strm->xfers); + + memset(strm, 0, sizeof(*strm)); + return 0; +} + +int fnusb_control(fnusb_dev *dev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength) +{ + return libusb_control_transfer(dev->dev, bmRequestType, bRequest, wValue, wIndex, data, wLength, 0); +} diff --git a/KinectJNI_v0002/src/libfreenect/usb_libusb10.h b/KinectJNI_v0002/src/libfreenect/usb_libusb10.h new file mode 100644 index 0000000..c7fde0b --- /dev/null +++ b/KinectJNI_v0002/src/libfreenect/usb_libusb10.h @@ -0,0 +1,93 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#ifndef USB_LIBUSB10 +#define USB_LIBUSB10 + +#include "libusb.h" + +#if defined(__APPLE__) +/* + From Github Issue 22 by Roefer - + https://github.com/OpenKinect/libfreenect/issues/#issue/22 + + The current implementation still does not reach 30 Hz on MacOS. This + is due to bad scheduling of USB transfers in libusb (Ed Note: libusb + 1.0.8). A fix can be found at + http://www.informatik.uni-bremen.de/~roefer/libusb/libusb-osx-kinect.diff + + (Ed Note: patch applies to libusb repo at 7da756e09fd) + + In camera.c, I use PKTS_PER_XFER = 128, NUM_XFERS = 4. There are a + few rules: PKTS_PER_XFER * NUM_XFERS <= 1000, PKTS_PER_XFER % 8 == 0. +*/ +#define PKTS_PER_XFER 128 +#define NUM_XFERS 4 +#define DEPTH_PKTBUF 2048 +#define VIDEO_PKTBUF 2048 +#else +#define PKTS_PER_XFER 16 +#define NUM_XFERS 16 +#define DEPTH_PKTBUF 1920 +#define VIDEO_PKTBUF 1920 +#endif + +typedef struct { + libusb_context *ctx; + int should_free_ctx; +} fnusb_ctx; + +typedef struct { + freenect_device *parent; //so we can go up from the libusb userdata + libusb_device_handle *dev; +} fnusb_dev; + +typedef struct { + fnusb_dev *parent; //so we can go up from the libusb userdata + struct libusb_transfer **xfers; + uint8_t *buffer; + fnusb_iso_cb cb; + int num_xfers; + int pkts; + int len; + int dead; + int dead_xfers; +} fnusb_isoc_stream; + +int fnusb_init(fnusb_ctx *ctx, freenect_usb_context *usb_ctx); +int fnusb_shutdown(fnusb_ctx *ctx); +int fnusb_process_events(fnusb_ctx *ctx); + +int fnusb_open_subdevices(freenect_device *dev, int index); +int fnusb_close_subdevices(freenect_device *dev); + +int fnusb_start_iso(fnusb_dev *dev, fnusb_isoc_stream *strm, fnusb_iso_cb cb, int ep, int xfers, int pkts, int len); +int fnusb_stop_iso(fnusb_dev *dev, fnusb_isoc_stream *strm); + +int fnusb_control(fnusb_dev *dev, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint8_t *data, uint16_t wLength); + + +#endif diff --git a/KinectJNI_v0002/src/libusb/osx/include/libusb-1.0/libusb.h b/KinectJNI_v0002/src/libusb/osx/include/libusb-1.0/libusb.h new file mode 100644 index 0000000..8dc3362 --- /dev/null +++ b/KinectJNI_v0002/src/libusb/osx/include/libusb-1.0/libusb.h @@ -0,0 +1,1322 @@ +/* + * Public libusb header file + * Copyright (C) 2007-2008 Daniel Drake + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __LIBUSB_H__ +#define __LIBUSB_H__ + +/* MSVC doesn't like inline, but does accept __inline ?? */ +#ifdef _MSC_VER +#define inline __inline +#endif + +#include +#include +#include +#include + +#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) +#include +#endif + +/* 'interface' might be defined as a macro on Windows, so we need to + * undefine it so as not to break the current libusb API, because + * libusb_config_descriptor has an 'interface' member + * As this can be problematic if you include windows.h after libusb.h + * in your sources, we force windows.h to be included first. */ +#if defined(_WIN32) || defined(__CYGWIN__) +#include +#if defined(interface) +#undef interface +#endif +#endif + +/** \def LIBUSB_CALL + * \ingroup misc + * libusb's Windows calling convention. + * + * Under Windows, the selection of available compilers and configurations + * means that, unlike other platforms, there is not one true calling + * convention (calling convention: the manner in which parameters are + * passed to funcions in the generated assembly code). + * + * Matching the Windows API itself, libusb uses the WINAPI convention (which + * translates to the stdcall convention) and guarantees that the + * library is compiled in this way. The public header file also includes + * appropriate annotations so that your own software will use the right + * convention, even if another convention is being used by default within + * your codebase. + * + * The one consideration that you must apply in your software is to mark + * all functions which you use as libusb callbacks with this LIBUSB_CALL + * annotation, so that they too get compiled for the correct calling + * convention. + * + * On non-Windows operating systems, this macro is defined as nothing. This + * means that you can apply it to your code without worrying about + * cross-platform compatibility. + */ +/* LIBUSB_CALL must be defined on both definition and declaration of libusb + * functions. You'd think that declaration would be enough, but cygwin will + * complain about conflicting types unless both are marked this way. + * The placement of this macro is important too; it must appear after the + * return type, before the function name. See internal documentation for + * API_EXPORTED. + */ +#if defined(_WIN32) || defined(__CYGWIN__) +#define LIBUSB_CALL WINAPI +#else +#define LIBUSB_CALL +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** \def libusb_cpu_to_le16 + * \ingroup misc + * Convert a 16-bit value from host-endian to little-endian format. On + * little endian systems, this function does nothing. On big endian systems, + * the bytes are swapped. + * \param x the host-endian value to convert + * \returns the value in little-endian byte order + */ +static inline uint16_t libusb_cpu_to_le16(const uint16_t x) +{ + union { + uint8_t b8[2]; + uint16_t b16; + } _tmp; + _tmp.b8[1] = x >> 8; + _tmp.b8[0] = x & 0xff; + return _tmp.b16; +} + +/** \def libusb_le16_to_cpu + * \ingroup misc + * Convert a 16-bit value from little-endian to host-endian format. On + * little endian systems, this function does nothing. On big endian systems, + * the bytes are swapped. + * \param x the little-endian value to convert + * \returns the value in host-endian byte order + */ +#define libusb_le16_to_cpu libusb_cpu_to_le16 + +/* standard USB stuff */ + +/** \ingroup desc + * Device and/or Interface Class codes */ +enum libusb_class_code { + /** In the context of a \ref libusb_device_descriptor "device descriptor", + * this bDeviceClass value indicates that each interface specifies its + * own class information and all interfaces operate independently. + */ + LIBUSB_CLASS_PER_INTERFACE = 0, + + /** Audio class */ + LIBUSB_CLASS_AUDIO = 1, + + /** Communications class */ + LIBUSB_CLASS_COMM = 2, + + /** Human Interface Device class */ + LIBUSB_CLASS_HID = 3, + + /** Printer dclass */ + LIBUSB_CLASS_PRINTER = 7, + + /** Picture transfer protocol class */ + LIBUSB_CLASS_PTP = 6, + + /** Mass storage class */ + LIBUSB_CLASS_MASS_STORAGE = 8, + + /** Hub class */ + LIBUSB_CLASS_HUB = 9, + + /** Data class */ + LIBUSB_CLASS_DATA = 10, + + /** Wireless class */ + LIBUSB_CLASS_WIRELESS = 0xe0, + + /** Application class */ + LIBUSB_CLASS_APPLICATION = 0xfe, + + /** Class is vendor-specific */ + LIBUSB_CLASS_VENDOR_SPEC = 0xff +}; + +/** \ingroup desc + * Descriptor types as defined by the USB specification. */ +enum libusb_descriptor_type { + /** Device descriptor. See libusb_device_descriptor. */ + LIBUSB_DT_DEVICE = 0x01, + + /** Configuration descriptor. See libusb_config_descriptor. */ + LIBUSB_DT_CONFIG = 0x02, + + /** String descriptor */ + LIBUSB_DT_STRING = 0x03, + + /** Interface descriptor. See libusb_interface_descriptor. */ + LIBUSB_DT_INTERFACE = 0x04, + + /** Endpoint descriptor. See libusb_endpoint_descriptor. */ + LIBUSB_DT_ENDPOINT = 0x05, + + /** HID descriptor */ + LIBUSB_DT_HID = 0x21, + + /** HID report descriptor */ + LIBUSB_DT_REPORT = 0x22, + + /** Physical descriptor */ + LIBUSB_DT_PHYSICAL = 0x23, + + /** Hub descriptor */ + LIBUSB_DT_HUB = 0x29 +}; + +/* Descriptor sizes per descriptor type */ +#define LIBUSB_DT_DEVICE_SIZE 18 +#define LIBUSB_DT_CONFIG_SIZE 9 +#define LIBUSB_DT_INTERFACE_SIZE 9 +#define LIBUSB_DT_ENDPOINT_SIZE 7 +#define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ +#define LIBUSB_DT_HUB_NONVAR_SIZE 7 + +#define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ +#define LIBUSB_ENDPOINT_DIR_MASK 0x80 + +/** \ingroup desc + * Endpoint direction. Values for bit 7 of the + * \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme. + */ +enum libusb_endpoint_direction { + /** In: device-to-host */ + LIBUSB_ENDPOINT_IN = 0x80, + + /** Out: host-to-device */ + LIBUSB_ENDPOINT_OUT = 0x00 +}; + +#define LIBUSB_TRANSFER_TYPE_MASK 0x03 /* in bmAttributes */ + +/** \ingroup desc + * Endpoint transfer type. Values for bits 0:1 of the + * \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field. + */ +enum libusb_transfer_type { + /** Control endpoint */ + LIBUSB_TRANSFER_TYPE_CONTROL = 0, + + /** Isochronous endpoint */ + LIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1, + + /** Bulk endpoint */ + LIBUSB_TRANSFER_TYPE_BULK = 2, + + /** Interrupt endpoint */ + LIBUSB_TRANSFER_TYPE_INTERRUPT = 3 +}; + +/** \ingroup misc + * Standard requests, as defined in table 9-3 of the USB2 specifications */ +enum libusb_standard_request { + /** Request status of the specific recipient */ + LIBUSB_REQUEST_GET_STATUS = 0x00, + + /** Clear or disable a specific feature */ + LIBUSB_REQUEST_CLEAR_FEATURE = 0x01, + + /* 0x02 is reserved */ + + /** Set or enable a specific feature */ + LIBUSB_REQUEST_SET_FEATURE = 0x03, + + /* 0x04 is reserved */ + + /** Set device address for all future accesses */ + LIBUSB_REQUEST_SET_ADDRESS = 0x05, + + /** Get the specified descriptor */ + LIBUSB_REQUEST_GET_DESCRIPTOR = 0x06, + + /** Used to update existing descriptors or add new descriptors */ + LIBUSB_REQUEST_SET_DESCRIPTOR = 0x07, + + /** Get the current device configuration value */ + LIBUSB_REQUEST_GET_CONFIGURATION = 0x08, + + /** Set device configuration */ + LIBUSB_REQUEST_SET_CONFIGURATION = 0x09, + + /** Return the selected alternate setting for the specified interface */ + LIBUSB_REQUEST_GET_INTERFACE = 0x0A, + + /** Select an alternate interface for the specified interface */ + LIBUSB_REQUEST_SET_INTERFACE = 0x0B, + + /** Set then report an endpoint's synchronization frame */ + LIBUSB_REQUEST_SYNCH_FRAME = 0x0C +}; + +/** \ingroup misc + * Request type bits of the + * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control + * transfers. */ +enum libusb_request_type { + /** Standard */ + LIBUSB_REQUEST_TYPE_STANDARD = (0x00 << 5), + + /** Class */ + LIBUSB_REQUEST_TYPE_CLASS = (0x01 << 5), + + /** Vendor */ + LIBUSB_REQUEST_TYPE_VENDOR = (0x02 << 5), + + /** Reserved */ + LIBUSB_REQUEST_TYPE_RESERVED = (0x03 << 5) +}; + +/** \ingroup misc + * Recipient bits of the + * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control + * transfers. Values 4 through 31 are reserved. */ +enum libusb_request_recipient { + /** Device */ + LIBUSB_RECIPIENT_DEVICE = 0x00, + + /** Interface */ + LIBUSB_RECIPIENT_INTERFACE = 0x01, + + /** Endpoint */ + LIBUSB_RECIPIENT_ENDPOINT = 0x02, + + /** Other */ + LIBUSB_RECIPIENT_OTHER = 0x03 +}; + +#define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C + +/** \ingroup desc + * Synchronization type for isochronous endpoints. Values for bits 2:3 of the + * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in + * libusb_endpoint_descriptor. + */ +enum libusb_iso_sync_type { + /** No synchronization */ + LIBUSB_ISO_SYNC_TYPE_NONE = 0, + + /** Asynchronous */ + LIBUSB_ISO_SYNC_TYPE_ASYNC = 1, + + /** Adaptive */ + LIBUSB_ISO_SYNC_TYPE_ADAPTIVE = 2, + + /** Synchronous */ + LIBUSB_ISO_SYNC_TYPE_SYNC = 3 +}; + +#define LIBUSB_ISO_USAGE_TYPE_MASK 0x30 + +/** \ingroup desc + * Usage type for isochronous endpoints. Values for bits 4:5 of the + * \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in + * libusb_endpoint_descriptor. + */ +enum libusb_iso_usage_type { + /** Data endpoint */ + LIBUSB_ISO_USAGE_TYPE_DATA = 0, + + /** Feedback endpoint */ + LIBUSB_ISO_USAGE_TYPE_FEEDBACK = 1, + + /** Implicit feedback Data endpoint */ + LIBUSB_ISO_USAGE_TYPE_IMPLICIT = 2 +}; + +/** \ingroup desc + * A structure representing the standard USB device descriptor. This + * descriptor is documented in section 9.6.1 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_device_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this + * context. */ + uint8_t bDescriptorType; + + /** USB specification release number in binary-coded decimal. A value of + * 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc. */ + uint16_t bcdUSB; + + /** USB-IF class code for the device. See \ref libusb_class_code. */ + uint8_t bDeviceClass; + + /** USB-IF subclass code for the device, qualified by the bDeviceClass + * value */ + uint8_t bDeviceSubClass; + + /** USB-IF protocol code for the device, qualified by the bDeviceClass and + * bDeviceSubClass values */ + uint8_t bDeviceProtocol; + + /** Maximum packet size for endpoint 0 */ + uint8_t bMaxPacketSize0; + + /** USB-IF vendor ID */ + uint16_t idVendor; + + /** USB-IF product ID */ + uint16_t idProduct; + + /** Device release number in binary-coded decimal */ + uint16_t bcdDevice; + + /** Index of string descriptor describing manufacturer */ + uint8_t iManufacturer; + + /** Index of string descriptor describing product */ + uint8_t iProduct; + + /** Index of string descriptor containing device serial number */ + uint8_t iSerialNumber; + + /** Number of possible configurations */ + uint8_t bNumConfigurations; +}; + +/** \ingroup desc + * A structure representing the standard USB endpoint descriptor. This + * descriptor is documented in section 9.6.3 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_endpoint_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in + * this context. */ + uint8_t bDescriptorType; + + /** The address of the endpoint described by this descriptor. Bits 0:3 are + * the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction, + * see \ref libusb_endpoint_direction. + */ + uint8_t bEndpointAddress; + + /** Attributes which apply to the endpoint when it is configured using + * the bConfigurationValue. Bits 0:1 determine the transfer type and + * correspond to \ref libusb_transfer_type. Bits 2:3 are only used for + * isochronous endpoints and correspond to \ref libusb_iso_sync_type. + * Bits 4:5 are also only used for isochronous endpoints and correspond to + * \ref libusb_iso_usage_type. Bits 6:7 are reserved. + */ + uint8_t bmAttributes; + + /** Maximum packet size this endpoint is capable of sending/receiving. */ + uint16_t wMaxPacketSize; + + /** Interval for polling endpoint for data transfers. */ + uint8_t bInterval; + + /** For audio devices only: the rate at which synchronization feedback + * is provided. */ + uint8_t bRefresh; + + /** For audio devices only: the address if the synch endpoint */ + uint8_t bSynchAddress; + + /** Extra descriptors. If libusb encounters unknown endpoint descriptors, + * it will store them here, should you wish to parse them. */ + const unsigned char *extra; + + /** Length of the extra descriptors, in bytes. */ + int extra_length; +}; + +/** \ingroup desc + * A structure representing the standard USB interface descriptor. This + * descriptor is documented in section 9.6.5 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_interface_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE + * in this context. */ + uint8_t bDescriptorType; + + /** Number of this interface */ + uint8_t bInterfaceNumber; + + /** Value used to select this alternate setting for this interface */ + uint8_t bAlternateSetting; + + /** Number of endpoints used by this interface (excluding the control + * endpoint). */ + uint8_t bNumEndpoints; + + /** USB-IF class code for this interface. See \ref libusb_class_code. */ + uint8_t bInterfaceClass; + + /** USB-IF subclass code for this interface, qualified by the + * bInterfaceClass value */ + uint8_t bInterfaceSubClass; + + /** USB-IF protocol code for this interface, qualified by the + * bInterfaceClass and bInterfaceSubClass values */ + uint8_t bInterfaceProtocol; + + /** Index of string descriptor describing this interface */ + uint8_t iInterface; + + /** Array of endpoint descriptors. This length of this array is determined + * by the bNumEndpoints field. */ + const struct libusb_endpoint_descriptor *endpoint; + + /** Extra descriptors. If libusb encounters unknown interface descriptors, + * it will store them here, should you wish to parse them. */ + const unsigned char *extra; + + /** Length of the extra descriptors, in bytes. */ + int extra_length; +}; + +/** \ingroup desc + * A collection of alternate settings for a particular USB interface. + */ +struct libusb_interface { + /** Array of interface descriptors. The length of this array is determined + * by the num_altsetting field. */ + const struct libusb_interface_descriptor *altsetting; + + /** The number of alternate settings that belong to this interface */ + int num_altsetting; +}; + +/** \ingroup desc + * A structure representing the standard USB configuration descriptor. This + * descriptor is documented in section 9.6.3 of the USB 2.0 specification. + * All multiple-byte fields are represented in host-endian format. + */ +struct libusb_config_descriptor { + /** Size of this descriptor (in bytes) */ + uint8_t bLength; + + /** Descriptor type. Will have value + * \ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG + * in this context. */ + uint8_t bDescriptorType; + + /** Total length of data returned for this configuration */ + uint16_t wTotalLength; + + /** Number of interfaces supported by this configuration */ + uint8_t bNumInterfaces; + + /** Identifier value for this configuration */ + uint8_t bConfigurationValue; + + /** Index of string descriptor describing this configuration */ + uint8_t iConfiguration; + + /** Configuration characteristics */ + uint8_t bmAttributes; + + /** Maximum power consumption of the USB device from this bus in this + * configuration when the device is fully opreation. Expressed in units + * of 2 mA. */ + uint8_t MaxPower; + + /** Array of interfaces supported by this configuration. The length of + * this array is determined by the bNumInterfaces field. */ + const struct libusb_interface *interface; + + /** Extra descriptors. If libusb encounters unknown configuration + * descriptors, it will store them here, should you wish to parse them. */ + const unsigned char *extra; + + /** Length of the extra descriptors, in bytes. */ + int extra_length; +}; + +/** \ingroup asyncio + * Setup packet for control transfers. */ +struct libusb_control_setup { + /** Request type. Bits 0:4 determine recipient, see + * \ref libusb_request_recipient. Bits 5:6 determine type, see + * \ref libusb_request_type. Bit 7 determines data transfer direction, see + * \ref libusb_endpoint_direction. + */ + uint8_t bmRequestType; + + /** Request. If the type bits of bmRequestType are equal to + * \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD + * "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to + * \ref libusb_standard_request. For other cases, use of this field is + * application-specific. */ + uint8_t bRequest; + + /** Value. Varies according to request */ + uint16_t wValue; + + /** Index. Varies according to request, typically used to pass an index + * or offset */ + uint16_t wIndex; + + /** Number of bytes to transfer */ + uint16_t wLength; +}; + +#define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup)) + +/* libusb */ + +struct libusb_context; +struct libusb_device; +struct libusb_device_handle; + +/** \ingroup lib + * Structure representing a libusb session. The concept of individual libusb + * sessions allows for your program to use two libraries (or dynamically + * load two modules) which both independently use libusb. This will prevent + * interference between the individual libusb users - for example + * libusb_set_debug() will not affect the other user of the library, and + * libusb_exit() will not destroy resources that the other user is still + * using. + * + * Sessions are created by libusb_init() and destroyed through libusb_exit(). + * If your application is guaranteed to only ever include a single libusb + * user (i.e. you), you do not have to worry about contexts: pass NULL in + * every function call where a context is required. The default context + * will be used. + * + * For more information, see \ref contexts. + */ +typedef struct libusb_context libusb_context; + +/** \ingroup dev + * Structure representing a USB device detected on the system. This is an + * opaque type for which you are only ever provided with a pointer, usually + * originating from libusb_get_device_list(). + * + * Certain operations can be performed on a device, but in order to do any + * I/O you will have to first obtain a device handle using libusb_open(). + * + * Devices are reference counted with libusb_device_ref() and + * libusb_device_unref(), and are freed when the reference count reaches 0. + * New devices presented by libusb_get_device_list() have a reference count of + * 1, and libusb_free_device_list() can optionally decrease the reference count + * on all devices in the list. libusb_open() adds another reference which is + * later destroyed by libusb_close(). + */ +typedef struct libusb_device libusb_device; + + +/** \ingroup dev + * Structure representing a handle on a USB device. This is an opaque type for + * which you are only ever provided with a pointer, usually originating from + * libusb_open(). + * + * A device handle is used to perform I/O and other operations. When finished + * with a device handle, you should call libusb_close(). + */ +typedef struct libusb_device_handle libusb_device_handle; + +/** \ingroup misc + * Error codes. Most libusb functions return 0 on success or one of these + * codes on failure. + * You can use libusb_strerror() to retrieve a short string description of + * a libusb_error enumeration value. + */ +enum libusb_error { + /** Success (no error) */ + LIBUSB_SUCCESS = 0, + + /** Input/output error */ + LIBUSB_ERROR_IO = -1, + + /** Invalid parameter */ + LIBUSB_ERROR_INVALID_PARAM = -2, + + /** Access denied (insufficient permissions) */ + LIBUSB_ERROR_ACCESS = -3, + + /** No such device (it may have been disconnected) */ + LIBUSB_ERROR_NO_DEVICE = -4, + + /** Entity not found */ + LIBUSB_ERROR_NOT_FOUND = -5, + + /** Resource busy */ + LIBUSB_ERROR_BUSY = -6, + + /** Operation timed out */ + LIBUSB_ERROR_TIMEOUT = -7, + + /** Overflow */ + LIBUSB_ERROR_OVERFLOW = -8, + + /** Pipe error */ + LIBUSB_ERROR_PIPE = -9, + + /** System call interrupted (perhaps due to signal) */ + LIBUSB_ERROR_INTERRUPTED = -10, + + /** Insufficient memory */ + LIBUSB_ERROR_NO_MEM = -11, + + /** Operation not supported or unimplemented on this platform */ + LIBUSB_ERROR_NOT_SUPPORTED = -12, + + /** Other error */ + LIBUSB_ERROR_OTHER = -99 + + /* IMPORTANT: when adding new values to this enum, remember to + update the libusb_strerror() function implementation! */ +}; + +/** \ingroup asyncio + * Transfer status codes */ +enum libusb_transfer_status { + /** Transfer completed without error. Note that this does not indicate + * that the entire amount of requested data was transferred. */ + LIBUSB_TRANSFER_COMPLETED, + + /** Transfer failed */ + LIBUSB_TRANSFER_ERROR, + + /** Transfer timed out */ + LIBUSB_TRANSFER_TIMED_OUT, + + /** Transfer was cancelled */ + LIBUSB_TRANSFER_CANCELLED, + + /** For bulk/interrupt endpoints: halt condition detected (endpoint + * stalled). For control endpoints: control request not supported. */ + LIBUSB_TRANSFER_STALL, + + /** Device was disconnected */ + LIBUSB_TRANSFER_NO_DEVICE, + + /** Device sent more data than requested */ + LIBUSB_TRANSFER_OVERFLOW +}; + +/** \ingroup asyncio + * libusb_transfer.flags values */ +enum libusb_transfer_flags { + /** Report short frames as errors */ + LIBUSB_TRANSFER_SHORT_NOT_OK = 1<<0, + + /** Automatically free() transfer buffer during libusb_free_transfer() */ + LIBUSB_TRANSFER_FREE_BUFFER = 1<<1, + + /** Automatically call libusb_free_transfer() after callback returns. + * If this flag is set, it is illegal to call libusb_free_transfer() + * from your transfer callback, as this will result in a double-free + * when this flag is acted upon. */ + LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2 +}; + +/** \ingroup asyncio + * Isochronous packet descriptor. */ +struct libusb_iso_packet_descriptor { + /** Length of data to request in this packet */ + unsigned int length; + + /** Amount of data that was actually transferred */ + unsigned int actual_length; + + /** Status code for this packet */ + enum libusb_transfer_status status; +}; + +struct libusb_transfer; + +/** \ingroup asyncio + * Asynchronous transfer callback function type. When submitting asynchronous + * transfers, you pass a pointer to a callback function of this type via the + * \ref libusb_transfer::callback "callback" member of the libusb_transfer + * structure. libusb will call this function later, when the transfer has + * completed or failed. See \ref asyncio for more information. + * \param transfer The libusb_transfer struct the callback function is being + * notified about. + */ +typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer); + +/** \ingroup asyncio + * The generic USB transfer structure. The user populates this structure and + * then submits it in order to request a transfer. After the transfer has + * completed, the library populates the transfer with the results and passes + * it back to the user. + */ +struct libusb_transfer { + /** Handle of the device that this transfer will be submitted to */ + libusb_device_handle *dev_handle; + + /** A bitwise OR combination of \ref libusb_transfer_flags. */ + uint8_t flags; + + /** Address of the endpoint where this transfer will be sent. */ + unsigned char endpoint; + + /** Type of the endpoint from \ref libusb_transfer_type */ + unsigned char type; + + /** Timeout for this transfer in millseconds. A value of 0 indicates no + * timeout. */ + unsigned int timeout; + + /** The status of the transfer. Read-only, and only for use within + * transfer callback function. + * + * If this is an isochronous transfer, this field may read COMPLETED even + * if there were errors in the frames. Use the + * \ref libusb_iso_packet_descriptor::status "status" field in each packet + * to determine if errors occurred. */ + enum libusb_transfer_status status; + + /** Length of the data buffer */ + int length; + + /** Actual length of data that was transferred. Read-only, and only for + * use within transfer callback function. Not valid for isochronous + * endpoint transfers. */ + int actual_length; + + /** Callback function. This will be invoked when the transfer completes, + * fails, or is cancelled. */ + libusb_transfer_cb_fn callback; + + /** User context data to pass to the callback function. */ + void *user_data; + + /** Data buffer */ + unsigned char *buffer; + + /** Number of isochronous packets. Only used for I/O with isochronous + * endpoints. */ + int num_iso_packets; + + /** Isochronous packet descriptors, for isochronous transfers only. */ + struct libusb_iso_packet_descriptor iso_packet_desc +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + [] /* valid C99 code */ +#else + [0] /* non-standard, but usually working code */ +#endif + ; +}; + +int LIBUSB_CALL libusb_init(libusb_context **ctx); +void LIBUSB_CALL libusb_exit(libusb_context *ctx); +void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level); +const char * LIBUSB_CALL libusb_strerror(enum libusb_error errcode); + +ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx, + libusb_device ***list); +void LIBUSB_CALL libusb_free_device_list(libusb_device **list, + int unref_devices); +libusb_device * LIBUSB_CALL libusb_ref_device(libusb_device *dev); +void LIBUSB_CALL libusb_unref_device(libusb_device *dev); + +int LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev, + int *config); +int LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev, + struct libusb_device_descriptor *desc); +int LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev, + struct libusb_config_descriptor **config); +int LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev, + uint8_t config_index, struct libusb_config_descriptor **config); +int LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev, + uint8_t bConfigurationValue, struct libusb_config_descriptor **config); +void LIBUSB_CALL libusb_free_config_descriptor( + struct libusb_config_descriptor *config); +uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev); +uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev); +int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev, + unsigned char endpoint); +int LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev, + unsigned char endpoint); + +int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **handle); +void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle); +libusb_device * LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle); + +int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev, + int configuration); +int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev, + int interface_number); +int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev, + int interface_number); + +libusb_device_handle * LIBUSB_CALL libusb_open_device_with_vid_pid( + libusb_context *ctx, uint16_t vendor_id, uint16_t product_id); + +int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev, + int interface_number, int alternate_setting); +int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev, + unsigned char endpoint); +int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev); + +int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev, + int interface_number); +int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev, + int interface_number); +int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev, + int interface_number); + +/* async I/O */ + +/** \ingroup asyncio + * Get the data section of a control transfer. This convenience function is here + * to remind you that the data does not start until 8 bytes into the actual + * buffer, as the setup packet comes first. + * + * Calling this function only makes sense from a transfer callback function, + * or situations where you have already allocated a suitably sized buffer at + * transfer->buffer. + * + * \param transfer a transfer + * \returns pointer to the first byte of the data section + */ +static inline unsigned char *libusb_control_transfer_get_data( + struct libusb_transfer *transfer) +{ + return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE; +} + +/** \ingroup asyncio + * Get the control setup packet of a control transfer. This convenience + * function is here to remind you that the control setup occupies the first + * 8 bytes of the transfer data buffer. + * + * Calling this function only makes sense from a transfer callback function, + * or situations where you have already allocated a suitably sized buffer at + * transfer->buffer. + * + * \param transfer a transfer + * \returns a casted pointer to the start of the transfer data buffer + */ +static inline struct libusb_control_setup *libusb_control_transfer_get_setup( + struct libusb_transfer *transfer) +{ + return (struct libusb_control_setup *) transfer->buffer; +} + +/** \ingroup asyncio + * Helper function to populate the setup packet (first 8 bytes of the data + * buffer) for a control transfer. The wIndex, wValue and wLength values should + * be given in host-endian byte order. + * + * \param buffer buffer to output the setup packet into + * \param bmRequestType see the + * \ref libusb_control_setup::bmRequestType "bmRequestType" field of + * \ref libusb_control_setup + * \param bRequest see the + * \ref libusb_control_setup::bRequest "bRequest" field of + * \ref libusb_control_setup + * \param wValue see the + * \ref libusb_control_setup::wValue "wValue" field of + * \ref libusb_control_setup + * \param wIndex see the + * \ref libusb_control_setup::wIndex "wIndex" field of + * \ref libusb_control_setup + * \param wLength see the + * \ref libusb_control_setup::wLength "wLength" field of + * \ref libusb_control_setup + */ +static inline void libusb_fill_control_setup(unsigned char *buffer, + uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, + uint16_t wLength) +{ + struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer; + setup->bmRequestType = bmRequestType; + setup->bRequest = bRequest; + setup->wValue = libusb_cpu_to_le16(wValue); + setup->wIndex = libusb_cpu_to_le16(wIndex); + setup->wLength = libusb_cpu_to_le16(wLength); +} + +struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets); +int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer); +int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer); +void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer); + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for a control transfer. + * + * If you pass a transfer buffer to this function, the first 8 bytes will + * be interpreted as a control setup packet, and the wLength field will be + * used to automatically populate the \ref libusb_transfer::length "length" + * field of the transfer. Therefore the recommended approach is: + * -# Allocate a suitably sized data buffer (including space for control setup) + * -# Call libusb_fill_control_setup() + * -# If this is a host-to-device transfer with a data stage, put the data + * in place after the setup packet + * -# Call this function + * -# Call libusb_submit_transfer() + * + * It is also legal to pass a NULL buffer to this function, in which case this + * function will not attempt to populate the length field. Remember that you + * must then populate the buffer and length fields later. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param buffer data buffer. If provided, this function will interpret the + * first 8 bytes as a setup packet and infer the transfer length from that. + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_control_transfer( + struct libusb_transfer *transfer, libusb_device_handle *dev_handle, + unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data, + unsigned int timeout) +{ + struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer; + transfer->dev_handle = dev_handle; + transfer->endpoint = 0; + transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL; + transfer->timeout = timeout; + transfer->buffer = buffer; + if (setup) + transfer->length = LIBUSB_CONTROL_SETUP_SIZE + + libusb_le16_to_cpu(setup->wLength); + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for a bulk transfer. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param endpoint address of the endpoint where this transfer will be sent + * \param buffer data buffer + * \param length length of data buffer + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer, + libusb_device_handle *dev_handle, unsigned char endpoint, + unsigned char *buffer, int length, libusb_transfer_cb_fn callback, + void *user_data, unsigned int timeout) +{ + transfer->dev_handle = dev_handle; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_BULK; + transfer->timeout = timeout; + transfer->buffer = buffer; + transfer->length = length; + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for an interrupt transfer. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param endpoint address of the endpoint where this transfer will be sent + * \param buffer data buffer + * \param length length of data buffer + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_interrupt_transfer( + struct libusb_transfer *transfer, libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *buffer, int length, + libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) +{ + transfer->dev_handle = dev_handle; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_INTERRUPT; + transfer->timeout = timeout; + transfer->buffer = buffer; + transfer->length = length; + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Helper function to populate the required \ref libusb_transfer fields + * for an isochronous transfer. + * + * \param transfer the transfer to populate + * \param dev_handle handle of the device that will handle the transfer + * \param endpoint address of the endpoint where this transfer will be sent + * \param buffer data buffer + * \param length length of data buffer + * \param num_iso_packets the number of isochronous packets + * \param callback callback function to be invoked on transfer completion + * \param user_data user data to pass to callback function + * \param timeout timeout for the transfer in milliseconds + */ +static inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer, + libusb_device_handle *dev_handle, unsigned char endpoint, + unsigned char *buffer, int length, int num_iso_packets, + libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) +{ + transfer->dev_handle = dev_handle; + transfer->endpoint = endpoint; + transfer->type = LIBUSB_TRANSFER_TYPE_ISOCHRONOUS; + transfer->timeout = timeout; + transfer->buffer = buffer; + transfer->length = length; + transfer->num_iso_packets = num_iso_packets; + transfer->user_data = user_data; + transfer->callback = callback; +} + +/** \ingroup asyncio + * Convenience function to set the length of all packets in an isochronous + * transfer, based on the num_iso_packets field in the transfer structure. + * + * \param transfer a transfer + * \param length the length to set in each isochronous packet descriptor + * \see libusb_get_max_packet_size() + */ +static inline void libusb_set_iso_packet_lengths( + struct libusb_transfer *transfer, unsigned int length) +{ + int i; + for (i = 0; i < transfer->num_iso_packets; i++) + transfer->iso_packet_desc[i].length = length; +} + +/** \ingroup asyncio + * Convenience function to locate the position of an isochronous packet + * within the buffer of an isochronous transfer. + * + * This is a thorough function which loops through all preceding packets, + * accumulating their lengths to find the position of the specified packet. + * Typically you will assign equal lengths to each packet in the transfer, + * and hence the above method is sub-optimal. You may wish to use + * libusb_get_iso_packet_buffer_simple() instead. + * + * \param transfer a transfer + * \param packet the packet to return the address of + * \returns the base address of the packet buffer inside the transfer buffer, + * or NULL if the packet does not exist. + * \see libusb_get_iso_packet_buffer_simple() + */ +static inline unsigned char *libusb_get_iso_packet_buffer( + struct libusb_transfer *transfer, unsigned int packet) +{ + int i; + size_t offset = 0; + int _packet; + + /* oops..slight bug in the API. packet is an unsigned int, but we use + * signed integers almost everywhere else. range-check and convert to + * signed to avoid compiler warnings. FIXME for libusb-2. */ + if (packet > INT_MAX) + return NULL; + _packet = packet; + + if (_packet >= transfer->num_iso_packets) + return NULL; + + for (i = 0; i < _packet; i++) + offset += transfer->iso_packet_desc[i].length; + + return transfer->buffer + offset; +} + +/** \ingroup asyncio + * Convenience function to locate the position of an isochronous packet + * within the buffer of an isochronous transfer, for transfers where each + * packet is of identical size. + * + * This function relies on the assumption that every packet within the transfer + * is of identical size to the first packet. Calculating the location of + * the packet buffer is then just a simple calculation: + * buffer + (packet_size * packet) + * + * Do not use this function on transfers other than those that have identical + * packet lengths for each packet. + * + * \param transfer a transfer + * \param packet the packet to return the address of + * \returns the base address of the packet buffer inside the transfer buffer, + * or NULL if the packet does not exist. + * \see libusb_get_iso_packet_buffer() + */ +static inline unsigned char *libusb_get_iso_packet_buffer_simple( + struct libusb_transfer *transfer, unsigned int packet) +{ + int _packet; + + /* oops..slight bug in the API. packet is an unsigned int, but we use + * signed integers almost everywhere else. range-check and convert to + * signed to avoid compiler warnings. FIXME for libusb-2. */ + if (packet > INT_MAX) + return NULL; + _packet = packet; + + if (_packet >= transfer->num_iso_packets) + return NULL; + + return transfer->buffer + (transfer->iso_packet_desc[0].length * _packet); +} + +/* sync I/O */ + +int LIBUSB_CALL libusb_control_transfer(libusb_device_handle *dev_handle, + uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, + unsigned char *data, uint16_t wLength, unsigned int timeout); + +int LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *data, int length, + int *actual_length, unsigned int timeout); + +int LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle, + unsigned char endpoint, unsigned char *data, int length, + int *actual_length, unsigned int timeout); + +/** \ingroup desc + * Retrieve a descriptor from the default control pipe. + * This is a convenience function which formulates the appropriate control + * message to retrieve the descriptor. + * + * \param dev a device handle + * \param desc_type the descriptor type, see \ref libusb_descriptor_type + * \param desc_index the index of the descriptor to retrieve + * \param data output buffer for descriptor + * \param length size of data buffer + * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure + */ +static inline int libusb_get_descriptor(libusb_device_handle *dev, + uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length) +{ + return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, + LIBUSB_REQUEST_GET_DESCRIPTOR, (desc_type << 8) | desc_index, 0, data, + (uint16_t) length, 1000); +} + +/** \ingroup desc + * Retrieve a descriptor from a device. + * This is a convenience function which formulates the appropriate control + * message to retrieve the descriptor. The string returned is Unicode, as + * detailed in the USB specifications. + * + * \param dev a device handle + * \param desc_index the index of the descriptor to retrieve + * \param langid the language ID for the string descriptor + * \param data output buffer for descriptor + * \param length size of data buffer + * \returns number of bytes returned in data, or LIBUSB_ERROR code on failure + * \see libusb_get_string_descriptor_ascii() + */ +static inline int libusb_get_string_descriptor(libusb_device_handle *dev, + uint8_t desc_index, uint16_t langid, unsigned char *data, int length) +{ + return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN, + LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_STRING << 8) | desc_index, + langid, data, (uint16_t) length, 1000); +} + +int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev, + uint8_t desc_index, unsigned char *data, int length); + +/* polling and timeouts */ + +int LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx); +void LIBUSB_CALL libusb_lock_events(libusb_context *ctx); +void LIBUSB_CALL libusb_unlock_events(libusb_context *ctx); +int LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx); +int LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx); +void LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx); +void LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx); +int LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv); + +int LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx, + struct timeval *tv); +int LIBUSB_CALL libusb_handle_events(libusb_context *ctx); +int LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx, + struct timeval *tv); +int LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx); +int LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx, + struct timeval *tv); + +/** \ingroup poll + * File descriptor for polling + */ +struct libusb_pollfd { + /** Numeric file descriptor */ + int fd; + + /** Event flags to poll for from . POLLIN indicates that you + * should monitor this file descriptor for becoming ready to read from, + * and POLLOUT indicates that you should monitor this file descriptor for + * nonblocking write readiness. */ + short events; +}; + +/** \ingroup poll + * Callback function, invoked when a new file descriptor should be added + * to the set of file descriptors monitored for events. + * \param fd the new file descriptor + * \param events events to monitor for, see \ref libusb_pollfd for a + * description + * \param user_data User data pointer specified in + * libusb_set_pollfd_notifiers() call + * \see libusb_set_pollfd_notifiers() + */ +typedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events, + void *user_data); + +/** \ingroup poll + * Callback function, invoked when a file descriptor should be removed from + * the set of file descriptors being monitored for events. After returning + * from this callback, do not use that file descriptor again. + * \param fd the file descriptor to stop monitoring + * \param user_data User data pointer specified in + * libusb_set_pollfd_notifiers() call + * \see libusb_set_pollfd_notifiers() + */ +typedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data); + +const struct libusb_pollfd ** LIBUSB_CALL libusb_get_pollfds( + libusb_context *ctx); +void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx, + libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, + void *user_data); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/KinectJNI_v0002/src/libusb/osx/libs/libusb-1.0.a b/KinectJNI_v0002/src/libusb/osx/libs/libusb-1.0.a new file mode 100644 index 0000000..c486e36 Binary files /dev/null and b/KinectJNI_v0002/src/libusb/osx/libs/libusb-1.0.a differ diff --git a/KinectJNI_v0002/src/libusb/osx/libs/usb-1.0.a b/KinectJNI_v0002/src/libusb/osx/libs/usb-1.0.a new file mode 100644 index 0000000..3a2222d Binary files /dev/null and b/KinectJNI_v0002/src/libusb/osx/libs/usb-1.0.a differ diff --git a/KinectJNI_v0002/src/native/NativeAddressBook.h b/KinectJNI_v0002/src/native/NativeAddressBook.h new file mode 100644 index 0000000..17b1d48 --- /dev/null +++ b/KinectJNI_v0002/src/native/NativeAddressBook.h @@ -0,0 +1,9 @@ +// +// NativeAddressBook.h +// KinectJNI +// +// Created by Daniel Shiffman on 11/14/10. +// Copyright (c) 2010, ITP. All rights reserved. +// + +#import diff --git a/KinectJNI_v0002/src/native/NativeAddressBook.m b/KinectJNI_v0002/src/native/NativeAddressBook.m new file mode 100644 index 0000000..c017953 --- /dev/null +++ b/KinectJNI_v0002/src/native/NativeAddressBook.m @@ -0,0 +1,16 @@ +// +// NativeAddressBook.m +// KinectJNI +// +// Created by Daniel Shiffman on 11/14/10. +// Copyright 2010 ITP. All rights reserved. +// + + +#import "shiffman_kinect_NativeAddressBook.h" // generated from NativeAddressBook.java + +JNIEXPORT jint JNICALL Java_shiffman_kinect_NativeAddressBook_getNumber +(JNIEnv *env, jclass clazz) +{ + return 55; +} \ No newline at end of file diff --git a/KinectJNI_v0002/src/native/NativeKinect.cpp b/KinectJNI_v0002/src/native/NativeKinect.cpp new file mode 100644 index 0000000..fa8029b --- /dev/null +++ b/KinectJNI_v0002/src/native/NativeKinect.cpp @@ -0,0 +1,19 @@ +/* + * NativeKinect.cpp + * KinectJNI + * + * Created by Daniel Shiffman on 11/14/10. + * Copyright 2010 ITP. All rights reserved. + * + */ + +#include "NativeKinect.h" + +#import "shiffman_kinect_NativeKinect.h" // generated from NativeAddressBook.java + +JNIEXPORT jint JNICALL Java_shiffman_kinect_NativeKinect_getNumber +(JNIEnv *env, jclass clazz) +{ + return 66; +} + diff --git a/KinectJNI_v0002/src/native/NativeKinect.h b/KinectJNI_v0002/src/native/NativeKinect.h new file mode 100644 index 0000000..eb1b3ea --- /dev/null +++ b/KinectJNI_v0002/src/native/NativeKinect.h @@ -0,0 +1,10 @@ +/* + * NativeKinect.h + * KinectJNI + * + * Created by Daniel Shiffman on 11/14/10. + * Copyright 2010 ITP. All rights reserved. + * + */ + +#include \ No newline at end of file diff --git a/KinectJNI_v0002/src/native/native-1.moved-aside/NativeKinect.h b/KinectJNI_v0002/src/native/native-1.moved-aside/NativeKinect.h new file mode 100644 index 0000000..0c1857b --- /dev/null +++ b/KinectJNI_v0002/src/native/native-1.moved-aside/NativeKinect.h @@ -0,0 +1,9 @@ +/* + * NativeKinect.h + * KinectJNI + * + * Created by Daniel Shiffman on 11/14/10. + * Copyright 2010 ITP. All rights reserved. + * + */ + diff --git a/KinectJNI_v0002/src/native/org_openkinect_Context.cpp b/KinectJNI_v0002/src/native/org_openkinect_Context.cpp new file mode 100644 index 0000000..0f8b71f --- /dev/null +++ b/KinectJNI_v0002/src/native/org_openkinect_Context.cpp @@ -0,0 +1,199 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#include +#include +#include +#include + +#include "org_openkinect_Context.h" + + +struct Data +{ + void *rgb; + void *depth; + + Data() : rgb(0), depth(0) {} +}; + +std::list logs; +std::map data; + +jobject jDevice(JNIEnv* env, jobject jContext, freenect_device *dev) +{ + jclass clazz = env->GetObjectClass(jContext); + jmethodID methodID = env->GetMethodID(clazz, "device", "(J)Lorg/openkinect/Device;"); + return env->CallObjectMethod(jContext, methodID, (jlong) dev); +} + +void log_cb(freenect_context *context, freenect_loglevel level, const char *msg) +{ + logs.push_back(msg); +} + +void rgb_cb(freenect_device *dev, void *rgb, uint32_t timestamp) +{ + data[dev].rgb = rgb; +} + +void depth_cb(freenect_device *dev, void *v_depth, uint32_t timestamp) +{ + data[dev].depth = v_depth; +} + +freenect_context *context(JNIEnv *env, jobject obj) +{ + jclass clazz = env->GetObjectClass(obj); + jfieldID fieldID = env->GetFieldID(clazz, "jni", "J"); + + jlong ptr = env->GetLongField(obj, fieldID); + return (freenect_context*) ptr; +} + + +JNIEXPORT jlong JNICALL Java_org_openkinect_Context_jniInit + (JNIEnv *, jobject) +{ + freenect_context *f_ctx = 0; + + if (freenect_init(&f_ctx, NULL) < 0) + { + return 0; + } + + freenect_set_log_callback(f_ctx, log_cb); + + return (jlong) f_ctx; +} + +JNIEXPORT void JNICALL Java_org_openkinect_Context_jniShutdown + (JNIEnv *env, jobject obj) +{ + freenect_context *f_ctx = context(env, obj); + freenect_shutdown(f_ctx); +} + +JNIEXPORT jboolean JNICALL Java_org_openkinect_Context_jniProcessEvents + (JNIEnv *env, jobject jContext) +{ + + freenect_context *f_ctx = context(env, jContext); + + for(std::list::const_iterator it = logs.begin(); it != logs.end(); ++it) + { + jobject jString = env->NewStringUTF(it->c_str()); + jclass clazz = env->GetObjectClass(jContext); + jmethodID methodID = env->GetMethodID(clazz, "onLog", "(Ljava/lang/String;)V"); + env->CallVoidMethod(jContext, methodID, jString); + } + logs.clear(); + + bool success = (freenect_process_events(f_ctx) >= 0); + + + + for(std::map::iterator it = data.begin(); it != data.end(); ++it) + { + freenect_device *f_dev = it->first; + Data& d = it->second; + + if(d.rgb) + { + jobject buffer = env->NewDirectByteBuffer(d.rgb, FREENECT_VIDEO_RGB_SIZE); + + jobject device = jDevice(env, jContext, f_dev); + jclass clazz = env->GetObjectClass(device); + jmethodID methodID = env->GetMethodID(clazz, "onRGB", "(Ljava/nio/ByteBuffer;)V"); + env->CallVoidMethod(device, methodID, buffer); + + d.rgb = 0; + } + + if(d.depth) + { + jobject buffer = env->NewDirectByteBuffer(d.depth, FREENECT_DEPTH_11BIT_SIZE); + + jobject device = jDevice(env, jContext, f_dev); + jclass clazz = env->GetObjectClass(device); + jmethodID methodID = env->GetMethodID(clazz, "onDepth", "(Ljava/nio/ByteBuffer;)V"); + env->CallVoidMethod(device, methodID, buffer); + + d.depth = 0; + } + + { + // WHOA NEED TO FIX! + /*freenect_update_device_state(f_dev); + freenect_raw_device_state* f_dev_raw = freenect_get_device_state(f_dev); + + double x, y, z; + freenect_get_mks_accel(f_dev_raw, &x, &y, &z); + + jobject device = jDevice(env, jContext, f_dev); + jclass clazz = env->GetObjectClass(device); + jmethodID methodID = env->GetMethodID(clazz, "onAcceleration", "(FFF)V"); + env->CallVoidMethod(device, methodID, (jfloat) x, (jfloat) y, (jfloat) z);*/ + } + } + + return success; +} + +JNIEXPORT jint JNICALL Java_org_openkinect_Context_jniNumDevices + (JNIEnv *env, jobject obj) +{ + freenect_context *f_ctx = context(env, obj); + return freenect_num_devices(f_ctx); +} + +JNIEXPORT jlong JNICALL Java_org_openkinect_Context_jniOpenDevice + (JNIEnv *env, jobject obj, jint index) +{ + freenect_context *f_ctx = context(env, obj); + + freenect_device *f_dev = 0; + if(freenect_open_device(f_ctx, &f_dev, index) < 0) + { + return 0; + } + + freenect_set_video_callback(f_dev, rgb_cb); + freenect_set_depth_callback(f_dev, depth_cb); + + return (jlong) f_dev; +} + +JNIEXPORT void JNICALL Java_org_openkinect_Context_jniSetLogLevel + (JNIEnv *env, jobject obj, jint level) +{ + freenect_context *f_ctx = context(env, obj); + freenect_set_log_level(f_ctx, (freenect_loglevel) level); +} + + + + diff --git a/KinectJNI_v0002/src/native/org_openkinect_Context.h b/KinectJNI_v0002/src/native/org_openkinect_Context.h new file mode 100644 index 0000000..25b2e32 --- /dev/null +++ b/KinectJNI_v0002/src/native/org_openkinect_Context.h @@ -0,0 +1,61 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_openkinect_Context */ + +#ifndef _Included_org_openkinect_Context +#define _Included_org_openkinect_Context +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_openkinect_Context + * Method: jniInit + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_openkinect_Context_jniInit + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Context + * Method: jniShutdown + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Context_jniShutdown + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Context + * Method: jniProcessEvents + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_openkinect_Context_jniProcessEvents + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Context + * Method: jniNumDevices + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_openkinect_Context_jniNumDevices + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Context + * Method: jniOpenDevice + * Signature: (I)J + */ +JNIEXPORT jlong JNICALL Java_org_openkinect_Context_jniOpenDevice + (JNIEnv *, jobject, jint); + +/* + * Class: org_openkinect_Context + * Method: jniSetLogLevel + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Context_jniSetLogLevel + (JNIEnv *, jobject, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/KinectJNI_v0002/src/native/org_openkinect_Device.cpp b/KinectJNI_v0002/src/native/org_openkinect_Device.cpp new file mode 100644 index 0000000..921ca91 --- /dev/null +++ b/KinectJNI_v0002/src/native/org_openkinect_Device.cpp @@ -0,0 +1,102 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +#include + +#include "org_openkinect_Device.h" + +freenect_device *device(JNIEnv *env, jobject obj) +{ + jclass clazz = env->GetObjectClass(obj); + jfieldID fieldID = env->GetFieldID(clazz, "jni", "J"); + + jlong ptr = env->GetLongField(obj, fieldID); + return (freenect_device*) ptr; +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniClose + (JNIEnv *env, jobject obj) +{ + freenect_device *f_dev = device(env, obj); + freenect_close_device(f_dev); +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetLED + (JNIEnv *env, jobject obj, jint led) +{ + freenect_device *f_dev = device(env, obj); + freenect_set_led(f_dev, (freenect_led_options) led); +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetTiltDegs + (JNIEnv *env, jobject obj, jfloat deg) +{ + freenect_device *f_dev = device(env, obj); + freenect_set_tilt_degs(f_dev, (double) deg); +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetFormatRGB + (JNIEnv *env, jobject obj, jint format) +{ + freenect_device *f_dev = device(env, obj); + freenect_set_video_format(f_dev, (freenect_video_format) format); +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetFormatDepth + (JNIEnv *env, jobject obj, jint format) +{ + freenect_device *f_dev = device(env, obj); + freenect_set_depth_format(f_dev, (freenect_depth_format) format); +} + + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStartCaptureRGB + (JNIEnv *env, jobject obj) +{ + freenect_device *f_dev = device(env, obj); + freenect_start_video(f_dev); +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStartCaptureDepth + (JNIEnv *env, jobject obj) +{ + freenect_device *f_dev = device(env, obj); + freenect_start_depth(f_dev); +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStopCaptureRGB +(JNIEnv *env, jobject obj) +{ + freenect_device *f_dev = device(env, obj); + freenect_stop_video(f_dev); +} + +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStopCaptureDepth + (JNIEnv *env, jobject obj) +{ + freenect_device *f_dev = device(env, obj); + freenect_stop_depth(f_dev); +} diff --git a/KinectJNI_v0002/src/native/org_openkinect_Device.h b/KinectJNI_v0002/src/native/org_openkinect_Device.h new file mode 100644 index 0000000..9e8d737 --- /dev/null +++ b/KinectJNI_v0002/src/native/org_openkinect_Device.h @@ -0,0 +1,85 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_openkinect_Device */ + +#ifndef _Included_org_openkinect_Device +#define _Included_org_openkinect_Device +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_openkinect_Device + * Method: jniClose + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniClose + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Device + * Method: jniSetLED + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetLED + (JNIEnv *, jobject, jint); + +/* + * Class: org_openkinect_Device + * Method: jniSetTiltDegs + * Signature: (F)V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetTiltDegs + (JNIEnv *, jobject, jfloat); + +/* + * Class: org_openkinect_Device + * Method: jniSetFormatRGB + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetFormatRGB + (JNIEnv *, jobject, jint); + +/* + * Class: org_openkinect_Device + * Method: jniSetFormatDepth + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniSetFormatDepth + (JNIEnv *, jobject, jint); + +/* + * Class: org_openkinect_Device + * Method: jniStartCaptureRGB + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStartCaptureRGB + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Device + * Method: jniStartCaptureDepth + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStartCaptureDepth + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Device + * Method: jniStopCaptureRGB + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStopCaptureRGB + (JNIEnv *, jobject); + +/* + * Class: org_openkinect_Device + * Method: jniStopCaptureDepth + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_openkinect_Device_jniStopCaptureDepth + (JNIEnv *, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/KinectJNI_v0002/src/org/openkinect/Acceleration.java b/KinectJNI_v0002/src/org/openkinect/Acceleration.java new file mode 100644 index 0000000..6cdd14c --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/Acceleration.java @@ -0,0 +1,35 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public interface Acceleration +{ + void direction(float x, float y, float z); +} diff --git a/KinectJNI_v0002/src/org/openkinect/ColorFormat.java b/KinectJNI_v0002/src/org/openkinect/ColorFormat.java new file mode 100644 index 0000000..109ffad --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/ColorFormat.java @@ -0,0 +1,36 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum ColorFormat +{ + RGB_8_8_8, + BAYER, +} diff --git a/KinectJNI_v0002/src/org/openkinect/Context.java b/KinectJNI_v0002/src/org/openkinect/Context.java new file mode 100644 index 0000000..105a725 --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/Context.java @@ -0,0 +1,148 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Michael Nischt + */ +public class Context +{ + // + + static + { + System.loadLibrary("OpenKinect"); + } + + public static Context getContext() + { + return instance; + } + private static final Context instance = new Context(); + + // + + private final long jni; + private Logger logger; + private final Map jniMap = new HashMap(); + + private Context() + { + jni = jniInit(); + + Runtime.getRuntime().addShutdownHook(new Thread() + { + @Override + public void run() + { + List devices = new ArrayList(jniMap.values()); + for(Device device : devices) + { + device.dispose(); + } + jniShutdown(); + } + }); + } + + public int devices() + { + return jniNumDevices(); + } + + public Device getDevice(int index) + { + long dev_ptr = jniOpenDevice(index); + if(dev_ptr == 0) + { + return null; + } + Device device = new Device(this, dev_ptr); + jniMap.put(dev_ptr, device); + return device; + } + + public boolean processEvents() + { + return jniProcessEvents(); + } + + public Device device(long jni) + { + return jniMap.get(jni); + } + + public void log(Logger logger) + { + log(logger, LogLevel.INFO); + } + + public void log(Logger logger, LogLevel level) + { + jniSetLogLevel(level.ordinal()); + this.logger = logger; + } + + void disposeDevice(long dev_ptr) + { + jniMap.remove(dev_ptr); + } + + + // + + void onLog(String msg) + { + if(logger != null) + { + logger.log(msg); + } + } + + // + + // + + native private long jniInit(); + + native private void jniShutdown(); + + native private boolean jniProcessEvents(); + + native private int jniNumDevices(); + + native private long jniOpenDevice(int index); + + native private void jniSetLogLevel(int level); + + // +} diff --git a/KinectJNI_v0002/src/org/openkinect/DepthFormat.java b/KinectJNI_v0002/src/org/openkinect/DepthFormat.java new file mode 100644 index 0000000..ed7f429 --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/DepthFormat.java @@ -0,0 +1,38 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum DepthFormat +{ + RAW_11, + RAW_10, + PACKED_11, + PACKED_10; +} diff --git a/KinectJNI_v0002/src/org/openkinect/Device.java b/KinectJNI_v0002/src/org/openkinect/Device.java new file mode 100644 index 0000000..a68a700 --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/Device.java @@ -0,0 +1,185 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * @author Michael Nischt + */ +public final class Device +{ + private final Context context; + private long jni; + + private Image rgb, depth; + private Acceleration acceleration; + + Device(Context context, long jni) + { + if(context == null) + { + throw new NullPointerException(); + } + + this.context = context; + this.jni = jni; + } + + public void light(LEDStatus led) + { + checkDisposed(); + + jniSetLED(led.ordinal()); + } + + public void tilt(float deg) + { + checkDisposed(); + + jniSetTiltDegs(deg); + } + + public void color(Image image) + { + color(image, ColorFormat.RGB_8_8_8); + } + + public void color(Image image, ColorFormat format) + { + checkDisposed(); + + jniSetFormatRGB(format.ordinal()); + rgb = image; + + if(rgb != null) + { + jniStartCaptureRGB(); + } + else + { + jniStopCaptureRGB(); + } + } + + public void depth(Image image) + { + depth(image, DepthFormat.RAW_11); + } + + public void depth(Image image, DepthFormat format) + { + checkDisposed(); + + jniSetFormatDepth(format.ordinal()); + depth = image; + + if(depth != null) + { + jniStartCaptureDepth(); + } + else + { + jniStopCaptureDepth(); + } + } + + public void acceleration(Acceleration acceleration) + { + checkDisposed(); + + this.acceleration = acceleration; + } + + public void dispose() + { + context.disposeDevice(jni); + jniClose(); + jni = 0; + } + + private void checkDisposed() + { + if(jni == 0) + { + throw new IllegalStateException("Device already dispoed."); + } + } + + // + + void onRGB(ByteBuffer buffer) + { + if (rgb != null) + { + buffer.order(ByteOrder.nativeOrder()); + rgb.data(buffer); + } + } + + void onDepth(ByteBuffer buffer) + { + if (depth != null) + { + buffer.order(ByteOrder.nativeOrder()); + depth.data(buffer); + } + } + + void onAcceleration(float x, float y, float z) + { + if (acceleration != null) + { + acceleration.direction(x, y, z); + } + } + + // + + // + + native private void jniClose(); + + native private void jniSetLED(int light); + + native private void jniSetTiltDegs(float deg); + + native private void jniSetFormatRGB(int format); + + native private void jniSetFormatDepth(int format); + + native private void jniStartCaptureRGB(); + + native private void jniStartCaptureDepth(); + + native private void jniStopCaptureRGB(); + + native private void jniStopCaptureDepth(); + + // +} diff --git a/KinectJNI_v0002/src/org/openkinect/Image.java b/KinectJNI_v0002/src/org/openkinect/Image.java new file mode 100644 index 0000000..7acb78b --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/Image.java @@ -0,0 +1,37 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +import java.nio.ByteBuffer; + +/** + * @author Michael Nischt + */ +public interface Image +{ + void data(ByteBuffer image); +} diff --git a/KinectJNI_v0002/src/org/openkinect/LEDStatus.java b/KinectJNI_v0002/src/org/openkinect/LEDStatus.java new file mode 100644 index 0000000..80106e9 --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/LEDStatus.java @@ -0,0 +1,41 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum LEDStatus +{ + LED_OFF, + LED_GREEN, + LED_RED, + LED_YELLOW, + LED_BLINK_YELLOW, + LED_BLINK_GREEN, + LED_BLINK_RED_YELLOW; +} diff --git a/KinectJNI_v0002/src/org/openkinect/LogLevel.java b/KinectJNI_v0002/src/org/openkinect/LogLevel.java new file mode 100644 index 0000000..4904b7e --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/LogLevel.java @@ -0,0 +1,42 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum LogLevel +{ + FATAL, + ERROR, + WARNING, + NOTICE, + INFO, + DEBUG, + SPEW, + FLOOD; +} diff --git a/KinectJNI_v0002/src/org/openkinect/Logger.java b/KinectJNI_v0002/src/org/openkinect/Logger.java new file mode 100644 index 0000000..cb445da --- /dev/null +++ b/KinectJNI_v0002/src/org/openkinect/Logger.java @@ -0,0 +1,35 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public interface Logger +{ + void log(String msg); +} diff --git a/OpenKinect-Processing/.classpath b/OpenKinect-Processing/.classpath new file mode 100755 index 0000000..4c10b9d --- /dev/null +++ b/OpenKinect-Processing/.classpath @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/OpenKinect-Processing/.gitignore b/OpenKinect-Processing/.gitignore new file mode 100755 index 0000000..c8572d9 --- /dev/null +++ b/OpenKinect-Processing/.gitignore @@ -0,0 +1 @@ +distribution diff --git a/OpenKinect-Processing/.project b/OpenKinect-Processing/.project new file mode 100755 index 0000000..8c757d1 --- /dev/null +++ b/OpenKinect-Processing/.project @@ -0,0 +1,17 @@ + + + OpenKinect-Processing + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/OpenKinect-Processing/data/kinectThreshold.txt b/OpenKinect-Processing/data/kinectThreshold.txt new file mode 100644 index 0000000..1217bfd --- /dev/null +++ b/OpenKinect-Processing/data/kinectThreshold.txt @@ -0,0 +1 @@ +630 diff --git a/OpenKinect-Processing/examples/AveragePointTracking/AveragePointTracking.pde b/OpenKinect-Processing/examples/AveragePointTracking/AveragePointTracking.pde new file mode 100644 index 0000000..d7eb226 --- /dev/null +++ b/OpenKinect-Processing/examples/AveragePointTracking/AveragePointTracking.pde @@ -0,0 +1,65 @@ +// Daniel Shiffman +// Tracking the average location beyond a given depth threshold +// Thanks to Dan O'Sullivan +// http://www.shiffman.net +// https://github.com/shiffman/libfreenect/tree/master/wrappers/java/processing + +import org.openkinect.*; +import org.openkinect.processing.*; + +// Showing how we can farm all the kinect stuff out to a separate class +KinectTracker tracker; +// Kinect Library object +Kinect kinect; + +void setup() { + size(640,520); + kinect = new Kinect(this); + tracker = new KinectTracker(); +} + +void draw() { + background(255); + + // Run the tracking analysis + tracker.track(); + // Show the image + tracker.display(); + + // Let's draw the raw location + PVector v1 = tracker.getPos(); + fill(50,100,250,200); + noStroke(); + ellipse(v1.x,v1.y,20,20); + + // Let's draw the "lerped" location + PVector v2 = tracker.getLerpedPos(); + fill(100,250,50,200); + noStroke(); + ellipse(v2.x,v2.y,20,20); + + // Display some info + int t = tracker.getThreshold(); + fill(0); + text("threshold: " + t + " " + "framerate: " + (int)frameRate + " " + "UP increase threshold, DOWN decrease threshold",10,500); +} + +void keyPressed() { + int t = tracker.getThreshold(); + if (key == CODED) { + if (keyCode == UP) { + t+=5; + tracker.setThreshold(t); + } + else if (keyCode == DOWN) { + t-=5; + tracker.setThreshold(t); + } + } +} + +void stop() { + tracker.quit(); + super.stop(); +} + diff --git a/OpenKinect-Processing/examples/AveragePointTracking/KinectTracker.pde b/OpenKinect-Processing/examples/AveragePointTracking/KinectTracker.pde new file mode 100644 index 0000000..c15c854 --- /dev/null +++ b/OpenKinect-Processing/examples/AveragePointTracking/KinectTracker.pde @@ -0,0 +1,125 @@ +class KinectTracker { + + + + // Size of kinect image + int kw = 640; + int kh = 480; + int threshold = 745; + + // Raw location + PVector loc; + + // Interpolated location + PVector lerpedLoc; + + // Depth data + int[] depth; + + + PImage display; + + KinectTracker() { + kinect.start(); + kinect.enableDepth(true); + + // We could skip processing the grayscale image for efficiency + // but this example is just demonstrating everything + kinect.processDepthImage(true); + + display = createImage(kw,kh,PConstants.RGB); + + loc = new PVector(0,0); + lerpedLoc = new PVector(0,0); + } + + void track() { + + // Get the raw depth as array of integers + depth = kinect.getRawDepth(); + + // Being overly cautious here + if (depth == null) return; + + float sumX = 0; + float sumY = 0; + float count = 0; + + for(int x = 0; x < kw; x++) { + for(int y = 0; y < kh; y++) { + // Mirroring the image + int offset = kw-x-1+y*kw; + // Grabbing the raw depth + int rawDepth = depth[offset]; + + // Testing against threshold + if (rawDepth < threshold) { + sumX += x; + sumY += y; + count++; + } + } + } + // As long as we found something + if (count != 0) { + loc = new PVector(sumX/count,sumY/count); + } + + // Interpolating the location, doing it arbitrarily for now + lerpedLoc.x = PApplet.lerp(lerpedLoc.x, loc.x, 0.3f); + lerpedLoc.y = PApplet.lerp(lerpedLoc.y, loc.y, 0.3f); + } + + PVector getLerpedPos() { + return lerpedLoc; + } + + PVector getPos() { + return loc; + } + + void display() { + PImage img = kinect.getDepthImage(); + + // Being overly cautious here + if (depth == null || img == null) return; + + // Going to rewrite the depth image to show which pixels are in threshold + // A lot of this is redundant, but this is just for demonstration purposes + display.loadPixels(); + for(int x = 0; x < kw; x++) { + for(int y = 0; y < kh; y++) { + // mirroring image + int offset = kw-x-1+y*kw; + // Raw depth + int rawDepth = depth[offset]; + + int pix = x+y*display.width; + if (rawDepth < threshold) { + // A red color instead + display.pixels[pix] = color(150,50,50); + } + else { + display.pixels[pix] = img.pixels[offset]; + } + } + } + display.updatePixels(); + + // Draw the image + image(display,0,0); + } + + void quit() { + kinect.quit(); + } + + int getThreshold() { + return threshold; + } + + void setThreshold(int t) { + threshold = t; + } +} + diff --git a/OpenKinect-Processing/examples/DepthThreshold/DepthThreshold.pde b/OpenKinect-Processing/examples/DepthThreshold/DepthThreshold.pde new file mode 100644 index 0000000..366188f --- /dev/null +++ b/OpenKinect-Processing/examples/DepthThreshold/DepthThreshold.pde @@ -0,0 +1,79 @@ +// Elie Zananiri +// Depth thresholding example +// http://www.silentlycrashing.net + +import org.openkinect.*; +import org.openkinect.processing.*; + +Kinect kinect; +int kWidth = 640; +int kHeight = 480; +int kAngle = 15; + +PImage depthImg; +int minDepth = 60; +int maxDepth = 860; + +void setup() { + size(kWidth*2, kHeight); + + kinect = new Kinect(this); + kinect.start(); + kinect.enableDepth(true); + kinect.tilt(kAngle); + + depthImg = new PImage(kWidth, kHeight); +} + +void draw() { + // draw the raw image + image(kinect.getDepthImage(), 0, 0); + + // threshold the depth image + int[] rawDepth = kinect.getRawDepth(); + for (int i=0; i < kWidth*kHeight; i++) { + if (rawDepth[i] >= minDepth && rawDepth[i] <= maxDepth) { + depthImg.pixels[i] = 0xFFFFFFFF; + } else { + depthImg.pixels[i] = 0; + } + } + + // draw the thresholded image + depthImg.updatePixels(); + image(depthImg, kWidth, 0); + + fill(0); + text("TILT: " + kAngle, 10, 20); + text("THRESHOLD: [" + minDepth + ", " + maxDepth + "]", 10, 36); +} + +void keyPressed() { + if (key == CODED) { + if (keyCode == UP) { + kAngle++; + } else if (keyCode == DOWN) { + kAngle--; + } + kAngle = constrain(kAngle, 0, 30); + kinect.tilt(kAngle); + } + + else if (key == 'a') { + minDepth = constrain(minDepth+10, 0, maxDepth); + } else if (key == 's') { + minDepth = constrain(minDepth-10, 0, maxDepth); + } + + else if (key == 'z') { + maxDepth = constrain(maxDepth+10, minDepth, 2047); + } else if (key =='x') { + maxDepth = constrain(maxDepth-10, minDepth, 2047); + } +} + +void stop() { + kinect.quit(); + super.stop(); +} + diff --git a/OpenKinect-Processing/examples/PointCloud/PointCloud.pde b/OpenKinect-Processing/examples/PointCloud/PointCloud.pde new file mode 100644 index 0000000..9d71ec4 --- /dev/null +++ b/OpenKinect-Processing/examples/PointCloud/PointCloud.pde @@ -0,0 +1,104 @@ +// Daniel Shiffman +// Kinect Point Cloud example +// http://www.shiffman.net +// https://github.com/shiffman/libfreenect/tree/master/wrappers/java/processing + +import org.openkinect.*; +import org.openkinect.processing.*; + +// Kinect Library object +Kinect kinect; + +float a = 0; + +// Size of kinect image +int w = 640; +int h = 480; + + +// We'll use a lookup table so that we don't have to repeat the math over and over +float[] depthLookUp = new float[2048]; + +void setup() { + size(800,600,P3D); + kinect = new Kinect(this); + kinect.start(); + kinect.enableDepth(true); + // We don't need the grayscale image in this example + // so this makes it more efficient + kinect.processDepthImage(false); + + // Lookup table for all possible depth values (0 - 2047) + for (int i = 0; i < depthLookUp.length; i++) { + depthLookUp[i] = rawDepthToMeters(i); + } +} + +void draw() { + + background(0); + fill(255); + textMode(SCREEN); + text("Kinect FR: " + (int)kinect.getDepthFPS() + "\nProcessing FR: " + (int)frameRate,10,16); + + // Get the raw depth as array of integers + int[] depth = kinect.getRawDepth(); + + // We're just going to calculate and draw every 4th pixel (equivalent of 160x120) + int skip = 4; + + // Translate and rotate + translate(width/2,height/2,-50); + rotateY(a); + + for(int x=0; x + + + + + + + + + + ${ant.description} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${line} + Building the Processing library ${project.name} ${library.version} +${line} + src path ${project.src} + bin path ${project.bin} + classpath.local ${classpath.local.location} + sketchbook ${sketchbook.location} + java version ${java.target.version} +${line} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${exampleDir} + + + + + + + + + + + + + + + + + + + + + + +${line} +Name ${project.name} +Version ${library.prettyVersion} (${library.version}) +Compiled ${project.compile} +Sketchbook ${sketchbook.location} +${line} +done, finished. +${line} + + + + + diff --git a/OpenKinect-Processing/resources/code/ExampleTaglet.java b/OpenKinect-Processing/resources/code/ExampleTaglet.java new file mode 100755 index 0000000..461ea08 --- /dev/null +++ b/OpenKinect-Processing/resources/code/ExampleTaglet.java @@ -0,0 +1,231 @@ +/* + * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * -Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * -Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any + * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY + * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY + * DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR + * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR + * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE + * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, + * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER + * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF + * THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that Software is not designed, licensed or + * intended for use in the design, construction, operation or + * maintenance of any nuclear facility. + */ + +import com.sun.tools.doclets.Taglet; +import com.sun.javadoc.*; +import java.util.Map; +import java.io.*; +/** + * A sample Taglet representing @example. This tag can be used in any kind of + * {@link com.sun.javadoc.Doc}. It is not an inline tag. The text is displayed + * in yellow to remind the developer to perform a task. For + * example, "@example Hello" would be shown as: + *
+ *
+ * To Do: + *
Fix this! + *
+ *
+ * + * @author Jamie Ho + * @since 1.4 + */ + +public class ExampleTaglet implements Taglet { + + private static final String NAME = "example"; + private static final String HEADER = "example To Do:"; + + /** + * Return the name of this custom tag. + */ + public String getName() { + return NAME; + } + + /** + * Will return true since @example + * can be used in field documentation. + * @return true since @example + * can be used in field documentation and false + * otherwise. + */ + public boolean inField() { + return true; + } + + /** + * Will return true since @example + * can be used in constructor documentation. + * @return true since @example + * can be used in constructor documentation and false + * otherwise. + */ + public boolean inConstructor() { + return true; + } + + /** + * Will return true since @example + * can be used in method documentation. + * @return true since @example + * can be used in method documentation and false + * otherwise. + */ + public boolean inMethod() { + return true; + } + + /** + * Will return true since @example + * can be used in method documentation. + * @return true since @example + * can be used in overview documentation and false + * otherwise. + */ + public boolean inOverview() { + return true; + } + + /** + * Will return true since @example + * can be used in package documentation. + * @return true since @example + * can be used in package documentation and false + * otherwise. + */ + public boolean inPackage() { + return true; + } + + /** + * Will return true since @example + * can be used in type documentation (classes or interfaces). + * @return true since @example + * can be used in type documentation and false + * otherwise. + */ + public boolean inType() { + return true; + } + + /** + * Will return false since @example + * is not an inline tag. + * @return false since @example + * is not an inline tag. + */ + + public boolean isInlineTag() { + return false; + } + + /** + * Register this Taglet. + * @param tagletMap the map to register this tag to. + */ + public static void register(Map tagletMap) { + ExampleTaglet tag = new ExampleTaglet(); + Taglet t = (Taglet) tagletMap.get(tag.getName()); + if (t != null) { + tagletMap.remove(tag.getName()); + } + tagletMap.put(tag.getName(), tag); + } + + /** + * Given the Tag representation of this custom + * tag, return its string representation. + * @param tag the Tag representation of this custom tag. + */ + public String toString(Tag tag) { + return createHTML(readFile(tag.text())); + } + + + /** + * Given an array of Tags representing this custom + * tag, return its string representation. + * @param tags the array of Tags representing of this custom tag. + */ + public String toString(Tag[] tags) { + if (tags.length == 0) { + return null; + } + return createHTML(readFile(tags[0].text())); + } + + + + String createHTML(String theString) { + if(theString!=null) { + String dd = ""; + + return dd+"\n
" + + "
+Example
" + + "
"+theString+"
" + + "
"; + } + return ""; + } + + + /** + * check if the examples directory exists and return the example as given in the tag. + * @param theExample the name of the example + */ + String readFile(String theExample) { + String record = ""; + String myResult = ""; + int recCount = 0; + String myDir = "../examples"; + File file=new File(myDir); + if(file.exists()==false) { + myDir = "./examples"; + } + try { + FileReader fr = new FileReader(myDir+"/"+theExample+"/"+theExample+".pde"); + BufferedReader br = new BufferedReader(fr); + record = new String(); + while ((record = br.readLine()) != null) { + myResult += record+"\n"; + } + } catch (IOException e) { + System.out.println(e); + return null; + } + return myResult; + } +} + + diff --git a/OpenKinect-Processing/resources/code/ant-contrib-1.0b3.jar b/OpenKinect-Processing/resources/code/ant-contrib-1.0b3.jar new file mode 100755 index 0000000..0625376 Binary files /dev/null and b/OpenKinect-Processing/resources/code/ant-contrib-1.0b3.jar differ diff --git a/OpenKinect-Processing/resources/code/doc.sh b/OpenKinect-Processing/resources/code/doc.sh new file mode 100755 index 0000000..1db9a92 --- /dev/null +++ b/OpenKinect-Processing/resources/code/doc.sh @@ -0,0 +1,18 @@ +# a shell script to create a java documentation +# for a processing library. +# +# make changes to the variables below so they +# fit the structure of your library + +# the package name of your library +package=template; + +# source folder location +src=../src; + +# the destination folder of your documentation +dest=../documentation; + + +# compile the java documentation +javadoc -d $dest -stylesheetfile ./stylesheet.css -sourcepath ${src} ${package} diff --git a/OpenKinect-Processing/resources/install_instructions.txt b/OpenKinect-Processing/resources/install_instructions.txt new file mode 100755 index 0000000..693bf1f --- /dev/null +++ b/OpenKinect-Processing/resources/install_instructions.txt @@ -0,0 +1,46 @@ +How to install library ##library.name## + + +Install with the "Add Library..." tool + +New for Processing 2.0: Add contributed libraries by selecting "Add Library..." +from the "Import Library..." submenu within the Sketch menu. Not all available +libraries have been converted to show up in this menu. If a library isn't there, +it will need to be installed manually by following the instructions below. + + +Manual Install + +Contributed libraries may be downloaded separately and manually placed within +the "libraries" folder of your Processing sketchbook. To find (and change) the +Processing sketchbook location on your computer, open the Preferences window +from the Processing application (PDE) and look for the "Sketchbook location" +item at the top. + +Copy the contributed library's folder into the "libraries" folder at this +location. You will need to create the "libraries" folder if this is your first +contributed library. + +By default the following locations are used for your sketchbook folder: + For Mac users, the sketchbook folder is located inside ~/Documents/Processing. + For Windows users, the sketchbook folder is located inside + 'My Documents'/Processing. + +The folder structure for library ##library.name## should be as follows: + +Processing + libraries + ##library.name## + examples + library + ##library.name##.jar + reference + src + +Some folders like "examples" or "src" might be missing. After library +##library.name## has been successfully installed, restart the Processing +application. + + +If you're having trouble, have a look at the Processing Wiki for more +information: http://wiki.processing.org/w/How_to_Install_a_Contributed_Library diff --git a/OpenKinect-Processing/resources/library.properties b/OpenKinect-Processing/resources/library.properties new file mode 100755 index 0000000..3821618 --- /dev/null +++ b/OpenKinect-Processing/resources/library.properties @@ -0,0 +1,40 @@ +# The name of your library as you want it formatted +name = Open Kinect + +# List of authors. Links can be provided using the syntax [author name](url) +authorList = [Daniel Shiffman](http://www.shiffman.net) + +# A website for your library +url = http://www.shiffman.net/p5/kinect/ + +# The category of your library, must be one of the following: +# "Sound" "Import / Export" "Simulation / Math" +# "Tools" "Hardware Interface" "Typography / Geometry" +# "Animation" "Graphic Interface" "Computer Vision / Video" +# "3D" "Compilation" "Data / Protocols" +# +# If a value other than those listed is used, your library will listed as "Other." +category = Computer Vision / Video + +# A short sentence (fragment) to summarize the library's function. This will be +# shown from inside the PDE when the library is being installed. Avoid repeating +# the name of your library here. Also, avoid saying anything redundant like +# mentioning that its a library. +sentence = A Kinect implementation for Processing using open source drivers (libfreenect) + +# Additional information suitable for the Processing website. The value of +# 'sentence' always will be prepended, so you should start by writing the +# second sentence here. If your library only works on certain operating systems, +# mention it here. +paragraph = + +# Links in the 'sentence' and 'paragraph' attributes can be inserted using the +# same syntax as for authors. That is, [here is a link to Processing](http://processing.org/) + +# A version number that increments once with each release. This +# is used to compare different versions of the same library, and +# check if an update is available. +version = 2 + +# The version as the user will see it. If blank, the version attribute will be used here +prettyVersion = 0.2 diff --git a/OpenKinect-Processing/resources/stylesheet.css b/OpenKinect-Processing/resources/stylesheet.css new file mode 100755 index 0000000..54998c2 --- /dev/null +++ b/OpenKinect-Processing/resources/stylesheet.css @@ -0,0 +1,310 @@ +/* Javadoc style sheet */ +/* Define colors, fonts and other style attributes here to override the defaults */ +/* processingLibs style by andreas schlegel, sojamo */ + + +body { + margin : 0; + padding : 0; + padding-left : 10px; + padding-right : 8px; + background-color : #FFFFFF; + font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size : 100%; + font-size : 0.7em; + font-weight : normal; + line-height : normal; + margin-bottom:30px; +} + + + + +/* Headings */ +h1, h2, h3, h4, h5, th { + font-family :Arial, Helvetica, sans-serif; + font-size:1.2em; +} + + +p { + font-size : 1em; + width:80%; +} + +pre, code { + font-family : "Courier New", Courier, monospace; + font-size : 12px; + line-height : normal; +} + + + +table { + border:0; + margin-bottom:10px; + margin-top:10px; +} + + +tr, td { + border-top: 0px solid; + border-left: 0px solid; + padding-top:8px; + padding-bottom:8px; +} + + + +hr { + border:0; + height:1px; + padding:0; + margin:0; + margin-bottom:4px; + +} + + + +dd, th, td, font { + font-size:1.0em; + line-height:1.0em; +} + + + +dt { + margin-bottom:0px; +} + + + +dd { + margin-top:2px; + margin-bottom:4px; +} + + + +a { + text-decoration: underline; + font-weight: normal; +} + +a:hover, +a:active { + text-decoration: underline; + font-weight: normal; +} + +a:visited, +a:link:visited { + text-decoration: underline; + font-weight: normal; +} + + +img { + border: 0px solid #000000; +} + + + +/* Navigation bar fonts */ +.NavBarCell1 { + border:0; +} + +.NavBarCell1Rev { + border:0; +} + +.NavBarFont1 { + font-family: Arial, Helvetica, sans-serif; + font-size:1.1em; +} + + +.NavBarFont1 b { + font-weight:normal; +} + + + +.NavBarFont1:after, .NavBarFont1Rev:after { + font-weight:normal; + content: " \\"; +} + + +.NavBarFont1Rev { + font-family: Arial, Helvetica, sans-serif; + font-size:1.1em; +} + +.NavBarFont1Rev b { + font-family: Arial, Helvetica, sans-serif; + font-size:1.1em; + font-weight:normal; +} + +.NavBarCell2 { + font-family: Arial, Helvetica, sans-serif; +} + +.NavBarCell3 { + font-family: Arial, Helvetica, sans-serif; +} + + + +font.FrameItemFont { + font-family: Helvetica, Arial, sans-serif; + font-size:1.1em; + line-height:1.1em; +} + +font.FrameHeadingFont { + font-family: Helvetica, Arial, sans-serif; + line-height:32px; +} + +/* Font used in left-hand frame lists */ +.FrameTitleFont { + font-family: Helvetica, Arial, sans-serif +} + + +.toggleList { + padding:0; + margin:0; + margin-top:12px; +} + +.toggleList dt { + font-weight:bold; + font-size:12px; + font-family:arial,sans-serif; + padding:0px; + margin:10px 0px 10px 0px; +} + +.toggleList dt span { + font-family: monospace; + padding:0; + margin:0; +} + + +.toggleList dd { + margin:0; + padding:0; +} + +html.isjs .toggleList dd { + display: none; +} + +.toggleList pre { + padding: 4px 4px 4px 4px; +} + + + + + +/* COLORS */ + +pre, code { + color: #000000; +} + + +body { + color : #333333; + background-color :#FFFFFF; +} + + +h1, h2, h3, h4, h5, h6 { + color:#555; +} + +a, +.toggleList dt { + color: #1a7eb0; +} + +a:hover, +a:active { + color: #1a7eb0; +} + +a:visited, +a:link:visited { + color: #1a7eb0; +} + +td,tr { + border-color: #999999; +} + +hr { + color:#999999; + background:#999999; +} + + +.TableHeadingColor { + background: #dcdcdc; + color: #555; +} + + +.TableSubHeadingColor { + background: #EEEEFF +} + +.TableRowColor { + background: #FFFFFF +} + + +.NavBarCell1 { + background-color:#dcdcdc; + color:#000; +} + +.NavBarCell1 a { + color:#333; +} + + +.NavBarCell1Rev { + background-color:transparent; +} + +.NavBarFont1 { + color:#333; +} + + +.NavBarFont1Rev { + color:#fff; +} + +.NavBarCell2 { + background-color:#999; +} + +.NavBarCell2 a { + color:#fff; +} + + + +.NavBarCell3 { + background-color:#dcdcdc; +} + diff --git a/OpenKinect-Processing/src/org/openkinect/Acceleration.java b/OpenKinect-Processing/src/org/openkinect/Acceleration.java new file mode 100644 index 0000000..6cdd14c --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/Acceleration.java @@ -0,0 +1,35 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public interface Acceleration +{ + void direction(float x, float y, float z); +} diff --git a/OpenKinect-Processing/src/org/openkinect/ColorFormat.java b/OpenKinect-Processing/src/org/openkinect/ColorFormat.java new file mode 100644 index 0000000..f8bec93 --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/ColorFormat.java @@ -0,0 +1,38 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum ColorFormat +{ + RGB_8_8_8, + BAYER, + IR_10BIT, + IR_8BIT +} diff --git a/OpenKinect-Processing/src/org/openkinect/Context.java b/OpenKinect-Processing/src/org/openkinect/Context.java new file mode 100644 index 0000000..470b3a5 --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/Context.java @@ -0,0 +1,148 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Michael Nischt + */ +public class Context +{ + // + + static + { + System.loadLibrary("kinect"); + } + + public static Context getContext() + { + return instance; + } + private static final Context instance = new Context(); + + // + + private final long jni; + private Logger logger; + private final Map jniMap = new HashMap(); + + private Context() + { + jni = jniInit(); + + Runtime.getRuntime().addShutdownHook(new Thread() + { + @Override + public void run() + { + List devices = new ArrayList(jniMap.values()); + for(Device device : devices) + { + device.dispose(); + } + jniShutdown(); + } + }); + } + + public int devices() + { + return jniNumDevices(); + } + + public Device getDevice(int index) + { + long dev_ptr = jniOpenDevice(index); + if(dev_ptr == 0) + { + return null; + } + Device device = new Device(this, dev_ptr); + jniMap.put(dev_ptr, device); + return device; + } + + public boolean processEvents() + { + return jniProcessEvents(); + } + + public Device device(long jni) + { + return jniMap.get(jni); + } + + public void log(Logger logger) + { + log(logger, LogLevel.INFO); + } + + public void log(Logger logger, LogLevel level) + { + jniSetLogLevel(level.ordinal()); + this.logger = logger; + } + + void disposeDevice(long dev_ptr) + { + jniMap.remove(dev_ptr); + } + + + // + + void onLog(String msg) + { + if(logger != null) + { + logger.log(msg); + } + } + + // + + // + + native private long jniInit(); + + native private void jniShutdown(); + + native private boolean jniProcessEvents(); + + native private int jniNumDevices(); + + native private long jniOpenDevice(int index); + + native private void jniSetLogLevel(int level); + + // +} diff --git a/OpenKinect-Processing/src/org/openkinect/DepthFormat.java b/OpenKinect-Processing/src/org/openkinect/DepthFormat.java new file mode 100644 index 0000000..ed7f429 --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/DepthFormat.java @@ -0,0 +1,38 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum DepthFormat +{ + RAW_11, + RAW_10, + PACKED_11, + PACKED_10; +} diff --git a/OpenKinect-Processing/src/org/openkinect/Device.java b/OpenKinect-Processing/src/org/openkinect/Device.java new file mode 100644 index 0000000..3ab2abb --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/Device.java @@ -0,0 +1,200 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +/** + * @author Michael Nischt + */ +public final class Device +{ + private final Context context; + private long jni; + + private Image rgb, depth; + private Acceleration acceleration; + + Device(Context context, long jni) + { + if(context == null) + { + throw new NullPointerException(); + } + + this.context = context; + this.jni = jni; + } + + public void light(LEDStatus led) + { + checkDisposed(); + + jniSetLED(led.ordinal()); + } + + public void tilt(float deg) + { + checkDisposed(); + + jniSetTiltDegs(deg); + } + + public void color(Image image) + { + color(image,false); + } + + public void color(Image image, boolean IR) { + if (IR) { + color(image, ColorFormat.IR_10BIT); + } else { + color(image, ColorFormat.RGB_8_8_8); + } + + } + + public void color(Image image, ColorFormat format) + { + checkDisposed(); + + if (format == ColorFormat.IR_10BIT) { + // HACK FIX THIS!!! + jniSetFormatRGB(3);//format.ordinal()); + } else { + jniSetFormatRGB(format.ordinal()); + + } + rgb = image; + + if(rgb != null) + { + jniStartCaptureRGB(); + } + else + { + jniStopCaptureRGB(); + } + } + + public void depth(Image image) + { + depth(image, DepthFormat.RAW_11); + } + + public void depth(Image image, DepthFormat format) + { + checkDisposed(); + + jniSetFormatDepth(format.ordinal()); + depth = image; + + if(depth != null) + { + jniStartCaptureDepth(); + } + else + { + jniStopCaptureDepth(); + } + } + + public void acceleration(Acceleration acceleration) + { + checkDisposed(); + + this.acceleration = acceleration; + } + + public void dispose() + { + context.disposeDevice(jni); + jniClose(); + jni = 0; + } + + private void checkDisposed() + { + if(jni == 0) + { + throw new IllegalStateException("Device already dispoed."); + } + } + + // + + void onRGB(ByteBuffer buffer) + { + if (rgb != null) + { + buffer.order(ByteOrder.nativeOrder()); + rgb.data(buffer); + } + } + + void onDepth(ByteBuffer buffer) + { + if (depth != null) + { + buffer.order(ByteOrder.nativeOrder()); + depth.data(buffer); + } + } + + void onAcceleration(float x, float y, float z) + { + if (acceleration != null) + { + acceleration.direction(x, y, z); + } + } + + // + + // + + native private void jniClose(); + + native private void jniSetLED(int light); + + native private void jniSetTiltDegs(float deg); + + native private void jniSetFormatRGB(int format); + + native private void jniSetFormatDepth(int format); + + native private void jniStartCaptureRGB(); + + native private void jniStartCaptureDepth(); + + native private void jniStopCaptureRGB(); + + native private void jniStopCaptureDepth(); + + // +} diff --git a/OpenKinect-Processing/src/org/openkinect/Image.java b/OpenKinect-Processing/src/org/openkinect/Image.java new file mode 100644 index 0000000..7acb78b --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/Image.java @@ -0,0 +1,37 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +import java.nio.ByteBuffer; + +/** + * @author Michael Nischt + */ +public interface Image +{ + void data(ByteBuffer image); +} diff --git a/OpenKinect-Processing/src/org/openkinect/LEDStatus.java b/OpenKinect-Processing/src/org/openkinect/LEDStatus.java new file mode 100644 index 0000000..80106e9 --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/LEDStatus.java @@ -0,0 +1,41 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum LEDStatus +{ + LED_OFF, + LED_GREEN, + LED_RED, + LED_YELLOW, + LED_BLINK_YELLOW, + LED_BLINK_GREEN, + LED_BLINK_RED_YELLOW; +} diff --git a/OpenKinect-Processing/src/org/openkinect/LogLevel.java b/OpenKinect-Processing/src/org/openkinect/LogLevel.java new file mode 100644 index 0000000..4904b7e --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/LogLevel.java @@ -0,0 +1,42 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public enum LogLevel +{ + FATAL, + ERROR, + WARNING, + NOTICE, + INFO, + DEBUG, + SPEW, + FLOOD; +} diff --git a/OpenKinect-Processing/src/org/openkinect/Logger.java b/OpenKinect-Processing/src/org/openkinect/Logger.java new file mode 100644 index 0000000..cb445da --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/Logger.java @@ -0,0 +1,35 @@ +/* + * This file is part of the OpenKinect Project. http://www.openkinect.org + * + * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file + * for details. + * + * This code is licensed to you under the terms of the Apache License, version + * 2.0, or, at your option, the terms of the GNU General Public License, + * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, + * or the following URLs: + * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.gnu.org/licenses/gpl-2.0.txt + * + * If you redistribute this file in source form, modified or unmodified, you + * may: + * 1) Leave this header intact and distribute it under the same terms, + * accompanying it with the APACHE20 and GPL20 files, or + * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or + * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file + * In all cases you must keep the copyright notice intact and include a copy + * of the CONTRIB file. + * + * Binary distributions must follow the binary distribution requirements of + * either License. + */ + +package org.openkinect; + +/** + * @author Michael Nischt + */ +public interface Logger +{ + void log(String msg); +} diff --git a/OpenKinect-Processing/src/org/openkinect/processing/DepthImage.java b/OpenKinect-Processing/src/org/openkinect/processing/DepthImage.java new file mode 100644 index 0000000..895b623 --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/processing/DepthImage.java @@ -0,0 +1,142 @@ +package org.openkinect.processing; + +import java.nio.ByteBuffer; +import java.nio.ShortBuffer; + +import org.openkinect.Image; + +import processing.core.PApplet; +import processing.core.PConstants; +import processing.core.PImage; + +public class DepthImage implements Image { + long time; + float fps; + + PApplet parent; + public PImage img; + + boolean processImage = true; + ShortBuffer sdata; + + public DepthImage(PApplet p) { + parent = p; + img = p.createImage(640,480,PConstants.RGB); + time = System.currentTimeMillis(); + } + + public void enableImage(boolean b) { + processImage = b; + } + + public ShortBuffer getRawData() { + return sdata; + } + + public PImage getImage() { + return img; + } + + public void data(ByteBuffer data) { + sdata = data.asShortBuffer(); + + if (processImage) { + for(int y=0; y>8) { + case 0: + b = 255; + g = 255-lb; + r = 255-lb; + break; + case 1: + b = 255; + g = lb; + r = 0; + break; + case 2: + b = 255-lb; + g = 255; + r = 0; + break; + case 3: + b = 0; + g = 255; + r = lb; + break; + case 4: + b = 0; + g = 255-lb; + r = 255; + break; + case 5: + b = 0; + g = 0; + r = 255-lb; + break; + default: + r = 0; + g = 0; + b = 0; + break; + } + + int pixel = (0xFF) << 24 + | (b & 0xFF) << 16 + | (g & 0xFF) << 8 + | (r & 0xFF) << 0; + + return pixel; + } + + static int depth2intensity(short depth) + { + int d = Math.round((1 - (depth / 2047f)) * 255f); + int pixel = (0xFF) << 24 + | (d & 0xFF) << 16 + | (d & 0xFF) << 8 + | (d & 0xFF) << 0; + + return pixel; + } + + public float getFPS() { + return fps; + } + +} diff --git a/OpenKinect-Processing/src/org/openkinect/processing/Kinect.java b/OpenKinect-Processing/src/org/openkinect/processing/Kinect.java new file mode 100644 index 0000000..e1110bc --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/processing/Kinect.java @@ -0,0 +1,156 @@ +package org.openkinect.processing; + + +import java.lang.reflect.Method; +import java.nio.ShortBuffer; + +import org.openkinect.Context; +import org.openkinect.Device; + +import processing.core.PApplet; +import processing.core.PImage; + +public class Kinect extends Thread { + + public static PApplet p5parent; + Method kinectEventMethod; + + boolean running = false; + + Context context; + Device device; + int w = 640; + int h = 480; + RGBImage kimg;// = new KImage(); + DepthImage dimg; + + public Kinect(PApplet _p) { + p5parent = _p; + try { + kinectEventMethod = p5parent.getClass().getMethod("kinectEvent", + new Class[] { Kinect.class }); + } catch (Exception e) { + //System.out.println("You are missing the kinectEvent() method. " + e); + } + //p5parent.registerDraw(this); + } + + public void start() { + start(0); + } + + public void start(int num) { + context = Context.getContext(); + if(context.devices() < 1) + { + System.out.println("No Kinect devices found."); + } + device = context.getDevice(num); + kimg = new RGBImage(p5parent); + dimg = new DepthImage(p5parent); + running = true; + super.start(); + } + + public int[] getRawDepth() { + ShortBuffer sb = dimg.getRawData(); + //int[] depth = new int[sb.capacity()]; + int[] depth = new int[w*h]; + + // This is inefficent, but I think it's easier for Processing users to have an int array? + if (sb != null) { + for (int i = 0; i < depth.length; i++) { + depth[i] = sb.get(i); + //System.out.println(sb.get(i)); + + } + } else { + // Instead of null, filling it with 0's + for (int i = 0; i < depth.length; i++) depth[i] = 0; + } + return depth; + } + + public void tilt(float deg) + { + device.tilt(deg); + } + + public void processDepthImage(boolean b) { + dimg.enableImage(b); + } + + public void enableDepth(boolean b) { + if (b) device.depth(dimg); + else device.depth(null); + } + + public void enableRGB(boolean b) { + device.color(null); + kimg.setIR(!b); + if (b) device.color(kimg); + //else device.color(null); + } + + public void enableIR(boolean b) { + device.color(null); + kimg.setIR(b); + if (b) device.color(kimg,true); + //else device.color(null); + } + + public float getVideoFPS() { + return kimg.getFPS(); + } + + public float getDepthFPS() { + return dimg.getFPS(); + } + + public PImage getVideoImage() { + return kimg.img; + //return kimg.imgCopy; + } + + public PImage getDepthImage() { + return dimg.img; + } + + + /** + * This method should only be called internally by Thread.start(). + */ + public void run() { + while (running) { + boolean b = context.processEvents(); + try { + Thread.sleep(2); + } catch (InterruptedException e) { + // e.printStackTrace(); + } + } + /*try { + // call the method with this object as the argument! + frameEventMethod.invoke(p5parent, new Object[] { this }); + + } catch (Exception e) { + err("Could not invoke the \"frameEvent()\" method for some reason."); + e.printStackTrace(); + frameEventMethod = null; + } */ + + } + + /* Stops the client thread. You don't really need to do this ever. + */ + public void quit() { + System.out.println("quitting"); + device.color(null); + device.depth(null); + running = false; // Setting running to false ends the loop in run() + //interrupt(); // In case the thread is waiting. . . + } + + + +} \ No newline at end of file diff --git a/OpenKinect-Processing/src/org/openkinect/processing/RGBImage.java b/OpenKinect-Processing/src/org/openkinect/processing/RGBImage.java new file mode 100644 index 0000000..050508f --- /dev/null +++ b/OpenKinect-Processing/src/org/openkinect/processing/RGBImage.java @@ -0,0 +1,68 @@ +package org.openkinect.processing; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.ShortBuffer; + + +import processing.core.PApplet; +import processing.core.PImage; + +public class RGBImage extends DepthImage { + boolean IR = false; + + + public RGBImage(PApplet p) { + super(p); + } + + public void setIR(boolean b) { + IR = b; + } + + public synchronized void data(ByteBuffer data) { + if (IR) { + ShortBuffer sdata = data.asShortBuffer(); + for(int y=0; y + + +##library.name## + + + + + + + + + + + + + + +
+ + + + + +
+ +
+

##library.name##

+

+ A library by ##author.name## for the Processing programming environment.
+ Last update, ##date##. +

+

+ ##library.sentence##
+ ##library.paragraph##
+ Feel free to replace this paragraph with a description of the library.
+ Contributed libraries are developed, documented, and maintained by members of the Processing community. Further directions are included with each library. For feedback and support, please post to the Discourse. We strongly encourage all libraries to be open source, but not all of them are. +

+
+ + + +
+

Download

+

+ Download ##library.name## version ##library.prettyVersion## (##library.version##) in + .zip format. +

+

Installation

+

+ Unzip and put the extracted ##project.name## folder into the libraries folder of your Processing sketches. Reference and examples are included in the ##project.name## folder. +

+
+ + +
+

Keywords. ##library.keywords##

+

Reference. Have a look at the javadoc reference here. A copy of the reference is included in the .zip as well.

+

Source. The source code of ##library.name## is available at ##source.host##, and its repository can be browsed here.

+
+ + +
+

Examples

+

Find a list of examples in the current distribution of ##library.name##, or have a look at them by following the links below.

+
    + ##examples## +
+
+ + +
+

Tested

+

+ + Platform ##tested.platform## + + +
Processing ##tested.processingVersion## + + +
Dependencies ##library.dependencies## +

+
+ + + + + + + + + + + + +
+
+ + +
+ + \ No newline at end of file diff --git a/OpenKinect-Processing/web/stylesheet.css b/OpenKinect-Processing/web/stylesheet.css new file mode 100755 index 0000000..4348b38 --- /dev/null +++ b/OpenKinect-Processing/web/stylesheet.css @@ -0,0 +1,203 @@ +/* processingLibs style by andreas schlegel, sojamo. */ + + +* { + margin:0; + padding:0; + border:0; +} + + +body { + font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; + font-size : 100%; + font-size : 0.70em; + font-weight : normal; + line-height : normal; +} + + + +#container { + margin-left:64px; + background-color:#fff; +} + +#header { + float:left; + padding-top:24px; + padding-bottom:48px; +} + +#menu { + margin-top:16px; + float:left; + margin-bottom:64px; +} + + +#about, +#download, +#examples, +#demos, +#misc { + width:480px; + float:left; + margin-right:24px; +} + + +#resources, #info { + width:320px; + float:left; +} + + +.clear { + clear:both; +} + +#footer { + margin-top:300px; + height:20px; + margin-bottom:32px; +} + + +ul { + list-style:none; + padding:0; + margin:0; +} + + +#menu ul li, #subMenu ul li { + float:left; + padding-right:6px; +} + + + + + + +/* Headings */ + +h1 { + font-size:2em; + font-weight:normal; +} + + +h2, h3, h4, h5, th { + font-size:1.3em; + font-weight:normal; + margin-bottom:4px; +} + + + +p { + font-size:1em; + width:90%; + margin-bottom:32px; +} + + +pre, code { + font-family:"Courier New", Courier, monospace; + font-size:1em; + line-height:normal; +} + + + + +hr { + border:0; + height:1px; + margin-bottom:24px; +} + + +a { + text-decoration: underline; + font-weight: normal; +} + + +a:hover, +a:active { + text-decoration: underline; + font-weight: normal; +} + + +a:visited, +a:link:visited { + text-decoration: underline; + font-weight: normal; +} + + + +img { + border: 0px solid #000000; +} + + + + + +/* COLORS */ + + +body { + color : #333; + background-color :#fff; +} + + +#header { + background-color:#fff; + color:#333; +} + + + +h1, h2, h3, h4, h5, h6 { + color:#666; +} + + +pre, code { + color: #000000; +} + + +a,strong { + color: #333; +} + + +a:hover, +a:active { + color: #333; +} + + +a:visited, +a:link:visited { + color: #333; +} + + +#footer, #menu { + background-color:#fff; + color:#333; +} + + +#footer a, #menu a { + color:#333; +} diff --git a/README.md b/README.md new file mode 100755 index 0000000..7d884b8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Open Kinect for Processing + +http://shiffman.net/p5/kinect/