├── .gitignore ├── OpenKinect-Processing ├── .classpath ├── .gitignore ├── .project ├── additional_libs │ ├── jna.jar │ └── processing_3.10a │ │ ├── core.jar │ │ ├── gluegen-rt-natives-linux-amd64.jar │ │ ├── gluegen-rt-natives-linux-armv6hf.jar │ │ ├── gluegen-rt-natives-linux-i586.jar │ │ ├── gluegen-rt-natives-macosx-universal.jar │ │ ├── gluegen-rt-natives-windows-amd64.jar │ │ ├── gluegen-rt-natives-windows-i586.jar │ │ ├── gluegen-rt.jar │ │ ├── jogl-all-natives-linux-amd64.jar │ │ ├── jogl-all-natives-linux-armv6hf.jar │ │ ├── jogl-all-natives-linux-i586.jar │ │ ├── jogl-all-natives-macosx-universal.jar │ │ ├── jogl-all-natives-windows-amd64.jar │ │ ├── jogl-all-natives-windows-i586.jar │ │ └── jogl-all.jar ├── data │ └── kinectThreshold.txt ├── examples │ ├── Kinect_v1 │ │ ├── AveragePointTracking │ │ │ ├── AveragePointTracking.pde │ │ │ └── KinectTracker.pde │ │ ├── DepthThreshold │ │ │ └── DepthThreshold.pde │ │ ├── MultiKinect │ │ │ └── MultiKinect.pde │ │ ├── PointCloud │ │ │ └── PointCloud.pde │ │ ├── PointCloudOGL │ │ │ ├── PointCloudOGL.pde │ │ │ └── data │ │ │ │ ├── frag.glsl │ │ │ │ └── vert.glsl │ │ └── RGBDepthTest │ │ │ └── RGBDepthTest.pde │ ├── Kinect_v2 │ │ ├── AveragePointTracking2 │ │ │ ├── AveragePointTracking2.pde │ │ │ └── KinectTracker.pde │ │ ├── CameraPointCloud2 │ │ │ ├── CameraParams.pde │ │ │ └── CameraPointCloud2.pde │ │ ├── ColorPointCloud2 │ │ │ ├── ColorPointCloud2.pde │ │ │ └── data │ │ │ │ ├── frag.glsl │ │ │ │ └── vert.glsl │ │ ├── DepthPointCloud2 │ │ │ ├── CameraParams.pde │ │ │ ├── DepthPointCloud2.pde │ │ │ └── data │ │ │ │ ├── frag.glsl │ │ │ │ └── vert.glsl │ │ ├── DepthThreshold2 │ │ │ └── DepthThreshold2.pde │ │ ├── MultiKinect2 │ │ │ └── MultiKinect2.pde │ │ └── RGBDepthTest2 │ │ │ └── RGBDepthTest2.pde │ └── MultiKinectVersion │ │ └── MultiKinectVersion.pde ├── lib │ ├── jna.jar │ ├── v1 │ │ ├── linux-armv6hf │ │ │ └── libfreenect.so │ │ ├── linux │ │ │ ├── libfreenect.a │ │ │ ├── libfreenect.so │ │ │ ├── libfreenect.so.0.5 │ │ │ └── libfreenect.so.0.5.2 │ │ ├── mac │ │ │ ├── libfreenect.dylib │ │ │ └── libusb-1.0.0.dylib │ │ └── msvc │ │ │ ├── freenect.dll │ │ │ ├── libusb-1.0.dll │ │ │ └── pthreadVC2.dll │ └── v2 │ │ ├── linux │ │ ├── libfreenect2.so │ │ ├── libfreenect2.so.0.2 │ │ ├── libfreenect2.so.0.2.0 │ │ ├── libturbojpeg.so.0 │ │ └── libturbojpeg.so.0.1.0 │ │ ├── mac │ │ ├── libJNILibfreenect2.dylib │ │ ├── libturbojpeg.a │ │ ├── libturbojpeg.dylib │ │ └── libusb-1.0.0.dylib │ │ └── msvc │ │ ├── OpenCL.lib │ │ ├── libJNILibfreenect2.dll │ │ ├── libusb-1.0.dll │ │ ├── libusb-1.0.lib │ │ ├── turbojpeg.dll │ │ └── turbojpeg.lib ├── resources │ ├── README.md │ ├── build.properties │ ├── build.xml │ ├── code │ │ ├── .gitignore │ │ ├── ExampleTaglet.class │ │ ├── ExampleTaglet.java │ │ ├── ant-contrib-1.0b3.jar │ │ └── doc.sh │ ├── library.properties │ └── stylesheet.css ├── src │ └── org │ │ └── openkinect │ │ ├── freenect │ │ ├── Context.java │ │ ├── DepthFormat.java │ │ ├── DepthHandler.java │ │ ├── Device.java │ │ ├── DeviceFlags.java │ │ ├── FrameMode.java │ │ ├── Freenect.java │ │ ├── LedStatus.java │ │ ├── LogHandler.java │ │ ├── LogLevel.java │ │ ├── Resolution.java │ │ ├── TiltStatus.java │ │ ├── VideoFormat.java │ │ └── VideoHandler.java │ │ ├── freenect2 │ │ └── Device.java │ │ ├── processing │ │ ├── DepthImage.java │ │ ├── Kinect.java │ │ ├── Kinect2.java │ │ ├── LibraryPath.java │ │ ├── RGBImage.java │ │ └── TestIt.java │ │ └── tests │ │ ├── DepthThreshold2.java │ │ ├── FrameTest.java │ │ ├── MultiKinectV1.java │ │ ├── PointCloudOGL2.java │ │ ├── PointCloudTest.java │ │ ├── RGBDepthTest2.java │ │ ├── RegisteredTest.java │ │ └── data │ │ ├── frag.glsl │ │ └── vert.glsl └── web │ ├── index.html │ └── stylesheet.css ├── README.md └── build_openKinect2 ├── C++ ├── libs │ ├── libTurboJpeg │ │ ├── include │ │ │ └── turbojpeg.h │ │ └── lib │ │ │ └── osx │ │ │ ├── libturbojpeg.a │ │ │ └── libturbojpeg.dylib │ ├── libfreenect2 │ │ └── include │ │ │ └── libfreenect2.h │ ├── libusb │ │ ├── include │ │ │ └── libusb │ │ │ │ ├── hotplug.h │ │ │ │ ├── libusb.h │ │ │ │ ├── libusbi.h │ │ │ │ ├── os │ │ │ │ ├── darwin_usb.h │ │ │ │ ├── linux_usbfs.h │ │ │ │ ├── poll_posix.h │ │ │ │ ├── poll_windows.h │ │ │ │ ├── threads_posix.h │ │ │ │ ├── threads_windows.h │ │ │ │ ├── wince_usb.h │ │ │ │ ├── windows_common.h │ │ │ │ └── windows_usb.h │ │ │ │ ├── version.h │ │ │ │ └── version_nano.h │ │ └── lib │ │ │ ├── msvc │ │ │ └── libusb-1.0.dll │ │ │ └── osx │ │ │ └── usb-1.0.0-superspeed.a │ └── protonect │ │ ├── include │ │ ├── OpenCL │ │ │ └── cl.hpp │ │ └── libfreenect2 │ │ │ ├── async_packet_processor.h │ │ │ ├── config.h │ │ │ ├── config.h.in │ │ │ ├── data_callback.h │ │ │ ├── depth_packet_processor.h │ │ │ ├── depth_packet_stream_parser.h │ │ │ ├── double_buffer.h │ │ │ ├── frame_listener.hpp │ │ │ ├── frame_listener_impl.h │ │ │ ├── libfreenect2.hpp │ │ │ ├── packet_pipeline.h │ │ │ ├── packet_processor.h │ │ │ ├── protocol │ │ │ ├── command.h │ │ │ ├── command_transaction.h │ │ │ ├── response.h │ │ │ └── usb_control.h │ │ │ ├── registration.h │ │ │ ├── resource.h │ │ │ ├── rgb_packet_processor.h │ │ │ ├── rgb_packet_stream_parser.h │ │ │ ├── threading.h │ │ │ └── usb │ │ │ ├── event_loop.h │ │ │ └── transfer_pool.h │ │ └── src │ │ ├── command_transaction.cpp │ │ ├── depth_packet_processor.cpp │ │ ├── depth_packet_stream_parser.cpp │ │ ├── double_buffer.cpp │ │ ├── event_loop.cpp │ │ ├── frame_listener_impl.cpp │ │ ├── generate_resources.cpp │ │ ├── libfreenect2.cpp │ │ ├── opencl_depth_packet_processor.cl │ │ ├── opencl_depth_packet_processor.cpp │ │ ├── packet_pipeline.cpp │ │ ├── registration.cpp │ │ ├── resource.cpp │ │ ├── resources.inc.h │ │ ├── rgb_packet_processor.cpp │ │ ├── rgb_packet_stream_parser.cpp │ │ ├── shader │ │ ├── debug.fs │ │ ├── default.vs │ │ ├── filter1.fs │ │ ├── filter2.fs │ │ ├── stage1.fs │ │ └── stage2.fs │ │ ├── test_opengl_depth_packet_processor.cpp │ │ ├── tinythread │ │ ├── tinythread.cpp │ │ └── tinythread.h │ │ ├── transfer_pool.cpp │ │ ├── turbo_jpeg_rgb_packet_processor.cpp │ │ └── usb_control.cpp ├── src │ ├── JNILibfreenect2.cpp │ ├── JNILibfreenect2.h │ ├── org_openkinect_freenect2_Device.cpp │ └── org_openkinect_freenect2_Device.h ├── vc2013 │ ├── Debug │ │ └── libJNIlibfreenect2.dll │ ├── libJNIlibfreenect2.sln │ ├── libJNIlibfreenect2 │ │ ├── ReadMe.txt │ │ ├── dllmain.cpp │ │ ├── libJNIlibfreenect2.cpp │ │ ├── libJNIlibfreenect2.vcxproj │ │ ├── libJNIlibfreenect2.vcxproj.filters │ │ ├── libJNIlibfreenect2.vcxproj.user │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h │ └── x64 │ │ └── Release │ │ ├── libJNILibfreenect2.dll │ │ ├── libJNILibfreenect2.exp │ │ └── libJNILibfreenect2.lib └── xcode │ └── JNILibfreenect2.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ ├── JNILibfreenect2.xccheckout │ │ └── JNILibfreenect2.xcscmblueprint │ └── xcuserdata │ │ └── tom.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings │ └── xcuserdata │ └── tom.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── JNILibfreenect2.xcscheme │ └── xcschememanagement.plist ├── C++CmakeLinux ├── CMakeLists.txt ├── README.md └── src │ ├── JNILibfreenect2.cpp │ ├── JNILibfreenect2.h │ ├── org_openkinect_freenect2_Device.cpp │ └── org_openkinect_freenect2_Device.h ├── openKinectv2 ├── .classpath ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── bin │ ├── examples │ │ ├── FrameTest.class │ │ ├── MultipleKinects.class │ │ ├── PointCloud.class │ │ └── RegisteredTest.class │ └── openKinectv2 │ │ ├── Device.class │ │ ├── OpenKinectv2.class │ │ └── color.glsl ├── lib │ ├── libJNILibfreenect2.dll │ ├── libJNILibfreenect2.dylib │ ├── libturbojpeg.a │ ├── libturbojpeg.dylib │ ├── processing_2.2.1 │ │ ├── core.jar │ │ ├── gluegen-rt-natives-linux-amd64.jar │ │ ├── gluegen-rt-natives-linux-armv6hf.jar │ │ ├── gluegen-rt-natives-linux-i586.jar │ │ ├── gluegen-rt-natives-macosx-universal.jar │ │ ├── gluegen-rt-natives-windows-amd64.jar │ │ ├── gluegen-rt-natives-windows-i586.jar │ │ ├── gluegen-rt.jar │ │ ├── jogl-all-natives-linux-amd64.jar │ │ ├── jogl-all-natives-linux-armv6hf.jar │ │ ├── jogl-all-natives-linux-i586.jar │ │ ├── jogl-all-natives-macosx-universal.jar │ │ ├── jogl-all-natives-windows-amd64.jar │ │ ├── jogl-all-natives-windows-i586.jar │ │ └── jogl-all.jar │ └── usb-1.0.0-superspeed.a └── src │ ├── examples │ ├── FrameTest.java │ ├── MultipleKinects.java │ ├── PointCloud.java │ └── RegisteredTest.java │ └── openKinectv2 │ ├── Device.java │ ├── OpenKinectv2.java │ └── color.glsl └── protonectTest ├── libs ├── Protonect.cpp ├── TurboJpeg │ ├── include │ │ └── turbojpeg.h │ └── lib │ │ └── osx │ │ └── libturbojpeg.dylib ├── libfreenect2 │ └── include │ │ └── libfreenect2.h ├── libusb │ ├── include │ │ └── libusb │ │ │ ├── hotplug.h │ │ │ ├── libusb.h │ │ │ ├── libusbi.h │ │ │ ├── os │ │ │ ├── darwin_usb.h │ │ │ ├── linux_usbfs.h │ │ │ ├── poll_posix.h │ │ │ ├── poll_windows.h │ │ │ ├── threads_posix.h │ │ │ ├── threads_windows.h │ │ │ ├── wince_usb.h │ │ │ ├── windows_common.h │ │ │ └── windows_usb.h │ │ │ ├── version.h │ │ │ └── version_nano.h │ └── lib │ │ └── osx │ │ └── usb-1.0.0-superspeed.a └── protonect │ ├── include │ └── libfreenect2 │ │ ├── async_packet_processor.h │ │ ├── config.h │ │ ├── config.h.in │ │ ├── data_callback.h │ │ ├── depth_packet_processor.h │ │ ├── depth_packet_stream_parser.h │ │ ├── double_buffer.h │ │ ├── frame_listener.hpp │ │ ├── frame_listener_impl.h │ │ ├── libfreenect2.hpp │ │ ├── packet_pipeline.h │ │ ├── packet_processor.h │ │ ├── protocol │ │ ├── command.h │ │ ├── command_transaction.h │ │ ├── response.h │ │ └── usb_control.h │ │ ├── registration.h │ │ ├── resource.h │ │ ├── rgb_packet_processor.h │ │ ├── rgb_packet_stream_parser.h │ │ ├── threading.h │ │ ├── tinythread │ │ ├── tinythread.cpp │ │ └── tinythread.h │ │ └── usb │ │ ├── event_loop.h │ │ └── transfer_pool.h │ └── lib │ ├── libfreenect2.a │ └── libfreenect2.dylib ├── src └── main.cpp └── xcode └── ProtonectTest.xcodeproj ├── project.pbxproj ├── project.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── ProtonectTest.xccheckout └── xcuserdata │ └── tom.xcuserdatad │ └── UserInterfaceState.xcuserstate └── xcuserdata └── tom.xcuserdatad └── xcschemes ├── ProtonectTest.xcscheme └── xcschememanagement.plist /.gitignore: -------------------------------------------------------------------------------- 1 | #MAC OS X 2 | 3 | *.DS_Store 4 | 5 | *.build 6 | 7 | *.mode2v3 8 | 9 | build_openKinect2/Java/lib/JNILibfreenect2.build 10 | 11 | build_openKinect2/openKinectv2/lib/libJNILibfreenect2.dylib.dSYM 12 | 13 | *.dSYM 14 | 15 | *.dylib.dSYM 16 | 17 | 18 | #ECLIPSE 19 | 20 | *.metadata 21 | 22 | *.recommenders 23 | 24 | build_openKinect2/.metadata 25 | 26 | build_openKinect2/.recommenders 27 | 28 | build_openKinect2/openKinectv2/.settings 29 | 30 | build_openKinect2/openKinectv2/bin/java.policy.applet 31 | 32 | *.lock 33 | 34 | *.build 35 | 36 | *.fdt 37 | 38 | *.fnm 39 | 40 | *.frq 41 | 42 | *.gen 43 | 44 | *.tis 45 | 46 | *.tii 47 | 48 | *.tis 49 | 50 | *.prx 51 | 52 | *.tii 53 | 54 | *.fdt 55 | 56 | *.lock 57 | 58 | *.lock 59 | 60 | 61 | #NETBEANS 62 | 63 | /OpenKinect-Processing/nbproject/private/ 64 | 65 | /OpenKinect-Processing/build/ 66 | 67 | /OpenKinect-Processing/dist/ 68 | 69 | 70 | #VISUAL STUDIO 71 | 72 | 73 | *.log 74 | 75 | *.tlog 76 | 77 | *.obj 78 | 79 | *.pdb 80 | 81 | *.ipch 82 | 83 | *.opensdf 84 | 85 | *.sdf 86 | 87 | *.ilk 88 | 89 | *.pch 90 | 91 | *.idb 92 | 93 | *.suo 94 | -------------------------------------------------------------------------------- /OpenKinect-Processing/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /OpenKinect-Processing/.gitignore: -------------------------------------------------------------------------------- 1 | distribution 2 | /bin/ 3 | /bin/ 4 | -------------------------------------------------------------------------------- /OpenKinect-Processing/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OpenKinect-Processing 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/jna.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/jna.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/core.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-amd64.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-armv6hf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-armv6hf.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-linux-i586.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-macosx-universal.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-macosx-universal.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-amd64.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt-natives-windows-i586.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/gluegen-rt.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-amd64.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-armv6hf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-armv6hf.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-linux-i586.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-macosx-universal.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-macosx-universal.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-amd64.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all-natives-windows-i586.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/additional_libs/processing_3.10a/jogl-all.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/data/kinectThreshold.txt: -------------------------------------------------------------------------------- 1 | 630 2 | -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v1/AveragePointTracking/AveragePointTracking.pde: -------------------------------------------------------------------------------- 1 | // Daniel Shiffman 2 | // Tracking the average location beyond a given depth threshold 3 | // Thanks to Dan O'Sullivan 4 | 5 | // https://github.com/shiffman/OpenKinect-for-Processing 6 | // http://shiffman.net/p5/kinect/ 7 | 8 | import org.openkinect.freenect.*; 9 | import org.openkinect.processing.*; 10 | 11 | // The kinect stuff is happening in another class 12 | KinectTracker tracker; 13 | Kinect kinect; 14 | 15 | 16 | void setup() { 17 | size(640, 520); 18 | kinect = new Kinect(this); 19 | tracker = new KinectTracker(); 20 | } 21 | 22 | void draw() { 23 | background(255); 24 | 25 | // Run the tracking analysis 26 | tracker.track(); 27 | // Show the image 28 | tracker.display(); 29 | 30 | // Let's draw the raw location 31 | PVector v1 = tracker.getPos(); 32 | fill(50, 100, 250, 200); 33 | noStroke(); 34 | ellipse(v1.x, v1.y, 20, 20); 35 | 36 | // Let's draw the "lerped" location 37 | PVector v2 = tracker.getLerpedPos(); 38 | fill(100, 250, 50, 200); 39 | noStroke(); 40 | ellipse(v2.x, v2.y, 20, 20); 41 | 42 | // Display some info 43 | int t = tracker.getThreshold(); 44 | fill(0); 45 | text("threshold: " + t + " " + "framerate: " + int(frameRate) + " " + 46 | "UP increase threshold, DOWN decrease threshold", 10, 500); 47 | } 48 | 49 | // Adjust the threshold with key presses 50 | void keyPressed() { 51 | int t = tracker.getThreshold(); 52 | if (key == CODED) { 53 | if (keyCode == UP) { 54 | t+=5; 55 | tracker.setThreshold(t); 56 | } else if (keyCode == DOWN) { 57 | t-=5; 58 | tracker.setThreshold(t); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v1/DepthThreshold/DepthThreshold.pde: -------------------------------------------------------------------------------- 1 | // Daniel Shiffman 2 | // Depth thresholding example 3 | 4 | // https://github.com/shiffman/OpenKinect-for-Processing 5 | // http://shiffman.net/p5/kinect/ 6 | 7 | // Original example by Elie Zananiri 8 | // http://www.silentlycrashing.net 9 | 10 | import org.openkinect.freenect.*; 11 | import org.openkinect.processing.*; 12 | 13 | Kinect kinect; 14 | 15 | // Depth image 16 | PImage depthImg; 17 | 18 | // Which pixels do we care about? 19 | // These thresholds can also be found with a variaty of methods 20 | float minDepth = 996; 21 | float maxDepth = 2493; 22 | 23 | // What is the kinect's angle 24 | float angle; 25 | 26 | void setup() { 27 | size(1280, 480); 28 | 29 | kinect = new Kinect(this); 30 | kinect.initDepth(); 31 | angle = kinect.getTilt(); 32 | 33 | // Blank image 34 | depthImg = new PImage(kinect.width, kinect.height); 35 | } 36 | 37 | void draw() { 38 | // Draw the raw image 39 | image(kinect.getDepthImage(), 0, 0); 40 | 41 | // Calibration 42 | //minDepth = map(mouseX,0,width, 0, 4500); 43 | //maxDepth = map(mouseY,0,height, 0, 4500); 44 | 45 | // Threshold the depth image 46 | int[] rawDepth = kinect.getRawDepth(); 47 | for (int i=0; i < rawDepth.length; i++) { 48 | if (rawDepth[i] >= minDepth && rawDepth[i] <= maxDepth) { 49 | depthImg.pixels[i] = color(255); 50 | } else { 51 | depthImg.pixels[i] = color(0); 52 | } 53 | } 54 | 55 | // Draw the thresholded image 56 | depthImg.updatePixels(); 57 | image(depthImg, kinect.width, 0); 58 | 59 | //Comment for Calibration 60 | fill(0); 61 | text("TILT: " + angle, 10, 20); 62 | text("THRESHOLD: [" + minDepth + ", " + maxDepth + "]", 10, 36); 63 | 64 | //Calibration Text 65 | //fill(255); 66 | //textSize(32); 67 | //text(minDepth + " " + maxDepth, 10, 64); 68 | } 69 | 70 | // Adjust the angle and the depth threshold min and max 71 | void keyPressed() { 72 | if (key == CODED) { 73 | if (keyCode == UP) { 74 | angle++; 75 | } else if (keyCode == DOWN) { 76 | angle--; 77 | } 78 | angle = constrain(angle, 0, 30); 79 | kinect.setTilt(angle); 80 | } else if (key == 'a') { 81 | minDepth = constrain(minDepth+10, 0, maxDepth); 82 | } else if (key == 's') { 83 | minDepth = constrain(minDepth-10, 0, maxDepth); 84 | } else if (key == 'z') { 85 | maxDepth = constrain(maxDepth+10, minDepth, 2047); 86 | } else if (key =='x') { 87 | maxDepth = constrain(maxDepth-10, minDepth, 2047); 88 | } 89 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v1/PointCloudOGL/PointCloudOGL.pde: -------------------------------------------------------------------------------- 1 | // Thomas Sanchez Lengeling 2 | // openGL Point Cloud Example. 3 | 4 | // https://github.com/shiffman/OpenKinect-for-Processing 5 | // http://shiffman.net/p5/kinect/ 6 | 7 | import java.nio.*; 8 | import org.openkinect.freenect.*; 9 | import org.openkinect.processing.*; 10 | 11 | // Kinect Library object 12 | Kinect kinect; 13 | 14 | // Angle for rotation 15 | float a = 0; 16 | 17 | //openGL object and shader 18 | PGL pgl; 19 | PShader sh; 20 | 21 | //VBO buffer location in the GPU 22 | int vertexVboId; 23 | 24 | void setup() { 25 | // Rendering in P3D 26 | size(800, 600, P3D); 27 | kinect = new Kinect(this); 28 | kinect.initDepth(); 29 | 30 | //load shaders 31 | sh = loadShader("frag.glsl", "vert.glsl"); 32 | 33 | PGL pgl = beginPGL(); 34 | 35 | IntBuffer intBuffer = IntBuffer.allocate(1); 36 | pgl.genBuffers(1, intBuffer); 37 | 38 | //memory location of the VBO 39 | vertexVboId = intBuffer.get(0); 40 | 41 | endPGL(); 42 | } 43 | 44 | void draw() { 45 | 46 | background(0); 47 | 48 | image(kinect.getDepthImage(), 0, 0, 320, 240); 49 | 50 | // Set up origin at middle of display, scale, and translate 51 | pushMatrix(); 52 | translate(width/2, height/2, 50); 53 | scale(150); 54 | rotateY(a); 55 | 56 | 57 | //data size times 3 for each XYZ coordinate 58 | int vertData = kinect.width * kinect.height; 59 | 60 | //begin openGL calls and bind the shader 61 | pgl = beginPGL(); 62 | sh.bind(); 63 | 64 | FloatBuffer depthPositions = kinect.getDephToWorldPositions(); 65 | 66 | 67 | //obtain the vertex location in the shaders. 68 | //useful to know what shader to use when drawing the vertex positions 69 | vertexVboId = pgl.getAttribLocation(sh.glProgram, "vertex"); 70 | 71 | pgl.enableVertexAttribArray(vertexVboId); 72 | 73 | //bind vertex positions to the VBO 74 | { 75 | pgl.bindBuffer(PGL.ARRAY_BUFFER, vertexVboId); 76 | // fill VBO with data 77 | pgl.bufferData(PGL.ARRAY_BUFFER, Float.BYTES * vertData *3, depthPositions, PGL.DYNAMIC_DRAW); 78 | // associate currently bound VBO with shader attribute 79 | pgl.vertexAttribPointer(vertexVboId, 3, PGL.FLOAT, false, Float.BYTES * 3, 0 ); 80 | } 81 | 82 | // unbind VBOs 83 | pgl.bindBuffer(PGL.ARRAY_BUFFER, 0); 84 | 85 | //draw the point buffer as a set of POINTS 86 | pgl.drawArrays(PGL.POINTS, 0, vertData); 87 | 88 | //disable the vertex positions 89 | pgl.disableVertexAttribArray(vertexVboId); 90 | 91 | //finish drawing 92 | sh.unbind(); 93 | endPGL(); 94 | 95 | popMatrix(); 96 | 97 | fill(255, 0, 0); 98 | text(frameRate, 50, 50); 99 | 100 | // Rotate 101 | // Uncomment for rotation 102 | // a += 0.015f; 103 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v1/PointCloudOGL/data/frag.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | precision mediump int; 4 | #endif 5 | 6 | varying vec4 vertColor; 7 | 8 | void main() { 9 | //color image int BGRA Color format 10 | gl_FragColor = vec4(1, 1, 1, 1); 11 | } 12 | -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v1/PointCloudOGL/data/vert.glsl: -------------------------------------------------------------------------------- 1 | uniform mat4 transform; 2 | 3 | attribute vec4 vertex; 4 | attribute vec4 color; 5 | 6 | varying vec4 vertColor; 7 | 8 | void main() { 9 | gl_Position = transform * vertex; 10 | vertColor = color; 11 | } 12 | -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v1/RGBDepthTest/RGBDepthTest.pde: -------------------------------------------------------------------------------- 1 | // Daniel Shiffman 2 | // All features test 3 | 4 | // https://github.com/shiffman/OpenKinect-for-Processing 5 | // http://shiffman.net/p5/kinect/ 6 | 7 | import org.openkinect.freenect.*; 8 | import org.openkinect.processing.*; 9 | 10 | Kinect kinect; 11 | 12 | float deg; 13 | 14 | boolean ir = false; 15 | boolean colorDepth = false; 16 | boolean mirror = false; 17 | 18 | void setup() { 19 | size(1280, 520); 20 | kinect = new Kinect(this); 21 | kinect.initDepth(); 22 | kinect.initVideo(); 23 | //kinect.enableIR(ir); 24 | kinect.enableColorDepth(colorDepth); 25 | 26 | deg = kinect.getTilt(); 27 | // kinect.tilt(deg); 28 | } 29 | 30 | 31 | void draw() { 32 | background(0); 33 | image(kinect.getVideoImage(), 0, 0); 34 | image(kinect.getDepthImage(), 640, 0); 35 | fill(255); 36 | text( 37 | "Press 'i' to enable/disable between video image and IR image, " + 38 | "Press 'c' to enable/disable between color depth and gray scale depth, " + 39 | "Press 'm' to enable/diable mirror mode, "+ 40 | "UP and DOWN to tilt camera " + 41 | "Framerate: " + int(frameRate), 10, 515); 42 | } 43 | 44 | void keyPressed() { 45 | if (key == 'i') { 46 | ir = !ir; 47 | kinect.enableIR(ir); 48 | } else if (key == 'c') { 49 | colorDepth = !colorDepth; 50 | kinect.enableColorDepth(colorDepth); 51 | }else if(key == 'm'){ 52 | mirror = !mirror; 53 | kinect.enableMirror(mirror); 54 | } else if (key == CODED) { 55 | if (keyCode == UP) { 56 | deg++; 57 | } else if (keyCode == DOWN) { 58 | deg--; 59 | } 60 | deg = constrain(deg, 0, 30); 61 | kinect.setTilt(deg); 62 | } 63 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/AveragePointTracking2/AveragePointTracking2.pde: -------------------------------------------------------------------------------- 1 | // Daniel Shiffman and Thomas Sanchez Lengeling 2 | // Tracking the average location beyond a given depth threshold 3 | // Thanks to Dan O'Sullivan 4 | 5 | // https://github.com/shiffman/OpenKinect-for-Processing 6 | // http://shiffman.net/p5/kinect/ 7 | 8 | import org.openkinect.processing.*; 9 | 10 | // The kinect stuff is happening in another class 11 | KinectTracker tracker; 12 | 13 | 14 | 15 | void setup() { 16 | size(640, 520); 17 | 18 | tracker = new KinectTracker(this); 19 | } 20 | 21 | void draw() { 22 | background(255); 23 | 24 | // Run the tracking analysis 25 | tracker.track(); 26 | // Show the image 27 | tracker.display(); 28 | 29 | // Let's draw the raw location 30 | PVector v1 = tracker.getPos(); 31 | fill(50, 100, 250, 200); 32 | noStroke(); 33 | ellipse(v1.x, v1.y, 20, 20); 34 | 35 | // Let's draw the "lerped" location 36 | PVector v2 = tracker.getLerpedPos(); 37 | fill(100, 250, 50, 200); 38 | noStroke(); 39 | ellipse(v2.x, v2.y, 20, 20); 40 | 41 | // Display some info 42 | int t = tracker.getThreshold(); 43 | fill(0); 44 | text("threshold: " + t + " " + "framerate: " + int(frameRate) + " " + 45 | "UP increase threshold, DOWN decrease threshold", 10, 500); 46 | } 47 | 48 | // Adjust the threshold with key presses 49 | void keyPressed() { 50 | int t = tracker.getThreshold(); 51 | if (key == CODED) { 52 | if (keyCode == UP) { 53 | t +=5; 54 | tracker.setThreshold(t); 55 | } else if (keyCode == DOWN) { 56 | t -=5; 57 | tracker.setThreshold(t); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/CameraPointCloud2/CameraParams.pde: -------------------------------------------------------------------------------- 1 | //camera information based on the Kinect v2 hardware 2 | static class CameraParams { 3 | static float cx = 254.878f; 4 | static float cy = 205.395f; 5 | static float fx = 365.456f; 6 | static float fy = 365.456f; 7 | static float k1 = 0.0905474; 8 | static float k2 = -0.26819; 9 | static float k3 = 0.0950862; 10 | static float p1 = 0.0; 11 | static float p2 = 0.0; 12 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/CameraPointCloud2/CameraPointCloud2.pde: -------------------------------------------------------------------------------- 1 | // Daniel Shiffman 2 | // Thomas Sanchez Lengeling 3 | // Kinect Point Cloud example 4 | 5 | // https://github.com/shiffman/OpenKinect-for-Processing 6 | // http://shiffman.net/p5/kinect/ 7 | 8 | import org.openkinect.processing.*; 9 | 10 | // Kinect Library object 11 | Kinect2 kinect2; 12 | 13 | // Angle for rotation 14 | float rotationRads = 3.1; 15 | 16 | void setup() { 17 | 18 | // Rendering in P3D 19 | size(800, 600, P3D); 20 | 21 | kinect2 = new Kinect2(this); 22 | kinect2.initDepth(); 23 | kinect2.initDevice(); 24 | 25 | smooth(16); 26 | } 27 | 28 | 29 | void draw() { 30 | background(0); 31 | 32 | // Translate and rotate 33 | pushMatrix(); 34 | translate(width/2, height/2, 50); 35 | rotateY(rotationRads); 36 | 37 | // We're just going to calculate and draw every 2nd pixel 38 | int skip = 2; 39 | 40 | // Get the raw depth as array of integers 41 | int[] depth = kinect2.getRawDepth(); 42 | 43 | stroke(255); 44 | beginShape(POINTS); 45 | for (int x = 0; x < kinect2.depthWidth; x += skip) { 46 | for (int y = 0; y < kinect2.depthHeight; y += skip) { 47 | int offset = x + y * kinect2.depthWidth; 48 | 49 | //calculte the x, y, z camera position based on the raw depth data 50 | PVector point = depthToPointCloudPos(x, y, depth[offset]); 51 | 52 | // Draw a point 53 | vertex(point.x, point.y, point.z); 54 | } 55 | } 56 | endShape(); 57 | 58 | //pop the matrix scene, reset translation and rotation 59 | popMatrix(); 60 | 61 | 62 | drawFrustum(); 63 | 64 | // Rotate 65 | //rotationRads += 0.0015f; 66 | } 67 | 68 | //draw camera frustum 69 | void drawFrustum(){ 70 | 71 | } 72 | 73 | //calculate the xyz camera position based on the depth data 74 | PVector depthToPointCloudPos(int x, int y, float depthValue) { 75 | PVector point = new PVector(); 76 | point.z = (depthValue);// / (1.0f); // Convert from mm to meters 77 | point.x = (x - CameraParams.cx) * point.z / CameraParams.fx; 78 | point.y = (y - CameraParams.cy) * point.z / CameraParams.fy; 79 | return point; 80 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/ColorPointCloud2/data/frag.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | precision mediump int; 4 | #endif 5 | 6 | varying vec4 vertColor; 7 | 8 | void main() { 9 | //color image int BGRA Color format 10 | gl_FragColor = vertColor; 11 | } 12 | -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/ColorPointCloud2/data/vert.glsl: -------------------------------------------------------------------------------- 1 | uniform mat4 transform; 2 | 3 | attribute vec4 vertex; 4 | attribute vec4 color; 5 | 6 | varying vec4 vertColor; 7 | 8 | void main() { 9 | gl_Position = transform * vertex; 10 | vertColor = color; 11 | } 12 | -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/DepthPointCloud2/CameraParams.pde: -------------------------------------------------------------------------------- 1 | //camera information based on the Kinect v2 hardware 2 | static class CameraParams { 3 | static float cx = 254.878f; 4 | static float cy = 205.395f; 5 | static float fx = 365.456f; 6 | static float fy = 365.456f; 7 | static float k1 = 0.0905474; 8 | static float k2 = -0.26819; 9 | static float k3 = 0.0950862; 10 | static float p1 = 0.0; 11 | static float p2 = 0.0; 12 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/DepthPointCloud2/data/frag.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | precision mediump int; 4 | #endif 5 | 6 | varying vec4 vertColor; 7 | 8 | //input color 9 | uniform vec4 fragColor; 10 | 11 | void main() { 12 | 13 | //outputColor 14 | gl_FragColor = fragColor; 15 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/DepthPointCloud2/data/vert.glsl: -------------------------------------------------------------------------------- 1 | uniform mat4 transform; 2 | 3 | attribute vec4 vertex; 4 | //attribute vec4 color; 5 | 6 | varying vec4 vertColor; 7 | 8 | void main() { 9 | gl_Position = transform * vertex; 10 | // vertColor = color; 11 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/DepthThreshold2/DepthThreshold2.pde: -------------------------------------------------------------------------------- 1 | // Daniel Shiffman 2 | // Depth thresholding example 3 | 4 | // https://github.com/shiffman/OpenKinect-for-Processing 5 | // http://shiffman.net/p5/kinect/ 6 | 7 | // Original example by Elie Zananiri 8 | // http://www.silentlycrashing.net 9 | 10 | import org.openkinect.processing.*; 11 | 12 | Kinect2 kinect2; 13 | 14 | // Depth image 15 | PImage depthImg; 16 | 17 | // Which pixels do we care about? 18 | int minDepth = 0; 19 | int maxDepth = 4500; //4.5m 20 | 21 | // What is the kinect's angle 22 | float angle; 23 | 24 | void setup() { 25 | size(1280, 480); 26 | 27 | kinect2 = new Kinect2(this); 28 | kinect2.initDepth(); 29 | kinect2.initDevice(); 30 | 31 | // Blank image 32 | depthImg = new PImage(kinect2.depthWidth, kinect2.depthHeight); 33 | } 34 | 35 | void draw() { 36 | // Draw the raw image 37 | image(kinect2.getDepthImage(), 0, 0); 38 | 39 | // Threshold the depth image 40 | int[] rawDepth = kinect2.getRawDepth(); 41 | 42 | 43 | for (int i=0; i < rawDepth.length; i++) { 44 | if (rawDepth[i] >= minDepth && rawDepth[i] <= maxDepth) { 45 | float ratio = (maxDepth - minDepth)/255.0; 46 | depthImg.pixels[i] = color((rawDepth[i] - minDepth)/ratio); 47 | } else { 48 | depthImg.pixels[i] = color(0); 49 | } 50 | } 51 | 52 | 53 | // Draw the thresholded image 54 | depthImg.updatePixels(); 55 | image(depthImg, kinect2.depthWidth, 0); 56 | 57 | fill(0); 58 | text("TILT: " + angle, 10, 20); 59 | text("THRESHOLD: [" + minDepth + ", " + maxDepth + "]", 10, 36); 60 | } 61 | 62 | // Adjust the angle and the depth threshold min and max 63 | void keyPressed() { 64 | if (key == 'a') { 65 | minDepth = constrain(minDepth+100, 0, maxDepth); 66 | } else if (key == 's') { 67 | minDepth = constrain(minDepth-100, 0, maxDepth); 68 | } else if (key == 'z') { 69 | maxDepth = constrain(maxDepth+100, minDepth, 1165952918); 70 | } else if (key =='x') { 71 | maxDepth = constrain(maxDepth-100, minDepth, 1165952918); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/MultiKinect2/MultiKinect2.pde: -------------------------------------------------------------------------------- 1 | /* 2 | Thomas Sanchez Lengeling 3 | http://codigogenerativo.com/ 4 | 5 | How to use multiple Kinects v2 in the same sketch. 6 | Should work up n number of Kinects v2 connected to the USB 3.0 port. 7 | 8 | https://github.com/shiffman/OpenKinect-for-Processing 9 | http://shiffman.net/p5/kinect/ 10 | */ 11 | 12 | import org.openkinect.processing.*; 13 | 14 | Kinect2 kinect2a; 15 | Kinect2 kinect2b; 16 | 17 | void setup() { 18 | size(1536, 848, P2D); 19 | 20 | kinect2a = new Kinect2(this); 21 | kinect2a.initDepth(); 22 | kinect2a.initVideo(); 23 | kinect2a.initIR(); 24 | 25 | kinect2b = new Kinect2(this); 26 | kinect2b.initDepth(); 27 | kinect2b.initVideo(); 28 | kinect2b.initIR(); 29 | 30 | //Start tracking each kinect 31 | kinect2a.initDevice(0); //index 0 32 | kinect2b.initDevice(1); //index 1 33 | 34 | background(0); 35 | } 36 | 37 | void draw() { 38 | background(0); 39 | 40 | image(kinect2a.getDepthImage(), 0, 0); 41 | image(kinect2a.getIrImage(), 512, 0); 42 | image(kinect2a.getVideoImage(), 512*2, 0, 512, 424); 43 | 44 | image(kinect2b.getDepthImage(), 0, 424); 45 | image(kinect2b.getIrImage(), 512, 424); 46 | image(kinect2b.getVideoImage(), 512*2, 424, 512, 424); 47 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/Kinect_v2/RGBDepthTest2/RGBDepthTest2.pde: -------------------------------------------------------------------------------- 1 | // Daniel Shiffman 2 | // All features test 3 | 4 | // https://github.com/shiffman/OpenKinect-for-Processing 5 | // http://shiffman.net/p5/kinect/ 6 | 7 | import org.openkinect.freenect.*; 8 | import org.openkinect.freenect2.*; 9 | import org.openkinect.processing.*; //<>// 10 | 11 | Kinect2 kinect2; 12 | 13 | void setup() { 14 | size(1024, 848, P2D); 15 | 16 | kinect2 = new Kinect2(this); 17 | kinect2.initVideo(); 18 | kinect2.initDepth(); 19 | kinect2.initIR(); 20 | kinect2.initRegistered(); 21 | // Start all data 22 | kinect2.initDevice(); 23 | } 24 | 25 | 26 | void draw() { 27 | background(0); 28 | image(kinect2.getVideoImage(), 0, 0, kinect2.colorWidth*0.267, kinect2.colorHeight*0.267); 29 | image(kinect2.getDepthImage(), kinect2.depthWidth, 0); 30 | image(kinect2.getIrImage(), 0, kinect2.depthHeight); 31 | 32 | image(kinect2.getRegisteredImage(), kinect2.depthWidth, kinect2.depthHeight); 33 | fill(255); 34 | text("Framerate: " + (int)(frameRate), 10, 515); 35 | } 36 | -------------------------------------------------------------------------------- /OpenKinect-Processing/examples/MultiKinectVersion/MultiKinectVersion.pde: -------------------------------------------------------------------------------- 1 | 2 | //Thomas Sanchez Lengeling 3 | //http://codigogenerativo.com/ 4 | 5 | //Multiple Kinect versions on a single sketch. 6 | //https://github.com/shiffman/OpenKinect-for-Processing 7 | //http://shiffman.net/p5/kinect/ 8 | 9 | import org.openkinect.processing.*; 10 | 11 | Kinect kinect; 12 | Kinect2 kinect2; 13 | 14 | float deg; 15 | 16 | 17 | void setup() { 18 | size(1536, 848); 19 | 20 | //v2 21 | kinect2 = new Kinect2(this); 22 | kinect2.initDepth(); 23 | kinect2.initVideo(); 24 | kinect2.initIR(); 25 | kinect2.initDevice(); 26 | 27 | //v1 28 | kinect = new Kinect(this); 29 | kinect.initDepth(); 30 | kinect.initVideo(); 31 | kinect.enableColorDepth(false); 32 | deg = kinect.getTilt(); 33 | } 34 | 35 | 36 | void draw() { 37 | background(0); 38 | 39 | //v2 40 | PImage depth = kinect2.getDepthImage(); 41 | image(depth, 0, 0); 42 | 43 | PImage ir = kinect2.getIrImage(); 44 | image(ir, 512, 0); 45 | 46 | PImage rgb = kinect2.getVideoImage(); 47 | image(rgb, 512*2, 0, 512, 424); 48 | 49 | //v1 getDepthImage 50 | image(kinect.getDepthImage(), 0, 424, 512, 424); 51 | image(kinect.getVideoImage(), 512*2, 424, 512, 424); 52 | } 53 | 54 | 55 | //with key UP or DOWM tilt the Kinect v1 56 | void keyPressed() { 57 | if (key == CODED) { 58 | if (keyCode == UP) { 59 | deg++; 60 | deg = constrain(deg, 0, 30); 61 | kinect.setTilt(deg); 62 | } else if (keyCode == DOWN) { 63 | deg--; 64 | deg = constrain(deg, 0, 30); 65 | kinect.setTilt(deg); 66 | } 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/jna.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/jna.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/linux-armv6hf/libfreenect.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/linux-armv6hf/libfreenect.so -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/linux/libfreenect.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/linux/libfreenect.a -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/linux/libfreenect.so: -------------------------------------------------------------------------------- 1 | libfreenect.so.0.5 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/linux/libfreenect.so.0.5: -------------------------------------------------------------------------------- 1 | libfreenect.so.0.5.2 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/linux/libfreenect.so.0.5.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/linux/libfreenect.so.0.5.2 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/mac/libfreenect.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/mac/libfreenect.dylib -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/mac/libusb-1.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/mac/libusb-1.0.0.dylib -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/msvc/freenect.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/msvc/freenect.dll -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/msvc/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/msvc/libusb-1.0.dll -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v1/msvc/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v1/msvc/pthreadVC2.dll -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/linux/libfreenect2.so: -------------------------------------------------------------------------------- 1 | libfreenect2.so.0.2 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/linux/libfreenect2.so.0.2: -------------------------------------------------------------------------------- 1 | libfreenect2.so.0.2.0 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/linux/libfreenect2.so.0.2.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/linux/libfreenect2.so.0.2.0 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0.1.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/linux/libturbojpeg.so.0.1.0 -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/mac/libJNILibfreenect2.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libJNILibfreenect2.dylib -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/mac/libturbojpeg.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libturbojpeg.a -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/mac/libturbojpeg.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libturbojpeg.dylib -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/mac/libusb-1.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/mac/libusb-1.0.0.dylib -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/msvc/OpenCL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/OpenCL.lib -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/msvc/libJNILibfreenect2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/libJNILibfreenect2.dll -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/msvc/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/libusb-1.0.dll -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/msvc/libusb-1.0.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/libusb-1.0.lib -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/msvc/turbojpeg.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/turbojpeg.dll -------------------------------------------------------------------------------- /OpenKinect-Processing/lib/v2/msvc/turbojpeg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/lib/v2/msvc/turbojpeg.lib -------------------------------------------------------------------------------- /OpenKinect-Processing/resources/README.md: -------------------------------------------------------------------------------- 1 | ## How to install ##library.name## 2 | 3 | ### Install with the Contribution Manager 4 | 5 | Add contributed libraries by selecting the menu item _Sketch_ → _Import Library..._ → _Add Library..._ This will open the Contribution Manager, where you can browse for ##library.name##, or any other library you want to install. 6 | 7 | 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. 8 | 9 | ### Manual Install 10 | 11 | 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. 12 | 13 | By default the following locations are used for your sketchbook folder: 14 | * For Mac users, the sketchbook folder is located inside `~/Documents/Processing` 15 | * For Windows users, the sketchbook folder is located inside `My Documents/Processing` 16 | 17 | Download ##library.name## from ##library.url## 18 | 19 | Unzip and copy the contributed library's folder into the `libraries` folder in the Processing sketchbook. You will need to create this `libraries` folder if it does not exist. 20 | 21 | The folder structure for library ##library.name## should be as follows: 22 | 23 | ``` 24 | Processing 25 | libraries 26 | ##library.name## 27 | examples 28 | library 29 | ##library.name##.jar 30 | reference 31 | src 32 | ``` 33 | 34 | Some folders like `examples` or `src` might be missing. After library ##library.name## has been successfully installed, restart the Processing application. 35 | 36 | ### Troubleshooting 37 | 38 | If you're having trouble, have a look at the [Processing Wiki](https://github.com/processing/processing/wiki/How-to-Install-a-Contributed-Library) for more information, or contact the author [##author.name##](##author.url##). 39 | -------------------------------------------------------------------------------- /OpenKinect-Processing/resources/code/.gitignore: -------------------------------------------------------------------------------- 1 | /jna.jar 2 | /libJNILibfreenect2.dylib 3 | /libfreenect.dylib 4 | /libturbojpeg.a 5 | /libturbojpeg.dylib 6 | /libusb-1.0.0.dylib 7 | /usb-1.0.0-superspeed.a 8 | -------------------------------------------------------------------------------- /OpenKinect-Processing/resources/code/ExampleTaglet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/resources/code/ExampleTaglet.class -------------------------------------------------------------------------------- /OpenKinect-Processing/resources/code/ant-contrib-1.0b3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/OpenKinect-Processing/resources/code/ant-contrib-1.0b3.jar -------------------------------------------------------------------------------- /OpenKinect-Processing/resources/code/doc.sh: -------------------------------------------------------------------------------- 1 | # a shell script to create a java documentation 2 | # for a processing library. 3 | # 4 | # make changes to the variables below so they 5 | # fit the structure of your library 6 | 7 | # the package name of your library 8 | package=template; 9 | 10 | # source folder location 11 | src=../src; 12 | 13 | # the destination folder of your documentation 14 | dest=../documentation; 15 | 16 | 17 | # compile the java documentation 18 | javadoc -d $dest -stylesheetfile ./stylesheet.css -sourcepath ${src} ${package} 19 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/Context.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | public interface Context { 28 | int numDevices(); 29 | void setLogHandler(LogHandler handler); 30 | void setLogLevel(LogLevel level); 31 | Device openDevice(int index); 32 | void shutdown(); 33 | } 34 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/DepthFormat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.util.HashMap; 28 | import java.util.Map; 29 | 30 | public enum DepthFormat { 31 | D11BIT(0), 32 | D10BIT(1), 33 | D11BIT_PACKED(2), 34 | D10BIT_PACKED(3), 35 | REGISTERED(4), 36 | MM(5); 37 | 38 | private final int value; 39 | private static final Map MAP = new HashMap(6); 40 | static { 41 | for(DepthFormat v : DepthFormat.values()) { 42 | MAP.put(v.intValue(), v); 43 | } 44 | } 45 | 46 | private DepthFormat(int value) { 47 | this.value = value; 48 | } 49 | 50 | public int intValue() { 51 | return value; 52 | } 53 | 54 | public static DepthFormat fromInt(int value) { 55 | return MAP.get(value); 56 | } 57 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/DepthHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.nio.ByteBuffer; 28 | 29 | public interface DepthHandler { 30 | void onFrameReceived(FrameMode mode, ByteBuffer frame, int timestamp); 31 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/Device.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | public interface Device { 28 | double[] getAccel(); 29 | int setLed(LedStatus status); 30 | void refreshTiltState(); 31 | double getTiltAngle(); 32 | int setTiltAngle(double angle); 33 | TiltStatus getTiltStatus(); 34 | void setDepthFormat(DepthFormat fmt); 35 | void setVideoFormat(VideoFormat fmt); 36 | void setDepthFormat(DepthFormat fmt, Resolution res); 37 | void setVideoFormat(VideoFormat fmt, Resolution res); 38 | FrameMode getDepthMode(); 39 | FrameMode getVideoMode(); 40 | int startDepth(DepthHandler handler); 41 | int startVideo(VideoHandler handler); 42 | int stopDepth(); 43 | int stopVideo(); 44 | void close(); 45 | public abstract int getDeviceIndex(); 46 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/DeviceFlags.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | public enum DeviceFlags { 28 | MOTOR(1), 29 | CAMERA(2), 30 | AUDIO(4); 31 | 32 | private final int value; 33 | 34 | private DeviceFlags(int value) { 35 | this.value = value; 36 | } 37 | 38 | public int intValue() { 39 | return value; 40 | } 41 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/FrameMode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import com.sun.jna.Structure; 28 | import java.util.List; 29 | import java.util.Arrays; 30 | 31 | public class FrameMode extends Structure { 32 | /* All fields are public because Structure requires it. 33 | However, fields should NOT be altered by external code. */ 34 | public int reserved; 35 | public int resolution; 36 | public int format; 37 | public int bytes; 38 | public short width, height; 39 | public byte dataBitsPerPixel, paddingBitsPerPixel; 40 | public byte framerate, valid; 41 | 42 | public FrameMode() { 43 | valid = 0; 44 | } 45 | 46 | protected List getFieldOrder() { 47 | return Arrays.asList(new String[] {"reserved", "resolution", "format", 48 | "bytes", "width", "height", "dataBitsPerPixel", 49 | "paddingBitsPerPixel", "framerate", "valid"}); 50 | } 51 | 52 | public Resolution getResolution() { 53 | return Resolution.fromInt(resolution); 54 | } 55 | 56 | public DepthFormat getDepthFormat() { 57 | return DepthFormat.fromInt(format); 58 | } 59 | 60 | public VideoFormat getVideoFormat() { 61 | return VideoFormat.fromInt(format); 62 | } 63 | 64 | public int getFrameSize() { 65 | return bytes; 66 | } 67 | 68 | public short getWidth() { 69 | return width; 70 | } 71 | 72 | public short getHeight() { 73 | return height; 74 | } 75 | 76 | public int getFrameRate() { 77 | return framerate; 78 | } 79 | 80 | public boolean isValid() { 81 | return (valid != 0); 82 | } 83 | 84 | public static class ByValue extends FrameMode implements Structure.ByValue { } 85 | } 86 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/LedStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.util.HashMap; 28 | import java.util.Map; 29 | 30 | public enum LedStatus { 31 | OFF(0), 32 | GREEN(1), 33 | RED(2), 34 | YELLOW(3), 35 | BLINK_YELLOW(4), 36 | BLINK_GREEN(5), 37 | BLINK_RED_YELLOW(6); 38 | 39 | private final int value; 40 | private static final Map MAP = new HashMap(7); 41 | static { 42 | for(LedStatus v : LedStatus.values()) { 43 | MAP.put(v.intValue(), v); 44 | } 45 | } 46 | 47 | private LedStatus(int value) { 48 | this.value = value; 49 | } 50 | 51 | public int intValue() { 52 | return value; 53 | } 54 | 55 | public static LedStatus fromInt(int value) { 56 | return MAP.get(value); 57 | } 58 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/LogHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | public interface LogHandler { 28 | void onMessage(Device dev, LogLevel level, String msg); 29 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/LogLevel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.util.HashMap; 28 | import java.util.Map; 29 | 30 | public enum LogLevel { 31 | FATAL(0), 32 | ERROR(1), 33 | WARNING(2), 34 | NOTICE(3), 35 | INFO(4), 36 | DEBUG(5), 37 | SPEW(6), 38 | FLOOD(7); 39 | 40 | private final int value; 41 | private static final Map MAP = new HashMap(8); 42 | static { 43 | for(LogLevel v : LogLevel.values()) { 44 | MAP.put(v.intValue(), v); 45 | } 46 | } 47 | 48 | private LogLevel(int value) { 49 | this.value = value; 50 | } 51 | 52 | public int intValue() { 53 | return value; 54 | } 55 | 56 | public static LogLevel fromInt(int value) { 57 | return MAP.get(value); 58 | } 59 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/Resolution.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.util.HashMap; 28 | import java.util.Map; 29 | 30 | public enum Resolution { 31 | LOW(0), 32 | MEDIUM(1), 33 | HIGH(2); 34 | 35 | private final int value; 36 | private static final Map MAP = new HashMap(3); 37 | static { 38 | for(Resolution v : Resolution.values()) { 39 | MAP.put(v.intValue(), v); 40 | } 41 | } 42 | 43 | private Resolution(int value) { 44 | this.value = value; 45 | } 46 | 47 | public int intValue() { 48 | return value; 49 | } 50 | 51 | public static Resolution fromInt(int value) { 52 | return MAP.get(value); 53 | } 54 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/TiltStatus.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.util.HashMap; 28 | import java.util.Map; 29 | 30 | public enum TiltStatus { 31 | STOPPED(0), 32 | LIMIT(1), 33 | MOVING(4); 34 | 35 | private final int value; 36 | private static final Map MAP = new HashMap(3); 37 | static { 38 | for(TiltStatus v : TiltStatus.values()) { 39 | MAP.put(v.intValue(), v); 40 | } 41 | } 42 | 43 | private TiltStatus(int value) { 44 | this.value = value; 45 | } 46 | 47 | public int intValue() { 48 | return value; 49 | } 50 | 51 | public static TiltStatus fromInt(int value) { 52 | return MAP.get(value); 53 | } 54 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/VideoFormat.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.util.HashMap; 28 | import java.util.Map; 29 | 30 | public enum VideoFormat { 31 | RGB(0), 32 | BAYER(1), 33 | IR_8BIT(2), 34 | IR_10BIT(3), 35 | IR_10BIT_PACKED(4), 36 | YUV_RGB(5), 37 | YUV_RAW(6); 38 | 39 | private final int value; 40 | private static final Map MAP = new HashMap(7); 41 | static { 42 | for(VideoFormat v : VideoFormat.values()) { 43 | MAP.put(v.intValue(), v); 44 | } 45 | } 46 | 47 | private VideoFormat(int value) { 48 | this.value = value; 49 | } 50 | 51 | public int intValue() { 52 | return value; 53 | } 54 | 55 | public static VideoFormat fromInt(int value) { 56 | return MAP.get(value); 57 | } 58 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/freenect/VideoHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL20 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, 15 | * you may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL20 file, or 19 | * 3) Delete the GPL v2.0 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * Binary distributions must follow the binary distribution requirements of 23 | * either License. 24 | */ 25 | package org.openkinect.freenect; 26 | 27 | import java.nio.ByteBuffer; 28 | 29 | public interface VideoHandler { 30 | void onFrameReceived(FrameMode mode, ByteBuffer frame, int timestamp); 31 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/processing/Kinect2.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.processing; 2 | 3 | import org.openkinect.freenect2.Device; 4 | 5 | import processing.core.PApplet; 6 | 7 | /* 8 | openKinect2 library for Processing 9 | Copyright (c) 2014 Thomas Sanchez Lengeling 10 | 11 | * Redistribution and use in source and binary forms, with or 12 | * without modification, are permitted provided that the following 13 | * conditions are met: 14 | * 15 | * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | 23 | openKinect2 library for Processing is free software: you can redistribute it and/or 24 | modify it under the terms of the GNU General Public License as published by 25 | the Free Software Foundation, either version 3 of the License, or 26 | (at your option) any later version. 27 | 28 | openKinect2 for Processing is distributed in the hope that it will be 29 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | GNU General Public License for more details. 32 | 33 | You should have received a copy of the GNU General Public License 34 | along with openKinect2 library for Processing. If not, see 35 | . 36 | */ 37 | 38 | public class Kinect2 extends Device{ 39 | 40 | public static PApplet parent; 41 | 42 | public Kinect2(PApplet _p) { 43 | super(_p); 44 | parent = _p; 45 | 46 | parent.registerMethod("dispose", this); 47 | } 48 | 49 | 50 | public void dispose() { 51 | System.out.println("EXIT"); 52 | stopDevice(); 53 | } 54 | 55 | 56 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/processing/LibraryPath.java: -------------------------------------------------------------------------------- 1 | /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 | 3 | /* 4 | Part of the Processing project - http://processing.org 5 | 6 | Copyright (c) 2011-12 Ben Fry and Casey Reas 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General 19 | Public License along with this library; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 21 | Boston, MA 02111-1307 USA 22 | */ 23 | 24 | package org.openkinect.processing; 25 | 26 | import java.io.File; 27 | import java.net.URISyntaxException; 28 | import java.net.URL; 29 | import java.security.CodeSource; 30 | 31 | import com.sun.jna.Platform; 32 | 33 | public class LibraryPath { 34 | // This method returns the folder inside which the gstreamer library folder 35 | // is located. 36 | public String get() { 37 | URL url = this.getClass().getResource("LibraryPath.class"); 38 | 39 | if (url != null) { 40 | // Convert URL to string, taking care of spaces represented by the "%20" 41 | // string. 42 | String path = url.toString().replace("%20", " "); 43 | int n0 = path.indexOf('/'); 44 | 45 | int n1 = -1; 46 | 47 | if (Platform.isLinux()) { 48 | return ""; 49 | } else { 50 | n1 = path.indexOf("openkinect_processing.jar"); 51 | if (Platform.isWindows()) { 52 | // In Windows, path string starts with "jar file/C:/..." 53 | // so the substring up to the first / is removed. 54 | n0++; 55 | } 56 | } 57 | 58 | if ((-1 < n0) && (-1 < n1)) { 59 | return path.substring(n0, n1); 60 | } else { 61 | return ""; 62 | } 63 | } 64 | return ""; 65 | } 66 | 67 | public String getDir(){ 68 | CodeSource codeSource = LibraryPath.class.getProtectionDomain().getCodeSource(); 69 | String jarDir = ""; 70 | try { 71 | File jarFile = new File(codeSource.getLocation().toURI().getPath()); 72 | jarDir = jarFile.getParentFile().getPath(); 73 | } catch (URISyntaxException e) { 74 | // TODO Auto-generated catch block 75 | e.printStackTrace(); 76 | } 77 | return jarDir; 78 | } 79 | 80 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/processing/RGBImage.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.processing; 2 | 3 | import java.nio.ByteBuffer; 4 | import processing.core.PImage; 5 | 6 | class RGBImage { 7 | 8 | static void data(ByteBuffer data, PImage img, boolean irMode, boolean mirrorMode) { 9 | if(mirrorMode){ //mirror enable 10 | if (irMode) { 11 | for(int y=0; y= minDepth && rawDepth[i] <= maxDepth) { 57 | depthImg.pixels[i] = color(255); 58 | } else { 59 | depthImg.pixels[i] = color(0); 60 | } 61 | } 62 | 63 | 64 | // Draw the thresholded image 65 | depthImg.updatePixels(); 66 | image(depthImg, kinect2.depthWidth, 0); 67 | 68 | fill(0); 69 | text("TILT: " + angle, 10, 20); 70 | text("THRESHOLD: [" + minDepth + ", " + maxDepth + "]", 10, 36); 71 | } 72 | 73 | // Adjust the angle and the depth threshold min and max 74 | public void keyPressed() { 75 | if (key == 'a') { 76 | minDepth = constrain(minDepth+10000, 0, maxDepth); 77 | } else if (key == 's') { 78 | minDepth = constrain(minDepth-10000, 0, maxDepth); 79 | } else if (key == 'z') { 80 | maxDepth = constrain(maxDepth+10000, minDepth, 1165952918); 81 | } else if (key =='x') { 82 | maxDepth = constrain(maxDepth-10000, minDepth, 1165952918); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/FrameTest.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.tests; 2 | 3 | import org.openkinect.processing.Kinect2; 4 | 5 | import processing.core.*; 6 | 7 | public class FrameTest extends PApplet{ 8 | 9 | Kinect2 openKinect2; 10 | 11 | public static void main(String[] args) { 12 | PApplet.main(new String[] { "org.openkinect.tests.FrameTest"}); 13 | } 14 | 15 | public void settings() { 16 | size(512*3, 424); 17 | } 18 | 19 | public void setup(){ 20 | openKinect2 = new Kinect2(this); 21 | 22 | openKinect2.initDepth(); 23 | openKinect2.initVideo(); 24 | openKinect2.initIR(); 25 | 26 | openKinect2.initDevice(); 27 | 28 | background(0); 29 | } 30 | 31 | 32 | public void draw(){ 33 | background(0); 34 | 35 | PImage depth = openKinect2.getDepthImage(); 36 | image(depth, 0, 0); 37 | 38 | PImage ir = openKinect2.getIrImage(); 39 | image(ir, 512, 0); 40 | 41 | PImage color = openKinect2.getVideoImage(); 42 | image(color, 512*2, 0, 512, 424); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/MultiKinectV1.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.tests; 2 | 3 | import org.openkinect.processing.*; 4 | 5 | import processing.core.*; 6 | 7 | public class MultiKinectV1 extends PApplet{ 8 | 9 | private Kinect kinect; 10 | 11 | public static void main(String[] args) { 12 | PApplet.main(new String[] { "org.openkinect.tests.MultiKinectV1"}); 13 | } 14 | 15 | public void settings() { 16 | size(512*3, 424*2); 17 | } 18 | 19 | 20 | public void setup(){ 21 | kinect = new Kinect(this); 22 | kinect.initVideo(); 23 | kinect.initDepth(); 24 | } 25 | 26 | 27 | public void draw(){ 28 | background(0); 29 | 30 | PImage depth = kinect.getDepthImage(); 31 | image(depth, 0, 0); 32 | 33 | PImage rgb = kinect.getVideoImage(); 34 | image(rgb, 512*2, 0, 512, 424); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/PointCloudOGL2.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.tests; 2 | 3 | import java.nio.FloatBuffer; 4 | 5 | import org.openkinect.processing.Kinect2; 6 | 7 | import processing.core.*; 8 | import processing.opengl.PGL; 9 | import processing.opengl.PShader; 10 | 11 | public class PointCloudOGL2 extends PApplet{ 12 | 13 | Kinect2 kinect2; 14 | 15 | PGL pgl; 16 | PShader sh; 17 | 18 | int vertLoc; 19 | 20 | public static void main(String[] args) { 21 | PApplet.main(new String[] { "org.openkinect.tests.PointCloudOGL2"}); 22 | } 23 | 24 | public void settings() { 25 | size(512*2, 424*2, P3D); 26 | } 27 | 28 | public void setup() { 29 | kinect2 = new Kinect2(this); 30 | // Start all data 31 | kinect2.initDepth(); 32 | kinect2.initIR(); 33 | kinect2.initDevice(); 34 | 35 | //System.out.println("Working Directory = " + System.getProperty("user.dir")); 36 | String dir = System.getProperty("user.dir")+"/src/org/openkinect/tests/data/"; 37 | sh = loadShader( dir+"frag.glsl", dir+"vert.glsl"); 38 | } 39 | 40 | 41 | public void draw() { 42 | background(0); 43 | //image(kinect2.getVideoImage(), 0, 0, width, height); 44 | image(kinect2.getDepthImage(), 0, 0, 320, 240); 45 | image(kinect2.getIrImage(), 0, 320, 320, 240); 46 | fill(255); 47 | 48 | FloatBuffer depthPositions = kinect2.getDepthBufferPositions(); 49 | 50 | pgl = beginPGL(); 51 | sh.bind(); 52 | 53 | vertLoc = pgl.getAttribLocation(sh.glProgram, "vertex"); 54 | 55 | //color for each POINT of the point cloud 56 | sh.set("fragColor", 1.0f, 1.0f, 1.0f, 1.0f); 57 | 58 | pgl.enableVertexAttribArray(vertLoc); 59 | 60 | //data size 61 | int vertData = kinect2.depthWidth * kinect2.depthHeight; 62 | 63 | //pgl.vertexAttribPointer(vertLoc, 3, PGL.FLOAT, false, 3 * (Float.SIZE/8), pointCloudBuffer); 64 | // FIXME: Processing 3 switched to using an offset as the last parameter 65 | // "error: incompatible types: FloatBuffer cannot be converted to int" 66 | //pgl.vertexAttribPointer(vertLoc, 3, PGL.FLOAT, false, 0, depthPositions); 67 | pgl.drawArrays(PGL.POINTS, 0, vertData); 68 | 69 | pgl.disableVertexAttribArray(vertLoc); 70 | 71 | sh.unbind(); 72 | endPGL(); 73 | 74 | 75 | text("Framerate: " + (int)(frameRate), 10, 515); 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/PointCloudTest.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.tests; 2 | 3 | import org.openkinect.processing.Kinect2; 4 | 5 | import processing.core.*; 6 | 7 | public class PointCloudTest extends PApplet{ 8 | 9 | Kinect2 kinect2; 10 | 11 | public static void main(String[] args) { 12 | PApplet.main(new String[] { "org.openkinect.tests.PointCloudTest"}); 13 | } 14 | 15 | public void settings() { 16 | size(512*2, 424*2, P3D); 17 | } 18 | 19 | public void setup() { 20 | kinect2 = new Kinect2(this); 21 | // Start all data 22 | kinect2.initDepth(); 23 | kinect2.initIR(); 24 | kinect2.initDevice(); 25 | } 26 | 27 | 28 | public void draw() { 29 | background(0); 30 | //image(kinect2.getVideoImage(), 0, 0, width, height); 31 | image(kinect2.getDepthImage(), 0, 0, 320, 240); 32 | image(kinect2.getIrImage(), 0, 320, 320, 240); 33 | fill(255); 34 | 35 | float [] positions = kinect2.getDepthToCameraPositions(); 36 | 37 | pushMatrix(); 38 | translate(width/2, height/2, 50); 39 | rotateY(3.1f); 40 | stroke(255); 41 | fill(255); 42 | beginShape(POINTS); 43 | for(int i = 0; i < 424; i++){ 44 | for(int j = 0; j < 512; j++){ 45 | int index = j + i*512; 46 | float x = positions[index*3 + 0]; 47 | float y = positions[index*3 + 1]; 48 | float z = positions[index*3 + 2]; 49 | vertex(x, y, z); 50 | } 51 | } 52 | endShape(); 53 | popMatrix(); 54 | 55 | text("Framerate: " + (int)(frameRate), 10, 515); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/RGBDepthTest2.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.tests; 2 | 3 | import org.openkinect.processing.Kinect2; 4 | 5 | import processing.core.*; 6 | 7 | public class RGBDepthTest2 extends PApplet{ 8 | 9 | Kinect2 kinect2; 10 | 11 | public static void main(String[] args) { 12 | PApplet.main(new String[] { "org.openkinect.tests.RGBDepthTest2"}); 13 | } 14 | 15 | public void settings() { 16 | size(512*2, 424*2, P2D); 17 | } 18 | 19 | public void setup() { 20 | kinect2 = new Kinect2(this); 21 | // Start all data 22 | kinect2.initVideo(); 23 | kinect2.initDepth(); 24 | kinect2.initIR(); 25 | kinect2.initRegistered(); 26 | kinect2.initDevice(); 27 | } 28 | 29 | 30 | public void draw() { 31 | background(0); 32 | //image(kinect2.getVideoImage(), 0, 0, width, height); 33 | image(kinect2.getDepthImage(), 0, 0); 34 | image(kinect2.getVideoImage(), kinect2.depthWidth, 0, kinect2.colorWidth*0.25f, kinect2.colorHeight*0.25f); 35 | image(kinect2.getIrImage(), 0, kinect2.depthHeight); 36 | image(kinect2.getRegisteredImage(), kinect2.depthWidth, kinect2.depthHeight); 37 | fill(255); 38 | text("Framerate: " + (int)(frameRate), 10, 515); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/RegisteredTest.java: -------------------------------------------------------------------------------- 1 | package org.openkinect.tests; 2 | 3 | import org.openkinect.processing.Kinect2; 4 | 5 | import processing.core.*; 6 | 7 | 8 | public class RegisteredTest extends PApplet{ 9 | 10 | Kinect2 openKinect2; 11 | 12 | public static void main(String[] args) { 13 | PApplet.main(new String[] { "org.openkinect.tests.RegisteredTest"}); 14 | } 15 | 16 | public void settings() { 17 | size(512*3, 424*2); 18 | } 19 | 20 | 21 | public void setup(){ 22 | openKinect2 = new Kinect2(this); 23 | openKinect2.initRegistered(); 24 | openKinect2.initDevice(); 25 | } 26 | 27 | 28 | public void draw(){ 29 | background(0); 30 | 31 | PImage depth = openKinect2.getDepthImage(); 32 | image(depth, 0, 0); 33 | 34 | PImage ir = openKinect2.getIrImage(); 35 | image(ir, 512, 0); 36 | 37 | PImage rgb = openKinect2.getVideoImage(); 38 | image(rgb, 512*2, 0, 512, 424); 39 | 40 | PImage unregistered = openKinect2.getUndistoredImage(); 41 | image(unregistered, 0, 424, 512, 424); 42 | 43 | PImage registered = openKinect2.getRegisteredImage(); 44 | image(registered, 512, 424, 512, 424); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/data/frag.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | precision mediump int; 4 | #endif 5 | 6 | varying vec4 vertColor; 7 | 8 | //input color 9 | uniform vec4 fragColor; 10 | 11 | void main() { 12 | 13 | //outputColor 14 | gl_FragColor = fragColor; 15 | } -------------------------------------------------------------------------------- /OpenKinect-Processing/src/org/openkinect/tests/data/vert.glsl: -------------------------------------------------------------------------------- 1 | uniform mat4 transform; 2 | 3 | attribute vec4 vertex; 4 | attribute vec4 color; 5 | 6 | varying vec4 vertColor; 7 | 8 | void main() { 9 | gl_Position = transform * vertex; 10 | vertColor = color; 11 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Open Kinect for Processing 2 | 3 | ![screenshot](https://pbs.twimg.com/media/CI8UO0RXAAApEX9.png:medium) 4 | 5 | This repository is for for using the Microsoft Kinect sensor with [Processing](http://processing.org). It uses the open source drivers from the [libfreenect](https://github.com/OpenKinect/libfreenect) and [libfreenect2](https://github.com/OpenKinect/libfreenect2) projects. 6 | 7 | ### Documentation and tutorial 8 | 9 | For more, read this [online tutorial](http://shiffman.net/p5/kinect/) or check out the [javadocs](http://shiffman.net/p5/kinect/reference). 10 | 11 | ## Kinect v1 Requirements 12 | - Kinect v1 (supported versions??) 13 | - Kinect v1 power adapter 14 | 15 | #### Linux 16 | 17 | Requirements? 18 | ```sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev``` 19 | 20 | #### Windows. 21 | 22 | - Use [Zadig](http://zadig.akeo.ie/) to install the libusbK driver for each device you wish to use. This includes installing the libusbK for all the kinect v1 drivers listed on Zadig GUI. 23 | - If you got the error message 'Isochronous transfer error: 1', you should try downgrade the libusbK using [Older Zadig Version](http://zadig.akeo.ie/downloads/zadig_2.0.1.exe) 24 | 25 | ## Kinect v2 Requirements 26 | 27 | - USB 3.0 Host Controller (NEC Corporation USB 3.0, Intel Chipset) 28 | - Minimum Mac OS X 10.9 29 | - Windows 8 64 bit support 30 | - Kinect v2 31 | 32 | #### Kinect v2 additional software 33 | - For Windows 8, Follow the the [installation of the libusk driver.](https://github.com/OpenKinect/libfreenect2#libusbk-driver) 34 | - First install the Kinect v2 Windows SDK then change the USB 3.0 drivers properties to libusbK using Zadig. 35 | - No longer need to external install [Turbo Jpeg for Mac](http://sourceforge.net/projects/libjpeg-turbo/). 36 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.a -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libTurboJpeg/lib/osx/libturbojpeg.dylib -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libusb/include/libusb/hotplug.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */ 2 | /* 3 | * Hotplug support for libusbx 4 | * Copyright © 2012-2013 Nathan Hjelm 5 | * Copyright © 2012-2013 Peter Stuge 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #if !defined(USBI_HOTPLUG_H) 23 | #define USBI_HOTPLUG_H 24 | 25 | #ifndef LIBUSBI_H 26 | #include "libusbi.h" 27 | #endif 28 | 29 | /** \ingroup hotplug 30 | * The hotplug callback structure. The user populates this structure with 31 | * libusb_hotplug_prepare_callback() and then calls libusb_hotplug_register_callback() 32 | * to receive notification of hotplug events. 33 | */ 34 | struct libusb_hotplug_callback { 35 | /** Context this callback is associated with */ 36 | struct libusb_context *ctx; 37 | 38 | /** Vendor ID to match or LIBUSB_HOTPLUG_MATCH_ANY */ 39 | int vendor_id; 40 | 41 | /** Product ID to match or LIBUSB_HOTPLUG_MATCH_ANY */ 42 | int product_id; 43 | 44 | /** Device class to match or LIBUSB_HOTPLUG_MATCH_ANY */ 45 | int dev_class; 46 | 47 | /** Hotplug callback flags */ 48 | libusb_hotplug_flag flags; 49 | 50 | /** Event(s) that will trigger this callback */ 51 | libusb_hotplug_event events; 52 | 53 | /** Callback function to invoke for matching event/device */ 54 | libusb_hotplug_callback_fn cb; 55 | 56 | /** Handle for this callback (used to match on deregister) */ 57 | libusb_hotplug_callback_handle handle; 58 | 59 | /** User data that will be passed to the callback function */ 60 | void *user_data; 61 | 62 | /** Callback is marked for deletion */ 63 | int needs_free; 64 | 65 | /** List this callback is registered in (ctx->hotplug_cbs) */ 66 | struct list_head list; 67 | }; 68 | 69 | typedef struct libusb_hotplug_callback libusb_hotplug_callback; 70 | 71 | struct libusb_hotplug_message { 72 | libusb_hotplug_event event; 73 | struct libusb_device *device; 74 | }; 75 | 76 | typedef struct libusb_hotplug_message libusb_hotplug_message; 77 | 78 | void usbi_hotplug_deregister_all(struct libusb_context *ctx); 79 | void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev, 80 | libusb_hotplug_event event); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libusb/include/libusb/os/poll_posix.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUSB_POLL_POSIX_H 2 | #define LIBUSB_POLL_POSIX_H 3 | 4 | #define usbi_write write 5 | #define usbi_read read 6 | #define usbi_close close 7 | #define usbi_poll poll 8 | 9 | int usbi_pipe(int pipefd[2]); 10 | 11 | #endif /* LIBUSB_POLL_POSIX_H */ 12 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libusb/include/libusb/os/threads_posix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libusbx synchronization using POSIX Threads 3 | * 4 | * Copyright © 2010 Peter Stuge 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef LIBUSB_THREADS_POSIX_H 22 | #define LIBUSB_THREADS_POSIX_H 23 | 24 | #include 25 | 26 | #define usbi_mutex_static_t pthread_mutex_t 27 | #define USBI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER 28 | #define usbi_mutex_static_lock pthread_mutex_lock 29 | #define usbi_mutex_static_unlock pthread_mutex_unlock 30 | 31 | #define usbi_mutex_t pthread_mutex_t 32 | #define usbi_mutex_init pthread_mutex_init 33 | #define usbi_mutex_lock pthread_mutex_lock 34 | #define usbi_mutex_unlock pthread_mutex_unlock 35 | #define usbi_mutex_trylock pthread_mutex_trylock 36 | #define usbi_mutex_destroy pthread_mutex_destroy 37 | 38 | #define usbi_cond_t pthread_cond_t 39 | #define usbi_cond_init pthread_cond_init 40 | #define usbi_cond_wait pthread_cond_wait 41 | #define usbi_cond_timedwait pthread_cond_timedwait 42 | #define usbi_cond_broadcast pthread_cond_broadcast 43 | #define usbi_cond_destroy pthread_cond_destroy 44 | #define usbi_cond_signal pthread_cond_signal 45 | 46 | extern int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr); 47 | 48 | int usbi_get_tid(void); 49 | 50 | #endif /* LIBUSB_THREADS_POSIX_H */ 51 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libusb/include/libusb/version.h: -------------------------------------------------------------------------------- 1 | /* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */ 2 | #include "version_nano.h" 3 | #ifndef LIBUSB_MAJOR 4 | #define LIBUSB_MAJOR 1 5 | #endif 6 | #ifndef LIBUSB_MINOR 7 | #define LIBUSB_MINOR 0 8 | #endif 9 | #ifndef LIBUSB_MICRO 10 | #define LIBUSB_MICRO 17 11 | #endif 12 | #ifndef LIBUSB_NANO 13 | #define LIBUSB_NANO 0 14 | #endif 15 | /* LIBUSB_RC is the release candidate suffix. Should normally be empty. */ 16 | #ifndef LIBUSB_RC 17 | #define LIBUSB_RC "" 18 | #endif 19 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libusb/include/libusb/version_nano.h: -------------------------------------------------------------------------------- 1 | #define LIBUSB_NANO 10830 2 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libusb/lib/msvc/libusb-1.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libusb/lib/msvc/libusb-1.0.dll -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/libusb/lib/osx/usb-1.0.0-superspeed.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/libs/libusb/lib/osx/usb-1.0.0-superspeed.a -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef LIBFREENECT2_CONFIG_H 28 | #define LIBFREENECT2_CONFIG_H 29 | 30 | #ifdef _MSC_VER 31 | #define LIBFREENECT2_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) ) 32 | #else 33 | #define LIBFREENECT2_PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) 34 | #endif 35 | 36 | #ifdef _WIN32 37 | #define LIBFREENECT2_API __declspec(dllexport) 38 | #else 39 | #define LIBFREENECT2_API 40 | #endif 41 | 42 | #define LIBFREENECT2_WITH_OPENGL_SUPPORT 43 | 44 | #define LIBFREENECT2_WITH_OPENCL_SUPPORT 45 | 46 | /* #undef LIBFREENECT2_THREADING_STDLIB */ 47 | 48 | #define LIBFREENECT2_THREADING_TINYTHREAD 49 | 50 | #endif // LIBFREENECT2_CONFIG_H 51 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef LIBFREENECT2_CONFIG_H 28 | #define LIBFREENECT2_CONFIG_H 29 | 30 | #ifdef _MSC_VER 31 | #define LIBFREENECT2_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) ) 32 | #else 33 | #define LIBFREENECT2_PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) 34 | #endif 35 | 36 | #ifdef _WIN32 37 | #define LIBFREENECT2_API __declspec(dllexport) 38 | #else 39 | #define LIBFREENECT2_API 40 | #endif 41 | 42 | #cmakedefine LIBFREENECT2_WITH_OPENGL_SUPPORT 43 | 44 | #cmakedefine LIBFREENECT2_WITH_OPENCL_SUPPORT 45 | 46 | #cmakedefine LIBFREENECT2_THREADING_STDLIB 47 | 48 | #cmakedefine LIBFREENECT2_THREADING_TINYTHREAD 49 | 50 | #endif // LIBFREENECT2_CONFIG_H 51 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/data_callback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | 28 | #ifndef DATA_CALLBACK_H_ 29 | #define DATA_CALLBACK_H_ 30 | 31 | #include 32 | #include 33 | 34 | namespace libfreenect2 35 | { 36 | 37 | class LIBFREENECT2_API DataCallback 38 | { 39 | public: 40 | virtual void onDataReceived(unsigned char *buffer, size_t n) = 0; 41 | }; 42 | 43 | } // namespace libfreenect2 44 | 45 | #endif // DATA_CALLBACK_H_ 46 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/depth_packet_stream_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef DEPTH_PACKET_STREAM_PARSER_H_ 28 | #define DEPTH_PACKET_STREAM_PARSER_H_ 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | namespace libfreenect2 41 | { 42 | 43 | LIBFREENECT2_PACK(struct LIBFREENECT2_API DepthSubPacketFooter 44 | { 45 | uint32_t magic0; 46 | uint32_t magic1; 47 | uint32_t timestamp; 48 | uint32_t sequence; 49 | uint32_t subsequence; 50 | uint32_t length; 51 | uint32_t fields[32]; 52 | }); 53 | 54 | class LIBFREENECT2_API DepthPacketStreamParser : public DataCallback 55 | { 56 | public: 57 | DepthPacketStreamParser(); 58 | virtual ~DepthPacketStreamParser(); 59 | 60 | void setPacketProcessor(libfreenect2::BaseDepthPacketProcessor *processor); 61 | 62 | virtual void onDataReceived(unsigned char* buffer, size_t length); 63 | private: 64 | libfreenect2::BaseDepthPacketProcessor *processor_; 65 | 66 | libfreenect2::DoubleBuffer buffer_; 67 | libfreenect2::Buffer work_buffer_; 68 | 69 | uint32_t current_sequence_; 70 | uint32_t current_subsequence_; 71 | }; 72 | 73 | } /* namespace libfreenect2 */ 74 | #endif /* DEPTH_PACKET_STREAM_PARSER_H_ */ 75 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/double_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef DOUBLE_BUFFER_H_ 28 | #define DOUBLE_BUFFER_H_ 29 | 30 | #include 31 | #include 32 | 33 | namespace libfreenect2 34 | { 35 | 36 | struct LIBFREENECT2_API Buffer 37 | { 38 | public: 39 | size_t capacity; 40 | size_t length; 41 | unsigned char* data; 42 | }; 43 | 44 | class LIBFREENECT2_API DoubleBuffer 45 | { 46 | public: 47 | DoubleBuffer(); 48 | virtual ~DoubleBuffer(); 49 | 50 | void allocate(size_t buffer_size); 51 | 52 | void swap(); 53 | 54 | Buffer& front(); 55 | 56 | Buffer& back(); 57 | private: 58 | Buffer buffer_[2]; 59 | unsigned char front_buffer_index_; 60 | 61 | unsigned char* buffer_data_; 62 | }; 63 | 64 | } /* namespace libfreenect2 */ 65 | #endif /* DOUBLE_BUFFER_H_ */ 66 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/frame_listener.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef FRAME_LISTENER_HPP_ 28 | #define FRAME_LISTENER_HPP_ 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | namespace libfreenect2 35 | { 36 | 37 | struct LIBFREENECT2_API Frame 38 | { 39 | enum Type 40 | { 41 | Color = 1, 42 | Ir = 2, 43 | Depth = 4 44 | }; 45 | 46 | uint32_t timestamp; 47 | uint32_t sequence; 48 | size_t width, height, bytes_per_pixel; 49 | unsigned char* data; 50 | 51 | Frame(size_t width, size_t height, size_t bytes_per_pixel) : 52 | width(width), 53 | height(height), 54 | bytes_per_pixel(bytes_per_pixel) 55 | { 56 | data = new unsigned char[width * height * bytes_per_pixel]; 57 | } 58 | 59 | ~Frame() 60 | { 61 | delete[] data; 62 | } 63 | }; 64 | 65 | class LIBFREENECT2_API FrameListener 66 | { 67 | public: 68 | virtual ~FrameListener(); 69 | 70 | virtual bool onNewFrame(Frame::Type type, Frame *frame) = 0; 71 | }; 72 | 73 | } /* namespace libfreenect2 */ 74 | #endif /* FRAME_LISTENER_HPP_ */ 75 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/frame_listener_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef FRAME_LISTENER_IMPL_H_ 28 | #define FRAME_LISTENER_IMPL_H_ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | namespace libfreenect2 36 | { 37 | 38 | typedef std::map FrameMap; 39 | 40 | class SyncMultiFrameListenerImpl; 41 | 42 | class LIBFREENECT2_API SyncMultiFrameListener : public FrameListener 43 | { 44 | public: 45 | SyncMultiFrameListener(unsigned int frame_types); 46 | virtual ~SyncMultiFrameListener(); 47 | 48 | bool hasNewFrame() const; 49 | 50 | #ifdef LIBFREENECT2_THREADING_STDLIB 51 | bool waitForNewFrame(FrameMap &frame, int milliseconds); 52 | #endif // LIBFREENECT2_THREADING_STDLIB 53 | // for now the caller is responsible to release the frames when he is done 54 | void waitForNewFrame(FrameMap &frame); 55 | 56 | void release(FrameMap &frame); 57 | 58 | virtual bool onNewFrame(Frame::Type type, Frame *frame); 59 | private: 60 | SyncMultiFrameListenerImpl *impl_; 61 | }; 62 | 63 | } /* namespace libfreenect2 */ 64 | #endif /* FRAME_LISTENER_IMPL_H_ */ 65 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/packet_processor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef PACKET_PROCESSOR_H_ 28 | #define PACKET_PROCESSOR_H_ 29 | 30 | namespace libfreenect2 31 | { 32 | 33 | template 34 | class PacketProcessor 35 | { 36 | public: 37 | virtual ~PacketProcessor() {} 38 | 39 | virtual bool ready() { return true; } 40 | virtual void process(const PacketT &packet) = 0; 41 | }; 42 | 43 | template 44 | class NoopPacketProcessor : public PacketProcessor 45 | { 46 | public: 47 | NoopPacketProcessor() {} 48 | virtual ~NoopPacketProcessor() {} 49 | 50 | virtual void process(const PacketT &packet) {} 51 | }; 52 | 53 | template 54 | PacketProcessor *noopProcessor() 55 | { 56 | static NoopPacketProcessor noop_processor_; 57 | return &noop_processor_; 58 | } 59 | 60 | } /* namespace libfreenect2 */ 61 | #endif /* PACKET_PROCESSOR_H_ */ 62 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/protocol/command_transaction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2011 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef COMMAND_TRANSACTION_H_ 28 | #define COMMAND_TRANSACTION_H_ 29 | 30 | #include 31 | #include 32 | 33 | namespace libfreenect2 34 | { 35 | namespace protocol 36 | { 37 | 38 | class CommandTransaction 39 | { 40 | public: 41 | static const int ResponseCompleteLength = 16; 42 | static const uint32_t ResponseCompleteMagic = 0x0A6FE000; 43 | 44 | enum ResultCode 45 | { 46 | Success, 47 | Error 48 | }; 49 | 50 | struct Result 51 | { 52 | ResultCode code; 53 | 54 | unsigned char *data; 55 | int capacity, length; 56 | 57 | Result(); 58 | ~Result(); 59 | 60 | void allocate(size_t size); 61 | void deallocate(); 62 | bool notSuccessfulThenDeallocate(); 63 | }; 64 | 65 | CommandTransaction(libusb_device_handle *handle, int inbound_endpoint, int outbound_endpoint); 66 | ~CommandTransaction(); 67 | 68 | void execute(const CommandBase& command, Result& result); 69 | private: 70 | libusb_device_handle *handle_; 71 | int inbound_endpoint_, outbound_endpoint_, timeout_; 72 | Result response_complete_result_; 73 | 74 | ResultCode send(const CommandBase& command); 75 | 76 | void receive(Result& result); 77 | 78 | bool isResponseCompleteResult(Result& result, uint32_t sequence); 79 | }; 80 | 81 | } /* namespace protocol */ 82 | } /* namespace libfreenect2 */ 83 | #endif /* COMMAND_TRANSACTION_H_ */ 84 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/registration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef REGISTRATION_H_ 28 | #define REGISTRATION_H_ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | namespace libfreenect2 36 | { 37 | 38 | class LIBFREENECT2_API Registration 39 | { 40 | public: 41 | Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Device::ColorCameraParams rgb_p); 42 | 43 | // undistort/register a single depth data point 44 | void apply(int dx, int dy, float dz, float& cx, float &cy) const; 45 | 46 | // undistort/register a whole image 47 | void apply(const Frame* rgb, const Frame* depth, Frame* undistorted, Frame* registered, const bool enable_filter = true) const; 48 | 49 | private: 50 | void distort(int mx, int my, float& dx, float& dy) const; 51 | void depth_to_color(float mx, float my, float& rx, float& ry) const; 52 | 53 | Freenect2Device::IrCameraParams depth; 54 | Freenect2Device::ColorCameraParams color; 55 | 56 | int distort_map[512 * 424]; 57 | float depth_to_color_map_x[512 * 424]; 58 | float depth_to_color_map_y[512 * 424]; 59 | int depth_to_color_map_yi[512 * 424]; 60 | 61 | const int filter_width_half; 62 | const int filter_height_half; 63 | const float filter_tolerance; 64 | }; 65 | 66 | } /* namespace libfreenect2 */ 67 | #endif /* REGISTRATION_H_ */ 68 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef RESOURCE_H_ 28 | #define RESOURCE_H_ 29 | 30 | #include 31 | 32 | namespace libfreenect2 33 | { 34 | 35 | bool loadResource(const std::string &name, unsigned char const**data, size_t *length); 36 | bool loadBufferFromResources(const std::string &filename, unsigned char *buffer, const size_t n); 37 | 38 | } /* namespace libfreenect2 */ 39 | #endif /* RESOURCE_H_ */ 40 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/rgb_packet_processor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef RGB_PACKET_PROCESSOR_H_ 28 | #define RGB_PACKET_PROCESSOR_H_ 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace libfreenect2 38 | { 39 | 40 | struct LIBFREENECT2_API RgbPacket 41 | { 42 | uint32_t sequence; 43 | 44 | uint32_t timestamp; 45 | unsigned char *jpeg_buffer; 46 | size_t jpeg_buffer_length; 47 | }; 48 | 49 | typedef PacketProcessor BaseRgbPacketProcessor; 50 | 51 | class LIBFREENECT2_API RgbPacketProcessor : public BaseRgbPacketProcessor 52 | { 53 | public: 54 | RgbPacketProcessor(); 55 | virtual ~RgbPacketProcessor(); 56 | 57 | virtual void setFrameListener(libfreenect2::FrameListener *listener); 58 | protected: 59 | libfreenect2::FrameListener *listener_; 60 | }; 61 | 62 | class LIBFREENECT2_API DumpRgbPacketProcessor : public RgbPacketProcessor 63 | { 64 | public: 65 | DumpRgbPacketProcessor(); 66 | virtual ~DumpRgbPacketProcessor(); 67 | protected: 68 | virtual void process(const libfreenect2::RgbPacket &packet); 69 | }; 70 | 71 | class TurboJpegRgbPacketProcessorImpl; 72 | 73 | class LIBFREENECT2_API TurboJpegRgbPacketProcessor : public RgbPacketProcessor 74 | { 75 | public: 76 | TurboJpegRgbPacketProcessor(); 77 | virtual ~TurboJpegRgbPacketProcessor(); 78 | protected: 79 | virtual void process(const libfreenect2::RgbPacket &packet); 80 | private: 81 | TurboJpegRgbPacketProcessorImpl *impl_; 82 | }; 83 | 84 | } /* namespace libfreenect2 */ 85 | #endif /* RGB_PACKET_PROCESSOR_H_ */ 86 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/rgb_packet_stream_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef RGB_PACKET_STREAM_PARSER_H_ 28 | #define RGB_PACKET_STREAM_PARSER_H_ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | namespace libfreenect2 39 | { 40 | 41 | class LIBFREENECT2_API RgbPacketStreamParser : public DataCallback 42 | { 43 | public: 44 | RgbPacketStreamParser(); 45 | virtual ~RgbPacketStreamParser(); 46 | 47 | void setPacketProcessor(BaseRgbPacketProcessor *processor); 48 | 49 | virtual void onDataReceived(unsigned char* buffer, size_t length); 50 | private: 51 | libfreenect2::DoubleBuffer buffer_; 52 | BaseRgbPacketProcessor *processor_; 53 | }; 54 | 55 | } /* namespace libfreenect2 */ 56 | #endif /* RGB_PACKET_STREAM_PARSER_H_ */ 57 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/threading.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef THREADING_H_ 28 | #define THREADING_H_ 29 | 30 | #include 31 | 32 | #ifdef LIBFREENECT2_THREADING_STDLIB 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #define WAIT_CONDITION(var, mutex, lock) var.wait(lock); 40 | 41 | namespace libfreenect2 42 | { 43 | 44 | typedef std::thread thread; 45 | typedef std::mutex mutex; 46 | typedef std::lock_guard lock_guard; 47 | typedef std::unique_lock unique_lock; 48 | typedef std::condition_variable condition_variable; 49 | 50 | namespace chrono 51 | { 52 | using namespace std::chrono; 53 | } 54 | 55 | namespace this_thread 56 | { 57 | using namespace std::this_thread; 58 | } 59 | 60 | } /* libfreenect2 */ 61 | 62 | #endif 63 | 64 | #ifdef LIBFREENECT2_THREADING_TINYTHREAD 65 | 66 | #include 67 | 68 | // TODO: work around for tinythread incompatibility 69 | #define WAIT_CONDITION(var, mutex, lock) var.wait(mutex); 70 | 71 | namespace libfreenect2 72 | { 73 | 74 | typedef tthread::thread thread; 75 | typedef tthread::mutex mutex; 76 | typedef tthread::lock_guard lock_guard; 77 | // TODO: this is not optimal 78 | typedef tthread::lock_guard unique_lock; 79 | typedef tthread::condition_variable condition_variable; 80 | 81 | namespace chrono 82 | { 83 | using namespace tthread::chrono; 84 | } 85 | 86 | namespace this_thread 87 | { 88 | using namespace tthread::this_thread; 89 | } 90 | 91 | } /* libfreenect2 */ 92 | 93 | #endif 94 | 95 | 96 | #endif /* THREADING_H_ */ 97 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/include/libfreenect2/usb/event_loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef EVENT_LOOP_H_ 28 | #define EVENT_LOOP_H_ 29 | 30 | #include 31 | 32 | namespace libfreenect2 33 | { 34 | namespace usb 35 | { 36 | 37 | class EventLoop 38 | { 39 | public: 40 | EventLoop(); 41 | virtual ~EventLoop(); 42 | 43 | void start(void *usb_context); 44 | 45 | void stop(); 46 | private: 47 | bool shutdown_; 48 | libfreenect2::thread *thread_; 49 | void *usb_context_; 50 | 51 | static void static_execute(void *cookie); 52 | void execute(); 53 | }; 54 | 55 | } /* namespace usb */ 56 | } /* namespace libfreenect2 */ 57 | #endif /* EVENT_LOOP_H_ */ 58 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/src/double_buffer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #include 28 | 29 | namespace libfreenect2 30 | { 31 | 32 | DoubleBuffer::DoubleBuffer() : 33 | front_buffer_index_(0), 34 | buffer_data_(0) 35 | { 36 | } 37 | 38 | DoubleBuffer::~DoubleBuffer() 39 | { 40 | if(buffer_data_ != 0) 41 | { 42 | buffer_[0].data = 0; 43 | buffer_[1].data = 0; 44 | delete[] buffer_data_; 45 | } 46 | } 47 | 48 | void DoubleBuffer::allocate(size_t buffer_size) 49 | { 50 | size_t total_buffer_size = 2 * buffer_size; 51 | buffer_data_ = new unsigned char[total_buffer_size]; 52 | 53 | buffer_[0].capacity = buffer_size; 54 | buffer_[0].length = 0; 55 | buffer_[0].data = buffer_data_; 56 | 57 | buffer_[1].capacity = buffer_size; 58 | buffer_[1].length = 0; 59 | buffer_[1].data = buffer_data_ + buffer_size; 60 | } 61 | 62 | void DoubleBuffer::swap() 63 | { 64 | front_buffer_index_ = (front_buffer_index_ + 1) & 1; 65 | } 66 | 67 | Buffer& DoubleBuffer::front() 68 | { 69 | return buffer_[front_buffer_index_ & 1]; 70 | } 71 | 72 | Buffer& DoubleBuffer::back() 73 | { 74 | return buffer_[(front_buffer_index_ + 1) & 1]; 75 | } 76 | 77 | } /* namespace libfreenect2 */ 78 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/src/event_loop.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #include 28 | 29 | #include 30 | #ifdef _WIN32 31 | #include 32 | #else 33 | #include 34 | #endif 35 | 36 | namespace libfreenect2 37 | { 38 | namespace usb 39 | { 40 | 41 | void EventLoop::static_execute(void *cookie) 42 | { 43 | static_cast(cookie)->execute(); 44 | } 45 | 46 | EventLoop::EventLoop() : 47 | shutdown_(false), 48 | thread_(0), 49 | usb_context_(0) 50 | { 51 | } 52 | 53 | EventLoop::~EventLoop() 54 | { 55 | stop(); 56 | } 57 | 58 | void EventLoop::start(void *usb_context) 59 | { 60 | if(thread_ == 0) 61 | { 62 | shutdown_ = false; 63 | usb_context_ = usb_context; 64 | thread_ = new libfreenect2::thread(&EventLoop::static_execute, this); 65 | } 66 | } 67 | 68 | void EventLoop::stop() 69 | { 70 | if(thread_ != 0) 71 | { 72 | shutdown_ = true; 73 | thread_->join(); 74 | delete thread_; 75 | thread_ = 0; 76 | usb_context_ = 0; 77 | } 78 | } 79 | 80 | void EventLoop::execute() 81 | { 82 | timeval t; 83 | t.tv_sec = 0; 84 | t.tv_usec = 100000; 85 | 86 | while(!shutdown_) 87 | { 88 | libusb_handle_events_timeout_completed(reinterpret_cast(usb_context_), &t, 0); 89 | } 90 | } 91 | 92 | } /* namespace usb */ 93 | } /* namespace libfreenect2 */ 94 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/src/generate_resources.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | void dumpFile(const std::string& filename) 33 | { 34 | using namespace std; 35 | 36 | ifstream f(filename.c_str(), ios::binary); 37 | 38 | unsigned char buffer[1024]; 39 | 40 | while(!f.eof()) 41 | { 42 | f.read(reinterpret_cast(buffer), sizeof(buffer)); 43 | size_t n = f.gcount(); 44 | 45 | if(n == 0) break; 46 | 47 | cout << hex << setw(2) << setfill('0') << " "; 48 | for(size_t i = 0; i < n; ++i) 49 | { 50 | cout << "0x" << int(buffer[i]) << ", "; 51 | } 52 | cout << endl; 53 | } 54 | cout << dec; 55 | } 56 | 57 | int main(int argc, char **argv) 58 | { 59 | if(argc < 2) return -1; 60 | 61 | using namespace std; 62 | 63 | string basefolder(argv[1]); 64 | 65 | for(int i = 2; i < argc; ++i) 66 | { 67 | cout << "unsigned char resource" << (i - 2) << "[] = {" << endl; 68 | dumpFile(basefolder + "/" + argv[i]); 69 | cout << "};" << endl; 70 | } 71 | 72 | cout << "ResourceDescriptor resource_descriptors[] = {" << endl; 73 | 74 | for(int i = 2; i < argc; ++i) 75 | { 76 | cout << " { \"" << argv[i] << "\", resource" << (i - 2) << ", " << "sizeof(resource" << (i - 2) << ") }," << endl; 77 | } 78 | 79 | cout << "};" << endl; 80 | cout << "int resource_descriptors_length = " << (argc - 2) << ";" << endl; 81 | 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/src/resource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #include 28 | 29 | 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | namespace libfreenect2 36 | { 37 | 38 | struct ResourceDescriptor 39 | { 40 | const char *filename; 41 | const unsigned char *data; 42 | size_t length; 43 | }; 44 | 45 | #define RESOURCES_INC 46 | 47 | #ifdef RESOURCES_INC 48 | #include "resources.inc.h" 49 | #else 50 | ResourceDescriptor resource_descriptors[] = {}; 51 | #endif 52 | 53 | bool loadResource(const std::string &name, unsigned char const**data, size_t *length) 54 | { 55 | bool result = false; 56 | 57 | for(int i = 0; i < resource_descriptors_length; ++i) 58 | { 59 | if(name.compare(resource_descriptors[i].filename) == 0) 60 | { 61 | *data = resource_descriptors[i].data; 62 | *length = resource_descriptors[i].length; 63 | result = true; 64 | break; 65 | } 66 | } 67 | return result; 68 | } 69 | 70 | bool loadBufferFromResources(const std::string &filename, unsigned char *buffer, const size_t n) 71 | { 72 | size_t length = 0; 73 | const unsigned char *data = NULL; 74 | 75 | if(!loadResource(filename, &data, &length)) 76 | { 77 | std::cerr << "loadBufferFromResources: failed to load resource: " << filename << std::endl; 78 | return false; 79 | } 80 | 81 | if(length != n) 82 | { 83 | std::cerr << "loadBufferFromResources: wrong size of resource: " << filename << std::endl; 84 | return false; 85 | } 86 | 87 | memcpy(buffer, data, length); 88 | return true; 89 | } 90 | 91 | } /* namespace libfreenect2 */ 92 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/src/rgb_packet_processor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | namespace libfreenect2 34 | { 35 | 36 | RgbPacketProcessor::RgbPacketProcessor() : 37 | listener_(0) 38 | { 39 | } 40 | 41 | RgbPacketProcessor::~RgbPacketProcessor() 42 | { 43 | } 44 | 45 | void RgbPacketProcessor::setFrameListener(libfreenect2::FrameListener *listener) 46 | { 47 | listener_ = listener; 48 | } 49 | 50 | DumpRgbPacketProcessor::DumpRgbPacketProcessor() 51 | { 52 | } 53 | 54 | DumpRgbPacketProcessor::~DumpRgbPacketProcessor() 55 | { 56 | } 57 | 58 | void DumpRgbPacketProcessor::process(const RgbPacket &packet) 59 | { 60 | //std::stringstream name; 61 | //name << packet->sequence << "_" << packet->unknown0 << "_" << jpeg_buffer_length << ".jpeg"; 62 | // 63 | //std::ofstream file(name.str().c_str()); 64 | //file.write(reinterpret_cast(packet->jpeg_buffer), jpeg_buffer_length); 65 | //file.close(); 66 | } 67 | 68 | } /* namespace libfreenect2 */ 69 | -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/src/shader/debug.fs: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform sampler2DRect Data; 4 | 5 | in VertexData { 6 | vec2 TexCoord; 7 | } FragmentIn; 8 | 9 | layout(location = 0) out vec4 Color; 10 | 11 | void main(void) 12 | { 13 | ivec2 uv = ivec2(FragmentIn.TexCoord.x, FragmentIn.TexCoord.y); 14 | 15 | Color = texelFetch(Data, uv); 16 | } -------------------------------------------------------------------------------- /build_openKinect2/C++/libs/protonect/src/shader/default.vs: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | in vec2 Position; 4 | in vec2 TexCoord; 5 | 6 | out VertexData { 7 | vec2 TexCoord; 8 | } VertexOut; 9 | 10 | void main(void) 11 | { 12 | gl_Position = vec4(Position, 0.0, 1.0); 13 | VertexOut.TexCoord = TexCoord; 14 | } -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/Debug/libJNIlibfreenect2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/vc2013/Debug/libJNIlibfreenect2.dll -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2013 for Windows Desktop 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libJNIlibfreenect2", "libJNIlibfreenect2\libJNIlibfreenect2.vcxproj", "{B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Debug|Win32.Build.0 = Debug|Win32 18 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Debug|x64.ActiveCfg = Debug|x64 19 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Debug|x64.Build.0 = Debug|x64 20 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Release|Win32.ActiveCfg = Release|Win32 21 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Release|Win32.Build.0 = Release|Win32 22 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Release|x64.ActiveCfg = Release|x64 23 | {B8DA0CC8-A71A-4EF8-A7A1-4BF9D4B5A999}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : libJNIlibfreenect2 Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this libJNIlibfreenect2 DLL for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your libJNIlibfreenect2 application. 9 | 10 | 11 | libJNIlibfreenect2.vcxproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | libJNIlibfreenect2.vcxproj.filters 18 | This is the filters file for VC++ projects generated using an Application Wizard. 19 | It contains information about the association between the files in your project 20 | and the filters. This association is used in the IDE to show grouping of files with 21 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 22 | "Source Files" filter). 23 | 24 | libJNIlibfreenect2.cpp 25 | This is the main DLL source file. 26 | 27 | When created, this DLL does not export any symbols. As a result, it 28 | will not produce a .lib file when it is built. If you wish this project 29 | to be a project dependency of some other project, you will either need to 30 | add code to export some symbols from the DLL so that an export library 31 | will be produced, or you can set the Ignore Input Library property to Yes 32 | on the General propert page of the Linker folder in the project's Property 33 | Pages dialog box. 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | Other standard files: 37 | 38 | StdAfx.h, StdAfx.cpp 39 | These files are used to build a precompiled header (PCH) file 40 | named libJNIlibfreenect2.pch and a precompiled types file named StdAfx.obj. 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | Other notes: 44 | 45 | AppWizard uses "TODO:" comments to indicate parts of the source code you 46 | should add to or customize. 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2/libJNIlibfreenect2.cpp: -------------------------------------------------------------------------------- 1 | // libJNIlibfreenect2.cpp : Defines the exported functions for the DLL application. 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | 7 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2/libJNIlibfreenect2.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // libJNIlibfreenect2.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/libJNIlibfreenect2/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/x64/Release/libJNILibfreenect2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/vc2013/x64/Release/libJNILibfreenect2.dll -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/x64/Release/libJNILibfreenect2.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/vc2013/x64/Release/libJNILibfreenect2.exp -------------------------------------------------------------------------------- /build_openKinect2/C++/vc2013/x64/Release/libJNILibfreenect2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/vc2013/x64/Release/libJNILibfreenect2.lib -------------------------------------------------------------------------------- /build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj/project.xcworkspace/xcshareddata/JNILibfreenect2.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 389166F2-24D7-4A1D-9B77-AE3A08EF9B22 9 | IDESourceControlProjectName 10 | JNILibfreenect2 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 1104B1852A18E28A16521C44CCB6A0ED65579468 14 | https://github.com/shiffman/OpenKinect-for-Processing 15 | 49AA77055867AAE9A10721EEA59C590D1EAEDB9C 16 | github.com:ThomasLengeling/libfreenect2-for-processing.git 17 | 18 | IDESourceControlProjectPath 19 | build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj 20 | IDESourceControlProjectRelativeInstallPathDictionary 21 | 22 | 1104B1852A18E28A16521C44CCB6A0ED65579468 23 | ../../../../.. 24 | 49AA77055867AAE9A10721EEA59C590D1EAEDB9C 25 | ../../../../../../openKinect2 26 | 27 | IDESourceControlProjectURL 28 | https://github.com/shiffman/OpenKinect-for-Processing 29 | IDESourceControlProjectVersion 30 | 111 31 | IDESourceControlProjectWCCIdentifier 32 | 1104B1852A18E28A16521C44CCB6A0ED65579468 33 | IDESourceControlProjectWCConfigurations 34 | 35 | 36 | IDESourceControlRepositoryExtensionIdentifierKey 37 | public.vcs.git 38 | IDESourceControlWCCIdentifierKey 39 | 1104B1852A18E28A16521C44CCB6A0ED65579468 40 | IDESourceControlWCCName 41 | openKinect 42 | 43 | 44 | IDESourceControlRepositoryExtensionIdentifierKey 45 | public.vcs.git 46 | IDESourceControlWCCIdentifierKey 47 | 49AA77055867AAE9A10721EEA59C590D1EAEDB9C 48 | IDESourceControlWCCName 49 | openKinect2 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj/project.xcworkspace/xcshareddata/JNILibfreenect2.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "1104B1852A18E28A16521C44CCB6A0ED65579468", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "49AA77055867AAE9A10721EEA59C590D1EAEDB9C" : 0, 8 | "1104B1852A18E28A16521C44CCB6A0ED65579468" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "389166F2-24D7-4A1D-9B77-AE3A08EF9B22", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "49AA77055867AAE9A10721EEA59C590D1EAEDB9C" : "openKinect2", 13 | "1104B1852A18E28A16521C44CCB6A0ED65579468" : "openKinect\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "JNILibfreenect2", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 203, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "build_openKinect2\/C++\/xcode\/JNILibfreenect2.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/shiffman\/OpenKinect-for-Processing", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "1104B1852A18E28A16521C44CCB6A0ED65579468" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:ThomasLengeling\/libfreenect2-for-processing.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "49AA77055867AAE9A10721EEA59C590D1EAEDB9C" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj/project.xcworkspace/xcuserdata/tom.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj/project.xcworkspace/xcuserdata/tom.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj/project.xcworkspace/xcuserdata/tom.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseTargetSettings 7 | 8 | 9 | -------------------------------------------------------------------------------- /build_openKinect2/C++/xcode/JNILibfreenect2.xcodeproj/xcuserdata/tom.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JNILibfreenect2.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E2EC00871B254489002AD63A 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /build_openKinect2/C++CmakeLinux/README.md: -------------------------------------------------------------------------------- 1 | 2 | For compiling freenect for OpenKinect linux V2 3 | 4 | * clone freenect2 5 | * copy src files to freenect2/src 6 | * replace CmakeList.txt 7 | * follow freenect2 build tutorial 8 | -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | openKinectv2 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 6 | org.eclipse.jdt.core.compiler.compliance=1.6 7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 12 | org.eclipse.jdt.core.compiler.source=1.6 13 | -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/bin/examples/FrameTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/bin/examples/FrameTest.class -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/bin/examples/MultipleKinects.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/bin/examples/MultipleKinects.class -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/bin/examples/PointCloud.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/bin/examples/PointCloud.class -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/bin/examples/RegisteredTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/bin/examples/RegisteredTest.class -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/bin/openKinectv2/Device.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/bin/openKinectv2/Device.class -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/bin/openKinectv2/OpenKinectv2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/bin/openKinectv2/OpenKinectv2.class -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/bin/openKinectv2/color.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | precision mediump int; 4 | #endif 5 | 6 | #define PROCESSING_TEXTURE_SHADER 7 | 8 | uniform sampler2D texture; 9 | 10 | void main() 11 | { 12 | 13 | vec4 col0 = texture2D(texture, vertTexCoord.st); 14 | 15 | gl_FragColor = col0; 16 | 17 | } -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/libJNILibfreenect2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/libJNILibfreenect2.dll -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/libJNILibfreenect2.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/libJNILibfreenect2.dylib -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/libturbojpeg.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/libturbojpeg.a -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/libturbojpeg.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/libturbojpeg.dylib -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/core.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-linux-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-linux-amd64.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-linux-armv6hf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-linux-armv6hf.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-linux-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-linux-i586.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-macosx-universal.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-macosx-universal.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-windows-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-windows-amd64.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-windows-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt-natives-windows-i586.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/gluegen-rt.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-linux-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-linux-amd64.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-linux-armv6hf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-linux-armv6hf.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-linux-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-linux-i586.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-macosx-universal.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-macosx-universal.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-windows-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-windows-amd64.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-windows-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all-natives-windows-i586.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/processing_2.2.1/jogl-all.jar -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/lib/usb-1.0.0-superspeed.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/openKinectv2/lib/usb-1.0.0-superspeed.a -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/src/examples/FrameTest.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | 4 | import openKinectv2.*; 5 | import processing.core.*; 6 | 7 | public class FrameTest extends PApplet{ 8 | 9 | OpenKinectv2 openKinect2; 10 | 11 | public static void main(String[] args) { 12 | PApplet.main(new String[] { "examples.FrameTest"}); 13 | } 14 | 15 | public void settings() { 16 | size(512*3, 424, P2D); 17 | } 18 | 19 | public void setup(){ 20 | openKinect2 = new OpenKinectv2(this); 21 | openKinect2.open(); 22 | 23 | background(0); 24 | } 25 | 26 | 27 | public void draw(){ 28 | background(0); 29 | 30 | PImage depth = openKinect2.getDepthImage(); 31 | image(depth, 0, 0); 32 | 33 | PImage ir = openKinect2.getIrImage(); 34 | image(ir, 512, 0); 35 | 36 | PImage color = openKinect2.getColorImage(); 37 | image(color, 512*2, 0, 512, 424); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/src/examples/MultipleKinects.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | import openKinectv2.*; 4 | import processing.core.*; 5 | 6 | public class MultipleKinects extends PApplet{ 7 | 8 | OpenKinectv2 openKinect20; 9 | OpenKinectv2 openKinect21; 10 | 11 | public void setup(){ 12 | size(512*3, 424*2, P2D); 13 | 14 | openKinect20 = new OpenKinectv2(this); 15 | openKinect20.printDevices(); 16 | 17 | openKinect21 = new OpenKinectv2(this); 18 | openKinect21.printDevices(); 19 | 20 | 21 | //System.out.println(num+" "+serialNumber); 22 | openKinect20.open(0); 23 | openKinect21.open(1); 24 | 25 | background(0); 26 | } 27 | 28 | 29 | public void draw(){ 30 | background(0); 31 | 32 | image(openKinect20.getDepthImage(), 0, 0); 33 | image(openKinect20.getIrImage(), 512, 0); 34 | image(openKinect20.getColorImage(), 512*2, 0, 512, 424); 35 | 36 | image(openKinect21.getDepthImage(), 0, 424); 37 | image(openKinect21.getIrImage(), 512, 424); 38 | image(openKinect21.getColorImage(), 512*2, 424, 512, 424); 39 | } 40 | } -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/src/examples/PointCloud.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | 4 | import openKinectv2.*; 5 | import processing.core.*; 6 | 7 | public class PointCloud extends PApplet{ 8 | 9 | OpenKinectv2 openKinect2; 10 | 11 | public static void main(String[] args) { 12 | PApplet.main(new String[] { "examples.PointCloud"}); 13 | } 14 | 15 | public void settings() { 16 | size(1024, 768, P2D); 17 | } 18 | 19 | 20 | public void setup(){ 21 | openKinect2 = new OpenKinectv2(this); 22 | openKinect2.open(); 23 | 24 | background(0); 25 | } 26 | 27 | 28 | public void draw(){ 29 | background(0); 30 | 31 | PImage depth = openKinect2.getDepthImage(); 32 | image(depth, 0, 0); 33 | 34 | //raw depth data, ints from 0 -4500, distance values 35 | int [] rawData = openKinect2.getRawDepthData(); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/src/examples/RegisteredTest.java: -------------------------------------------------------------------------------- 1 | package examples; 2 | 3 | import openKinectv2.*; 4 | import processing.core.*; 5 | 6 | 7 | public class RegisteredTest extends PApplet{ 8 | 9 | OpenKinectv2 openKinect2; 10 | 11 | public static void main(String[] args) { 12 | PApplet.main(new String[] { "examples.RegisteredTest"}); 13 | } 14 | 15 | public void settings() { 16 | size(512*3, 424*2); 17 | } 18 | 19 | 20 | public void setup(){ 21 | openKinect2 = new OpenKinectv2(this); 22 | openKinect2.open(); 23 | } 24 | 25 | 26 | public void draw(){ 27 | background(0); 28 | 29 | PImage depth = openKinect2.getDepthImage(); 30 | image(depth, 0, 0); 31 | 32 | PImage ir = openKinect2.getIrImage(); 33 | image(ir, 512, 0); 34 | 35 | PImage rgb = openKinect2.getColorImage(); 36 | image(rgb, 512*2, 0, 512, 424); 37 | 38 | PImage unregistered = openKinect2.getUndistoredImage(); 39 | image(unregistered, 0, 424, 512, 424); 40 | 41 | PImage registered = openKinect2.getRegisteredImage(); 42 | image(registered, 512, 424, 512, 424); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/src/openKinectv2/OpenKinectv2.java: -------------------------------------------------------------------------------- 1 | package openKinectv2; 2 | 3 | import processing.core.PApplet; 4 | 5 | /* 6 | openKinect2 library for Processing 7 | Copyright (c) 2014 Thomas Sanchez Lengeling 8 | 9 | * Redistribution and use in source and binary forms, with or 10 | * without modification, are permitted provided that the following 11 | * conditions are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | 21 | openKinect2 library for Processing is free software: you can redistribute it and/or 22 | modify it under the terms of the GNU General Public License as published by 23 | the Free Software Foundation, either version 3 of the License, or 24 | (at your option) any later version. 25 | 26 | openKinect2for Processing is distributed in the hope that it will be 27 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | GNU General Public License for more details. 30 | 31 | You should have received a copy of the GNU General Public License 32 | along with KinectfV2.0 library for Processing. If not, see 33 | . 34 | */ 35 | 36 | public class OpenKinectv2 extends Device{ 37 | 38 | public static PApplet parent; 39 | 40 | public OpenKinectv2(PApplet _p) { 41 | super(_p); 42 | parent = _p; 43 | 44 | parent.registerMethod("dispose", this); 45 | } 46 | 47 | public void dispose() { 48 | System.out.println("EXIT"); 49 | stopDevice(); 50 | } 51 | 52 | 53 | } -------------------------------------------------------------------------------- /build_openKinect2/openKinectv2/src/openKinectv2/color.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | precision mediump int; 4 | #endif 5 | 6 | #define PROCESSING_TEXTURE_SHADER 7 | 8 | uniform sampler2D texture; 9 | 10 | void main() 11 | { 12 | 13 | vec4 col0 = texture2D(texture, vertTexCoord.st); 14 | 15 | gl_FragColor = col0; 16 | 17 | } -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/TurboJpeg/lib/osx/libturbojpeg.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/protonectTest/libs/TurboJpeg/lib/osx/libturbojpeg.dylib -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/libusb/include/libusb/os/poll_posix.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBUSB_POLL_POSIX_H 2 | #define LIBUSB_POLL_POSIX_H 3 | 4 | #define usbi_write write 5 | #define usbi_read read 6 | #define usbi_close close 7 | #define usbi_poll poll 8 | 9 | int usbi_pipe(int pipefd[2]); 10 | 11 | #endif /* LIBUSB_POLL_POSIX_H */ 12 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/libusb/include/libusb/os/threads_posix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libusbx synchronization using POSIX Threads 3 | * 4 | * Copyright © 2010 Peter Stuge 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef LIBUSB_THREADS_POSIX_H 22 | #define LIBUSB_THREADS_POSIX_H 23 | 24 | #include 25 | 26 | #define usbi_mutex_static_t pthread_mutex_t 27 | #define USBI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER 28 | #define usbi_mutex_static_lock pthread_mutex_lock 29 | #define usbi_mutex_static_unlock pthread_mutex_unlock 30 | 31 | #define usbi_mutex_t pthread_mutex_t 32 | #define usbi_mutex_init pthread_mutex_init 33 | #define usbi_mutex_lock pthread_mutex_lock 34 | #define usbi_mutex_unlock pthread_mutex_unlock 35 | #define usbi_mutex_trylock pthread_mutex_trylock 36 | #define usbi_mutex_destroy pthread_mutex_destroy 37 | 38 | #define usbi_cond_t pthread_cond_t 39 | #define usbi_cond_init pthread_cond_init 40 | #define usbi_cond_wait pthread_cond_wait 41 | #define usbi_cond_timedwait pthread_cond_timedwait 42 | #define usbi_cond_broadcast pthread_cond_broadcast 43 | #define usbi_cond_destroy pthread_cond_destroy 44 | #define usbi_cond_signal pthread_cond_signal 45 | 46 | extern int usbi_mutex_init_recursive(pthread_mutex_t *mutex, pthread_mutexattr_t *attr); 47 | 48 | int usbi_get_tid(void); 49 | 50 | #endif /* LIBUSB_THREADS_POSIX_H */ 51 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/libusb/include/libusb/version.h: -------------------------------------------------------------------------------- 1 | /* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */ 2 | #include "version_nano.h" 3 | #ifndef LIBUSB_MAJOR 4 | #define LIBUSB_MAJOR 1 5 | #endif 6 | #ifndef LIBUSB_MINOR 7 | #define LIBUSB_MINOR 0 8 | #endif 9 | #ifndef LIBUSB_MICRO 10 | #define LIBUSB_MICRO 17 11 | #endif 12 | #ifndef LIBUSB_NANO 13 | #define LIBUSB_NANO 0 14 | #endif 15 | /* LIBUSB_RC is the release candidate suffix. Should normally be empty. */ 16 | #ifndef LIBUSB_RC 17 | #define LIBUSB_RC "" 18 | #endif 19 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/libusb/include/libusb/version_nano.h: -------------------------------------------------------------------------------- 1 | #define LIBUSB_NANO 10830 2 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/libusb/lib/osx/usb-1.0.0-superspeed.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/protonectTest/libs/libusb/lib/osx/usb-1.0.0-superspeed.a -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef LIBFREENECT2_CONFIG_H 28 | #define LIBFREENECT2_CONFIG_H 29 | 30 | #ifdef _MSC_VER 31 | #define LIBFREENECT2_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) ) 32 | #else 33 | #define LIBFREENECT2_PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) 34 | #endif 35 | 36 | #ifdef _WIN32 37 | #define LIBFREENECT2_API __declspec(dllexport) 38 | #else 39 | #define LIBFREENECT2_API 40 | #endif 41 | 42 | #define LIBFREENECT2_WITH_OPENGL_SUPPORT 43 | 44 | #define LIBFREENECT2_WITH_OPENCL_SUPPORT 45 | 46 | /* #undef LIBFREENECT2_THREADING_STDLIB */ 47 | 48 | #define LIBFREENECT2_THREADING_TINYTHREAD 49 | 50 | #endif // LIBFREENECT2_CONFIG_H 51 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef LIBFREENECT2_CONFIG_H 28 | #define LIBFREENECT2_CONFIG_H 29 | 30 | #ifdef _MSC_VER 31 | #define LIBFREENECT2_PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) ) 32 | #else 33 | #define LIBFREENECT2_PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__)) 34 | #endif 35 | 36 | #ifdef _WIN32 37 | #define LIBFREENECT2_API __declspec(dllexport) 38 | #else 39 | #define LIBFREENECT2_API 40 | #endif 41 | 42 | #cmakedefine LIBFREENECT2_WITH_OPENGL_SUPPORT 43 | 44 | #cmakedefine LIBFREENECT2_WITH_OPENCL_SUPPORT 45 | 46 | #cmakedefine LIBFREENECT2_THREADING_STDLIB 47 | 48 | #cmakedefine LIBFREENECT2_THREADING_TINYTHREAD 49 | 50 | #endif // LIBFREENECT2_CONFIG_H 51 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/data_callback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | 28 | #ifndef DATA_CALLBACK_H_ 29 | #define DATA_CALLBACK_H_ 30 | 31 | #include 32 | #include 33 | 34 | namespace libfreenect2 35 | { 36 | 37 | class LIBFREENECT2_API DataCallback 38 | { 39 | public: 40 | virtual void onDataReceived(unsigned char *buffer, size_t n) = 0; 41 | }; 42 | 43 | } // namespace libfreenect2 44 | 45 | #endif // DATA_CALLBACK_H_ 46 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/depth_packet_stream_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef DEPTH_PACKET_STREAM_PARSER_H_ 28 | #define DEPTH_PACKET_STREAM_PARSER_H_ 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | namespace libfreenect2 41 | { 42 | 43 | LIBFREENECT2_PACK(struct LIBFREENECT2_API DepthSubPacketFooter 44 | { 45 | uint32_t magic0; 46 | uint32_t magic1; 47 | uint32_t timestamp; 48 | uint32_t sequence; 49 | uint32_t subsequence; 50 | uint32_t length; 51 | uint32_t fields[32]; 52 | }); 53 | 54 | class LIBFREENECT2_API DepthPacketStreamParser : public DataCallback 55 | { 56 | public: 57 | DepthPacketStreamParser(); 58 | virtual ~DepthPacketStreamParser(); 59 | 60 | void setPacketProcessor(libfreenect2::BaseDepthPacketProcessor *processor); 61 | 62 | virtual void onDataReceived(unsigned char* buffer, size_t length); 63 | private: 64 | libfreenect2::BaseDepthPacketProcessor *processor_; 65 | 66 | libfreenect2::DoubleBuffer buffer_; 67 | libfreenect2::Buffer work_buffer_; 68 | 69 | uint32_t current_sequence_; 70 | uint32_t current_subsequence_; 71 | }; 72 | 73 | } /* namespace libfreenect2 */ 74 | #endif /* DEPTH_PACKET_STREAM_PARSER_H_ */ 75 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/double_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef DOUBLE_BUFFER_H_ 28 | #define DOUBLE_BUFFER_H_ 29 | 30 | #include 31 | #include 32 | 33 | namespace libfreenect2 34 | { 35 | 36 | struct LIBFREENECT2_API Buffer 37 | { 38 | public: 39 | size_t capacity; 40 | size_t length; 41 | unsigned char* data; 42 | }; 43 | 44 | class LIBFREENECT2_API DoubleBuffer 45 | { 46 | public: 47 | DoubleBuffer(); 48 | virtual ~DoubleBuffer(); 49 | 50 | void allocate(size_t buffer_size); 51 | 52 | void swap(); 53 | 54 | Buffer& front(); 55 | 56 | Buffer& back(); 57 | private: 58 | Buffer buffer_[2]; 59 | unsigned char front_buffer_index_; 60 | 61 | unsigned char* buffer_data_; 62 | }; 63 | 64 | } /* namespace libfreenect2 */ 65 | #endif /* DOUBLE_BUFFER_H_ */ 66 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/frame_listener.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef FRAME_LISTENER_HPP_ 28 | #define FRAME_LISTENER_HPP_ 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | namespace libfreenect2 35 | { 36 | 37 | struct LIBFREENECT2_API Frame 38 | { 39 | enum Type 40 | { 41 | Color = 1, 42 | Ir = 2, 43 | Depth = 4 44 | }; 45 | 46 | uint32_t timestamp; 47 | uint32_t sequence; 48 | size_t width, height, bytes_per_pixel; 49 | unsigned char* data; 50 | 51 | Frame(size_t width, size_t height, size_t bytes_per_pixel) : 52 | width(width), 53 | height(height), 54 | bytes_per_pixel(bytes_per_pixel) 55 | { 56 | data = new unsigned char[width * height * bytes_per_pixel]; 57 | } 58 | 59 | ~Frame() 60 | { 61 | delete[] data; 62 | } 63 | }; 64 | 65 | class LIBFREENECT2_API FrameListener 66 | { 67 | public: 68 | virtual ~FrameListener(); 69 | 70 | virtual bool onNewFrame(Frame::Type type, Frame *frame) = 0; 71 | }; 72 | 73 | } /* namespace libfreenect2 */ 74 | #endif /* FRAME_LISTENER_HPP_ */ 75 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/frame_listener_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef FRAME_LISTENER_IMPL_H_ 28 | #define FRAME_LISTENER_IMPL_H_ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | namespace libfreenect2 36 | { 37 | 38 | typedef std::map FrameMap; 39 | 40 | class SyncMultiFrameListenerImpl; 41 | 42 | class LIBFREENECT2_API SyncMultiFrameListener : public FrameListener 43 | { 44 | public: 45 | SyncMultiFrameListener(unsigned int frame_types); 46 | virtual ~SyncMultiFrameListener(); 47 | 48 | bool hasNewFrame() const; 49 | 50 | #ifdef LIBFREENECT2_THREADING_STDLIB 51 | bool waitForNewFrame(FrameMap &frame, int milliseconds); 52 | #endif // LIBFREENECT2_THREADING_STDLIB 53 | // for now the caller is responsible to release the frames when he is done 54 | void waitForNewFrame(FrameMap &frame); 55 | 56 | void release(FrameMap &frame); 57 | 58 | virtual bool onNewFrame(Frame::Type type, Frame *frame); 59 | private: 60 | SyncMultiFrameListenerImpl *impl_; 61 | }; 62 | 63 | } /* namespace libfreenect2 */ 64 | #endif /* FRAME_LISTENER_IMPL_H_ */ 65 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/packet_processor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef PACKET_PROCESSOR_H_ 28 | #define PACKET_PROCESSOR_H_ 29 | 30 | namespace libfreenect2 31 | { 32 | 33 | template 34 | class PacketProcessor 35 | { 36 | public: 37 | virtual ~PacketProcessor() {} 38 | 39 | virtual bool ready() { return true; } 40 | virtual void process(const PacketT &packet) = 0; 41 | }; 42 | 43 | template 44 | class NoopPacketProcessor : public PacketProcessor 45 | { 46 | public: 47 | NoopPacketProcessor() {} 48 | virtual ~NoopPacketProcessor() {} 49 | 50 | virtual void process(const PacketT &packet) {} 51 | }; 52 | 53 | template 54 | PacketProcessor *noopProcessor() 55 | { 56 | static NoopPacketProcessor noop_processor_; 57 | return &noop_processor_; 58 | } 59 | 60 | } /* namespace libfreenect2 */ 61 | #endif /* PACKET_PROCESSOR_H_ */ 62 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/protocol/command_transaction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2011 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef COMMAND_TRANSACTION_H_ 28 | #define COMMAND_TRANSACTION_H_ 29 | 30 | #include 31 | #include 32 | 33 | namespace libfreenect2 34 | { 35 | namespace protocol 36 | { 37 | 38 | class CommandTransaction 39 | { 40 | public: 41 | static const int ResponseCompleteLength = 16; 42 | static const uint32_t ResponseCompleteMagic = 0x0A6FE000; 43 | 44 | enum ResultCode 45 | { 46 | Success, 47 | Error 48 | }; 49 | 50 | struct Result 51 | { 52 | ResultCode code; 53 | 54 | unsigned char *data; 55 | int capacity, length; 56 | 57 | Result(); 58 | ~Result(); 59 | 60 | void allocate(size_t size); 61 | void deallocate(); 62 | bool notSuccessfulThenDeallocate(); 63 | }; 64 | 65 | CommandTransaction(libusb_device_handle *handle, int inbound_endpoint, int outbound_endpoint); 66 | ~CommandTransaction(); 67 | 68 | void execute(const CommandBase& command, Result& result); 69 | private: 70 | libusb_device_handle *handle_; 71 | int inbound_endpoint_, outbound_endpoint_, timeout_; 72 | Result response_complete_result_; 73 | 74 | ResultCode send(const CommandBase& command); 75 | 76 | void receive(Result& result); 77 | 78 | bool isResponseCompleteResult(Result& result, uint32_t sequence); 79 | }; 80 | 81 | } /* namespace protocol */ 82 | } /* namespace libfreenect2 */ 83 | #endif /* COMMAND_TRANSACTION_H_ */ 84 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/registration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef REGISTRATION_H_ 28 | #define REGISTRATION_H_ 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | namespace libfreenect2 36 | { 37 | 38 | class LIBFREENECT2_API Registration 39 | { 40 | public: 41 | Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Device::ColorCameraParams rgb_p); 42 | 43 | // undistort/register a single depth data point 44 | void apply(int dx, int dy, float dz, float& cx, float &cy) const; 45 | 46 | // undistort/register a whole image 47 | void apply(const Frame* rgb, const Frame* depth, Frame* undistorted, Frame* registered, const bool enable_filter = true) const; 48 | 49 | private: 50 | void distort(int mx, int my, float& dx, float& dy) const; 51 | void depth_to_color(float mx, float my, float& rx, float& ry) const; 52 | 53 | Freenect2Device::IrCameraParams depth; 54 | Freenect2Device::ColorCameraParams color; 55 | 56 | int distort_map[512 * 424]; 57 | float depth_to_color_map_x[512 * 424]; 58 | float depth_to_color_map_y[512 * 424]; 59 | int depth_to_color_map_yi[512 * 424]; 60 | 61 | const int filter_width_half; 62 | const int filter_height_half; 63 | const float filter_tolerance; 64 | }; 65 | 66 | } /* namespace libfreenect2 */ 67 | #endif /* REGISTRATION_H_ */ 68 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef RESOURCE_H_ 28 | #define RESOURCE_H_ 29 | 30 | #include 31 | 32 | namespace libfreenect2 33 | { 34 | 35 | bool loadResource(const std::string &name, unsigned char const**data, size_t *length); 36 | bool loadBufferFromResources(const std::string &filename, unsigned char *buffer, const size_t n); 37 | 38 | } /* namespace libfreenect2 */ 39 | #endif /* RESOURCE_H_ */ 40 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/rgb_packet_processor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef RGB_PACKET_PROCESSOR_H_ 28 | #define RGB_PACKET_PROCESSOR_H_ 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace libfreenect2 38 | { 39 | 40 | struct LIBFREENECT2_API RgbPacket 41 | { 42 | uint32_t sequence; 43 | 44 | uint32_t timestamp; 45 | unsigned char *jpeg_buffer; 46 | size_t jpeg_buffer_length; 47 | }; 48 | 49 | typedef PacketProcessor BaseRgbPacketProcessor; 50 | 51 | class LIBFREENECT2_API RgbPacketProcessor : public BaseRgbPacketProcessor 52 | { 53 | public: 54 | RgbPacketProcessor(); 55 | virtual ~RgbPacketProcessor(); 56 | 57 | virtual void setFrameListener(libfreenect2::FrameListener *listener); 58 | protected: 59 | libfreenect2::FrameListener *listener_; 60 | }; 61 | 62 | class LIBFREENECT2_API DumpRgbPacketProcessor : public RgbPacketProcessor 63 | { 64 | public: 65 | DumpRgbPacketProcessor(); 66 | virtual ~DumpRgbPacketProcessor(); 67 | protected: 68 | virtual void process(const libfreenect2::RgbPacket &packet); 69 | }; 70 | 71 | class TurboJpegRgbPacketProcessorImpl; 72 | 73 | class LIBFREENECT2_API TurboJpegRgbPacketProcessor : public RgbPacketProcessor 74 | { 75 | public: 76 | TurboJpegRgbPacketProcessor(); 77 | virtual ~TurboJpegRgbPacketProcessor(); 78 | protected: 79 | virtual void process(const libfreenect2::RgbPacket &packet); 80 | private: 81 | TurboJpegRgbPacketProcessorImpl *impl_; 82 | }; 83 | 84 | } /* namespace libfreenect2 */ 85 | #endif /* RGB_PACKET_PROCESSOR_H_ */ 86 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/rgb_packet_stream_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef RGB_PACKET_STREAM_PARSER_H_ 28 | #define RGB_PACKET_STREAM_PARSER_H_ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | namespace libfreenect2 39 | { 40 | 41 | class LIBFREENECT2_API RgbPacketStreamParser : public DataCallback 42 | { 43 | public: 44 | RgbPacketStreamParser(); 45 | virtual ~RgbPacketStreamParser(); 46 | 47 | void setPacketProcessor(BaseRgbPacketProcessor *processor); 48 | 49 | virtual void onDataReceived(unsigned char* buffer, size_t length); 50 | private: 51 | libfreenect2::DoubleBuffer buffer_; 52 | BaseRgbPacketProcessor *processor_; 53 | }; 54 | 55 | } /* namespace libfreenect2 */ 56 | #endif /* RGB_PACKET_STREAM_PARSER_H_ */ 57 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/threading.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef THREADING_H_ 28 | #define THREADING_H_ 29 | 30 | #include 31 | 32 | #ifdef LIBFREENECT2_THREADING_STDLIB 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #define WAIT_CONDITION(var, mutex, lock) var.wait(lock); 40 | 41 | namespace libfreenect2 42 | { 43 | 44 | typedef std::thread thread; 45 | typedef std::mutex mutex; 46 | typedef std::lock_guard lock_guard; 47 | typedef std::unique_lock unique_lock; 48 | typedef std::condition_variable condition_variable; 49 | 50 | namespace chrono 51 | { 52 | using namespace std::chrono; 53 | } 54 | 55 | namespace this_thread 56 | { 57 | using namespace std::this_thread; 58 | } 59 | 60 | } /* libfreenect2 */ 61 | 62 | #endif 63 | 64 | #ifdef LIBFREENECT2_THREADING_TINYTHREAD 65 | 66 | #include 67 | 68 | // TODO: work around for tinythread incompatibility 69 | #define WAIT_CONDITION(var, mutex, lock) var.wait(mutex); 70 | 71 | namespace libfreenect2 72 | { 73 | 74 | typedef tthread::thread thread; 75 | typedef tthread::mutex mutex; 76 | typedef tthread::lock_guard lock_guard; 77 | // TODO: this is not optimal 78 | typedef tthread::lock_guard unique_lock; 79 | typedef tthread::condition_variable condition_variable; 80 | 81 | namespace chrono 82 | { 83 | using namespace tthread::chrono; 84 | } 85 | 86 | namespace this_thread 87 | { 88 | using namespace tthread::this_thread; 89 | } 90 | 91 | } /* libfreenect2 */ 92 | 93 | #endif 94 | 95 | 96 | #endif /* THREADING_H_ */ 97 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/include/libfreenect2/usb/event_loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenKinect Project. http://www.openkinect.org 3 | * 4 | * Copyright (c) 2014 individual OpenKinect contributors. See the CONTRIB file 5 | * for details. 6 | * 7 | * This code is licensed to you under the terms of the Apache License, version 8 | * 2.0, or, at your option, the terms of the GNU General Public License, 9 | * version 2.0. See the APACHE20 and GPL2 files for the text of the licenses, 10 | * or the following URLs: 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * http://www.gnu.org/licenses/gpl-2.0.txt 13 | * 14 | * If you redistribute this file in source form, modified or unmodified, you 15 | * may: 16 | * 1) Leave this header intact and distribute it under the same terms, 17 | * accompanying it with the APACHE20 and GPL20 files, or 18 | * 2) Delete the Apache 2.0 clause and accompany it with the GPL2 file, or 19 | * 3) Delete the GPL v2 clause and accompany it with the APACHE20 file 20 | * In all cases you must keep the copyright notice intact and include a copy 21 | * of the CONTRIB file. 22 | * 23 | * Binary distributions must follow the binary distribution requirements of 24 | * either License. 25 | */ 26 | 27 | #ifndef EVENT_LOOP_H_ 28 | #define EVENT_LOOP_H_ 29 | 30 | #include 31 | 32 | namespace libfreenect2 33 | { 34 | namespace usb 35 | { 36 | 37 | class EventLoop 38 | { 39 | public: 40 | EventLoop(); 41 | virtual ~EventLoop(); 42 | 43 | void start(void *usb_context); 44 | 45 | void stop(); 46 | private: 47 | bool shutdown_; 48 | libfreenect2::thread *thread_; 49 | void *usb_context_; 50 | 51 | static void static_execute(void *cookie); 52 | void execute(); 53 | }; 54 | 55 | } /* namespace usb */ 56 | } /* namespace libfreenect2 */ 57 | #endif /* EVENT_LOOP_H_ */ 58 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/lib/libfreenect2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/protonectTest/libs/protonect/lib/libfreenect2.a -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/libs/protonect/lib/libfreenect2.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/protonectTest/libs/protonect/lib/libfreenect2.dylib -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/xcode/ProtonectTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/xcode/ProtonectTest.xcodeproj/project.xcworkspace/xcshareddata/ProtonectTest.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | AF17A384-55BC-41E6-BA6F-67D0E77A28E0 9 | IDESourceControlProjectName 10 | ProtonectTest 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 49AA77055867AAE9A10721EEA59C590D1EAEDB9C 14 | github.com:ThomasLengeling/libfreenect2-for-processing.git 15 | 16 | IDESourceControlProjectPath 17 | build_openKinect2/protonectTest/xcode/ProtonectTest.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 49AA77055867AAE9A10721EEA59C590D1EAEDB9C 21 | ../../../../.. 22 | 23 | IDESourceControlProjectURL 24 | github.com:ThomasLengeling/libfreenect2-for-processing.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 49AA77055867AAE9A10721EEA59C590D1EAEDB9C 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 49AA77055867AAE9A10721EEA59C590D1EAEDB9C 36 | IDESourceControlWCCName 37 | openKinect2 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/xcode/ProtonectTest.xcodeproj/project.xcworkspace/xcuserdata/tom.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiffman/OpenKinect-for-Processing/52e879db6da6bf397b7536fb08a2d4d65cc60604/build_openKinect2/protonectTest/xcode/ProtonectTest.xcodeproj/project.xcworkspace/xcuserdata/tom.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /build_openKinect2/protonectTest/xcode/ProtonectTest.xcodeproj/xcuserdata/tom.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ProtonectTest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E2D362CD1B2A2DD60098FC16 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | --------------------------------------------------------------------------------