-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Interface to the Kinect device. -- @package freenect @version 1.2 -- | Foreign functions, some helpers some from Freenect C lib. module Freenect.FFI data ContextStruct data DeviceStruct freenect_init :: Ptr (Ptr ContextStruct) -> CInt -> IO CInt freenect_shutdown :: Ptr ContextStruct -> IO CInt freenect_num_devices :: Ptr ContextStruct -> IO CInt freenect_process_events :: Ptr ContextStruct -> IO CInt freenect_select_subdevices :: Ptr ContextStruct -> CInt -> IO () freenect_set_log_level :: Ptr ContextStruct -> CInt -> IO () freenect_close_device :: Ptr DeviceStruct -> IO CInt freenect_open_device :: Ptr ContextStruct -> Ptr (Ptr DeviceStruct) -> CInt -> IO CInt type DepthCallback = Ptr DeviceStruct -> Ptr Word16 -> Word32 -> IO () freenect_set_depth_callback :: Ptr DeviceStruct -> (FunPtr DepthCallback) -> IO () wrapDepthCallback :: DepthCallback -> IO (FunPtr DepthCallback) type VideoCallback = Ptr DeviceStruct -> Ptr Word8 -> Word32 -> IO () freenect_set_video_callback :: Ptr DeviceStruct -> (FunPtr VideoCallback) -> IO () wrapVideoCallback :: VideoCallback -> IO (FunPtr VideoCallback) freenect_start_depth :: Ptr DeviceStruct -> IO CInt freenect_start_video :: Ptr DeviceStruct -> IO CInt freenect_set_tilt_degs :: Ptr DeviceStruct -> CDouble -> IO CInt freenect_set_led :: Ptr DeviceStruct -> CInt -> IO CInt new_freenect_context :: IO (Ptr (Ptr ContextStruct)) new_freenect_device :: IO (Ptr (Ptr DeviceStruct)) data FrameMode find_video_mode_freenect :: Word32 -> Word32 -> IO (Ptr FrameMode) set_freenect_video_mode :: Ptr DeviceStruct -> Ptr FrameMode -> IO CInt get_freenect_video_resolution :: Ptr DeviceStruct -> IO CInt find_depth_mode_freenect :: Word32 -> Word32 -> IO (Ptr FrameMode) set_freenect_depth_mode :: Ptr DeviceStruct -> Ptr FrameMode -> IO CInt get_freenect_depth_resolution :: Ptr DeviceStruct -> IO CInt -- | Interface to the Kinect device. -- -- See the package archive for example programs. module Freenect -- | Initialize a Freenect context. Throws exception if already -- initialized. initialize :: Context -> IO () -- | Create a new Freenect context. Must be initialized before use. newContext :: IO Context -- | Shutdown a Freenect context. shutdown :: Context -> IO () -- | Count the number of devices on a Freenect context. countDevices :: Context -> IO Integer -- | Do something with an initialized context, and free the context at the -- end of the comutation, or on exception. withContext :: (Context -> IO a) -> IO a -- | Process events. processEvents :: Context -> IO () -- | Set which subdevices any subsequent calls to openDevice should open. -- This will not affect devices which have already been opened. The -- default behavior, should you choose not to call this function at all, -- is to open all supported subdevices - motor, cameras, and audio, if -- supported on the platform. selectSubdevices :: Context -> [Subdevice] -> IO () -- | Create a new device. newDevice :: IO Device -- | Open a Kinect device. openDevice :: Context -> Device -> Integer -> IO () -- | Close a device. closeDevice :: Device -> IO () -- | Do something with an initialized context, and free the context at the -- end of the comutation, or on exception. withDevice :: Context -> Integer -> (Device -> IO a) -> IO a -- | Set the logging level for the specified context. setLogLevel :: LogLevel -> Context -> IO () -- | Set callback for video information received event. setVideoCallback :: Device -> (Vector Word8 -> Word32 -> IO ()) -> IO () -- | Start the video information stream for a device. startVideo :: Device -> IO () -- | Set callback for depth information received event. setDepthCallback :: Device -> (Vector Word16 -> Word32 -> IO ()) -> IO () -- | Start the depth information stream for a device. startDepth :: Device -> IO () -- | Set the tilt degrees for a device. setTiltDegrees :: Double -> Device -> IO () -- | Sets the current LED state for the specified device setLed :: Device -> Led -> IO () setVideoMode :: Device -> Resolution -> VideoFormat -> IO () -- | Sets the current depth mode for the specified device. The mode cannot -- be changed while streaming is active. setDepthMode :: Device -> Resolution -> DepthFormat -> IO () -- | A Freenect context. data Context -- | A Freenect device. data Device -- | Freenect exception type. data FreenectException -- | There was a problem initializing. InitFail :: FreenectException -- | There was a problem shutting down. ShutdownFail :: FreenectException -- | There was a problem closing the device. CloseDeviceFail :: FreenectException -- | Trying to initialize a context that was already initialized. AlreadyInitializedContext :: FreenectException -- | Trying to open a device that was already opened. AlreadyOpenedDevice :: FreenectException -- | Attempt to use an uninitialized context. UseOfUninitializedContext :: FreenectException -- | Attempt to use an uninitialized device. UseOfUninitializedDevice :: FreenectException -- | Call to process events failed. ProcessEvents :: CInt -> FreenectException -- | Opening a device failed. OpenDeviceFailed :: Integer -> FreenectException -- | Problem starting the video stream. StartVideoProblem :: FreenectException -- | Problem starting the depth stream. StartDepthProblem :: FreenectException -- | Unable to set the tilt. UnableToSetTilt :: FreenectException -- | Unable to set active led UnableToSetLed :: FreenectException -- | Unable to set the video mode. SetVideoMode :: FreenectException -- | TODO, not used: You didn't set the video mode. VideoModeNotSet :: FreenectException -- | Unable to set the depth mode. SetDepthMode :: FreenectException -- | TODO, not used: You didn't set the depth mode. DepthModeNotSet :: FreenectException -- | A sub-device (motor, camera and audio), if supported on the platform. data Subdevice Motor :: Subdevice Camera :: Subdevice Auto :: Subdevice -- | Message logging levels. data LogLevel -- | Crashing/non-recoverable errors LogFatal :: LogLevel -- | Major errors LogError :: LogLevel -- | Warning messages LogWarning :: LogLevel -- | Important messages LogNotice :: LogLevel -- | Normal messages LogInfo :: LogLevel -- | Useful development messages LogDebug :: LogLevel -- | Slightly less useful messages LogSpew :: LogLevel -- | EVERYTHING. May slow performance. LogFlood :: LogLevel data Led Off :: Led Green :: Led Red :: Led Yellow :: Led BlinkGreen :: Led BlinkRedYellow :: Led data Resolution Low :: Resolution Medium :: Resolution High :: Resolution data VideoFormat RGB :: VideoFormat Bayer :: VideoFormat EightBitIR :: VideoFormat TenBitIR :: VideoFormat TenBitPackedIR :: VideoFormat YUVRGB :: VideoFormat YUVRaw :: VideoFormat data DepthFormat ElevenBit :: DepthFormat TenBit :: DepthFormat ElevenBitPacked :: DepthFormat TenBitPacked :: DepthFormat instance Typeable FreenectException instance Show a => Show (Resource a) instance Show FreenectException instance Show Subdevice instance Eq Subdevice instance Show LogLevel instance Eq LogLevel instance Enum LogLevel instance Enum Resolution instance Show Resolution instance Eq Resolution instance Ord Resolution instance Enum VideoFormat instance Show VideoFormat instance Eq VideoFormat instance Enum DepthFormat instance Show DepthFormat instance Eq DepthFormat instance Enum Led instance Show Led instance Eq Led instance Exception FreenectException