#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "freenect_internal.h"
#include "registration.h"
#include "cameras.h"
#include "flags.h"
Go to the source code of this file.
Classes | |
struct | pkt_hdr |
Macros | |
#define | CLAMP(x) if (x < 0) {x = 0;} if (x > 255) {x = 255;} |
#define | depth_mode_count 6 |
#define | MAKE_RESERVED(res, fmt) (uint32_t)(((res & 0xff) << 8) | (((fmt & 0xff)))) |
#define | RESERVED_TO_FORMAT(reserved) ((reserved) & 0xff) |
#define | RESERVED_TO_RESOLUTION(reserved) (freenect_resolution)((reserved >> 8) & 0xff) |
#define | video_mode_count 12 |
Variables | |
static const freenect_frame_mode | invalid_mode = {0, (freenect_resolution)0, {(freenect_video_format)0}, 0, 0, 0, 0, 0, 0, 0} |
static freenect_frame_mode | supported_depth_modes [depth_mode_count] |
static freenect_frame_mode | supported_video_modes [video_mode_count] |
#define CLAMP | ( | x | ) | if (x < 0) {x = 0;} if (x > 255) {x = 255;} |
#define MAKE_RESERVED | ( | res, | |
fmt | |||
) | (uint32_t)(((res & 0xff) << 8) | (((fmt & 0xff)))) |
#define RESERVED_TO_RESOLUTION | ( | reserved | ) | (freenect_resolution)((reserved >> 8) & 0xff) |
|
static |
Convert a packed array of n elements with vw useful bits into array of zero-padded 16bit elements.
src | The source packed array, of size (n * vw / 8) bytes |
dest | The destination unpacked array, of size (n * 2) bytes |
vw | The virtual width of elements, that is the number of useful bits for each of them |
n | The number of elements (in particular, of the destination array), NOT a length in bytes |
Convert a packed array of n elements with vw useful bits into array of 8bit elements, dropping LSB.
src | The source packed array, of size (n * vw / 8) bytes |
dest | The destination unpacked array, of size (n * 2) bytes |
vw | The virtual width of elements, that is the number of useful bits for each of them |
n | The number of elements (in particular, of the destination array), NOT a length in bytes |
|
static |
|
static |
FN_INTERNAL int freenect_camera_init | ( | freenect_device * | dev | ) |
FN_INTERNAL int freenect_camera_teardown | ( | freenect_device * | dev | ) |
|
static |
|
static |
|
static |
|
static |
freenect_frame_mode freenect_find_depth_mode | ( | freenect_resolution | res, |
freenect_depth_format | fmt | ||
) |
Convenience function to return a mode descriptor matching the specified resolution and depth camera pixel format, if one exists.
res | Resolution desired |
fmt | Pixel format desired |
freenect_frame_mode freenect_find_video_mode | ( | freenect_resolution | res, |
freenect_video_format | fmt | ||
) |
Convenience function to return a mode descriptor matching the specified resolution and video camera pixel format, if one exists.
res | Resolution desired |
fmt | Pixel format desired |
freenect_frame_mode freenect_get_current_depth_mode | ( | freenect_device * | dev | ) |
Get the frame descriptor of the current depth mode for the specified freenect device.
dev | Which device to return the currently-set depth mode for |
freenect_frame_mode freenect_get_current_video_mode | ( | freenect_device * | dev | ) |
Get the frame descriptor of the current video mode for the specified freenect device.
dev | Which device to return the currently-set video mode for |
freenect_frame_mode freenect_get_depth_mode | ( | int | mode_num | ) |
Get the frame descriptor of the nth supported depth mode for the depth camera.
mode_num | Which of the supported modes to return information about |
int freenect_get_depth_mode_count | ( | ) |
freenect_frame_mode freenect_get_video_mode | ( | int | mode_num | ) |
Get the frame descriptor of the nth supported video mode for the video camera.
mode_num | Which of the supported modes to return information about |
int freenect_get_video_mode_count | ( | ) |
int freenect_set_depth_buffer | ( | freenect_device * | dev, |
void * | buf | ||
) |
Set the buffer to store depth information to. Size of buffer is dependant on depth format. See FREENECT_DEPTH_*_SIZE defines for more information.
dev | Device to set depth buffer for. |
buf | Buffer to store depth information to. |
void freenect_set_depth_callback | ( | freenect_device * | dev, |
freenect_depth_cb | cb | ||
) |
void freenect_set_depth_chunk_callback | ( | freenect_device * | dev, |
freenect_chunk_cb | cb | ||
) |
int freenect_set_depth_mode | ( | freenect_device * | dev, |
const freenect_frame_mode | mode | ||
) |
int freenect_set_video_buffer | ( | freenect_device * | dev, |
void * | buf | ||
) |
Set the buffer to store depth information to. Size of buffer is dependant on video format. See FREENECT_VIDEO_*_SIZE defines for more information.
dev | Device to set video buffer for. |
buf | Buffer to store video information to. |
void freenect_set_video_callback | ( | freenect_device * | dev, |
freenect_video_cb | cb | ||
) |
void freenect_set_video_chunk_callback | ( | freenect_device * | dev, |
freenect_chunk_cb | cb | ||
) |
int freenect_set_video_mode | ( | freenect_device * | dev, |
freenect_frame_mode | mode | ||
) |
Sets the current video mode for the specified device. If the freenect_frame_mode specified is not one provided by the driver e.g. from freenect_get_video_mode() or freenect_find_video_mode() then behavior is undefined. The current video mode cannot be changed while streaming is active.
dev | Device for which to set the video mode |
mode | Frame mode to set |
int freenect_start_depth | ( | freenect_device * | dev | ) |
int freenect_start_video | ( | freenect_device * | dev | ) |
int freenect_stop_depth | ( | freenect_device * | dev | ) |
int freenect_stop_video | ( | freenect_device * | dev | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |