Class: Hornetseye::KinectInput

Inherits:
Object
  • Object
show all
Includes:
ReaderConversion
Defined in:
lib/hornetseye-kinect/kinectinput.rb

Overview

Class for handling a Kinect sensor

This Ruby-extension is based on libfreenect.

Constant Summary collapse

@@context =

libfreenect handle

nil

Class Method Summary collapse

Class Method Details

.new(node = 0) ⇒ Object

Open the Kinect sensor

return [KinectInput] An object for accessing the Kinect sensor.

Parameters:

  • node (Integer) (defaults to: 0)

    Camera node to open.



44
45
46
47
48
49
50
51
52
53
# File 'lib/hornetseye-kinect/kinectinput.rb', line 44

def new( node = 0 )
  context = @@context || KinectContext.new
  begin
    retval = orig_new context, node
    @@context = context
    retval
  ensure
    context.close unless @@context
  end
end

.orig_newObject

Alias for overriding native method



37
# File 'lib/hornetseye-kinect/kinectinput.rb', line 37

alias_method :orig_new, :new