Documentation
¶
Overview ¶
Package freenect implements a Go binding for the libfreenect library.
Index ¶
- Constants
- type Context
- func (context *Context) Destroy() error
- func (context *Context) DeviceCount() (int, error)
- func (context *Context) OpenDevice(index int) (Device, error)
- func (context *Context) ProcessEvents(timeout time.Duration) error
- func (context *Context) SetLogCallback(callback LogCallback)
- func (context *Context) SetLogLevel(level LogLevel)
- type DepthCallback
- type DepthFormat
- type Device
- func (device *Device) Destroy()
- func (device *Device) GetAccelerometerState() (float64, float64, float64)
- func (device *Device) GetTiltAngle() float64
- func (device *Device) GetTiltStatus() TiltStatus
- func (device *Device) SetDepthCallback(callback DepthCallback)
- func (device *Device) SetLED(color LEDColor) error
- func (device *Device) SetTiltAngle(degrees float64) error
- func (device *Device) SetVideoCallback(callback VideoCallback)
- func (device *Device) StartDepthStream(resolution Resolution, format DepthFormat) error
- func (device *Device) StartVideoStream(resolution Resolution, format VideoFormat) error
- func (device *Device) StopDepthStream() error
- func (device *Device) StopVideoStream() error
- type LEDColor
- type LogCallback
- type LogLevel
- type Resolution
- type TiltStatus
- type VideoCallback
- type VideoFormat
Constants ¶
const ( LogFatal = LogLevel(C.FREENECT_LOG_FATAL) LogError = LogLevel(C.FREENECT_LOG_ERROR) LogWarning = LogLevel(C.FREENECT_LOG_WARNING) LogNotice = LogLevel(C.FREENECT_LOG_NOTICE) LogInfo = LogLevel(C.FREENECT_LOG_INFO) LogDebug = LogLevel(C.FREENECT_LOG_DEBUG) LogSpew = LogLevel(C.FREENECT_LOG_SPEW) )
Constants representing logging verbosity levels, ordered from least to most verbose.
const ( ResolutionLow = Resolution(C.FREENECT_RESOLUTION_LOW) ResolutionMedium = Resolution(C.FREENECT_RESOLUTION_MEDIUM) ResolutionHigh = Resolution(C.FREENECT_RESOLUTION_HIGH) )
Constants representing various video/depth resolution levels.
const ( DepthFormat11Bit = DepthFormat(C.FREENECT_DEPTH_11BIT) DepthFormat10Bit = DepthFormat(C.FREENECT_DEPTH_10BIT) DepthFormat11BitPacked = DepthFormat(C.FREENECT_DEPTH_11BIT_PACKED) DepthFormat10BitPacked = DepthFormat(C.FREENECT_DEPTH_10BIT_PACKED) DepthFormatRegistered = DepthFormat(C.FREENECT_DEPTH_REGISTERED) DepthFormatMM = DepthFormat(C.FREENECT_DEPTH_MM) )
Constants representing various data representations of depth information.
const ( VideoFormatRGB = VideoFormat(C.FREENECT_VIDEO_RGB) VideoFormatBayer = VideoFormat(C.FREENECT_VIDEO_BAYER) VideoFormatIR8Bit = VideoFormat(C.FREENECT_VIDEO_IR_8BIT) VideoFormatIR10Bit = VideoFormat(C.FREENECT_VIDEO_IR_10BIT) VideoFormatIR10BitPacked = VideoFormat(C.FREENECT_VIDEO_IR_10BIT_PACKED) VideoFormatYUVRGB = VideoFormat(C.FREENECT_VIDEO_YUV_RGB) VideoFormatYUVRaw = VideoFormat(C.FREENECT_VIDEO_YUV_RAW) )
Constants representing various data representations of video information.
const ( LEDColorOff = LEDColor(C.LED_OFF) LEDColorGreen = LEDColor(C.LED_GREEN) LEDColorRed = LEDColor(C.LED_RED) LEDColorYellow = LEDColor(C.LED_YELLOW) LEDColorBlinkGreen = LEDColor(C.LED_BLINK_GREEN) LEDColorBlinkRedYellow = LEDColor(C.LED_BLINK_RED_YELLOW) )
Constants representing LED color options.
const ( TiltStatusStopped = TiltStatus(C.TILT_STATUS_STOPPED) TiltStatusLimit = TiltStatus(C.TILT_STATUS_LIMIT) TiltStatusMoving = TiltStatus(C.TILT_STATUS_MOVING) )
Constants representing tilt motor status codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is an object that represents a Freenect context. Many operations are done through this object.
func (*Context) DeviceCount ¶
DeviceCount returns the number of devices connected to the system.
func (*Context) OpenDevice ¶
OpenDevice opens a device of the given index and returns the corresponding Device object.
func (*Context) ProcessEvents ¶
ProcessEvents looks for new data from the device or devices and sends the data to the callbacks.
func (*Context) SetLogCallback ¶
func (context *Context) SetLogCallback(callback LogCallback)
SetLogCallback sets the callback function Freenect will call when it has a log message. If this callback is set, Freenect will not automatically print log messages.
func (*Context) SetLogLevel ¶
SetLogLevel sets how verbose Freenect should be.
type DepthCallback ¶
DepthCallback is a function that a Device object can call when a new depth frame is available.
type DepthFormat ¶
type DepthFormat int
DepthFormat represents a data representation of depth information.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is an object the represents a physical Kinect device.
func (*Device) GetAccelerometerState ¶
GetAccelerometerState returns the axis-based gravity adjusted accelerometer state in the form of x-axis, y-axis, and z-axis states.
func (*Device) GetTiltAngle ¶
GetTiltAngle returns the current angle the Kinect is tilted.
func (*Device) GetTiltStatus ¶
func (device *Device) GetTiltStatus() TiltStatus
GetTiltStatus returns the current status of the tilting motor.
func (*Device) SetDepthCallback ¶
func (device *Device) SetDepthCallback(callback DepthCallback)
SetDepthCallback sets the callback function that will be called when a new depth frame is available.
func (*Device) SetTiltAngle ¶
SetTiltAngle sets the angle the kinect is tilted. Note that the device may not be done tilting when this function returns.
func (*Device) SetVideoCallback ¶
func (device *Device) SetVideoCallback(callback VideoCallback)
SetVideoCallback sets the callback function that will be called when a new video frame is available.
func (*Device) StartDepthStream ¶
func (device *Device) StartDepthStream(resolution Resolution, format DepthFormat) error
StartDepthStream begins the retrieval of depth information from the device.
func (*Device) StartVideoStream ¶
func (device *Device) StartVideoStream(resolution Resolution, format VideoFormat) error
StartVideoStream starts the retrieval of video information from the device.
func (*Device) StopDepthStream ¶
StopDepthStream stops the retrieval of depth information from the device.
func (*Device) StopVideoStream ¶
StopVideoStream stops the retrieval of video information from the device.
type LogCallback ¶
LogCallback is a function type that Freenect uses to deliver log messages to the user.
type VideoCallback ¶
VideoCallback is a function that a Device object can call when a new video frame is available.
type VideoFormat ¶
type VideoFormat int
VideoFormat represents a data representation of color information.