// INCLUDES ////////////////////////////////////////////////////////////// #include #include #include #include "pwcbsd/videodev.h" #include "pwcbsd/pwc-ioctl.h" // SWIG MODULE DECLARATION /////////////////////////////////////////////// #ifdef SWIG %module pwc %feature("autodoc", "1"); #define MODULE_AUTHOR "Danny Pansters" #define MODULE_AUTHOR_EMAIL "danny@ricin.com" #define MODULE_COPYRIGHT "(c) 2006-2007, Danny Pansters \n(c) 1999-2006, Nemosoft Unv, Luc Saillard, Raaf (pwc driver)" #define MODULE_LICENSE "BSD" #endif // CONVENIENCE CONSTANTS ///////////////////////////////////////////////// #define MINPERC 0 // Lowest percentage value #define MAXPERC 100 // Highest percentage value #define PWC_MAXVAL 0xffff // Max value 65535 (brightness, contrast, ..) #define PWC_MINVAL 0 #define PWC_MINFPS 4 // Frames per sec #define PWC_MAXFPS 30 #define PWCDEV "/dev/video0" // PWC device // CAMERA FUNCTIONS ////////////////////////////////////////////////////// // Brightness, contrast, gamma, color, saturation (percentage) #ifdef SWIG %feature("docstring", "Set brightness, 0 to 100. Returns -1 on failure."); #endif int camera_brightness_set(int fd, int brightness); #ifdef SWIG %feature("docstring", "Get brightness. Returns percentage, or -1 on failure."); #endif int camera_brightness(int fd); #ifdef SWIG %feature("docstring", "Set contrast, 0 to 100. Returns -1 on failure."); #endif int camera_contrast_set(int fd, int contrast); #ifdef SWIG %feature("docstring", "Get contrast. Returns percentage, or -1 on failure."); #endif int camera_contrast(int fd); #ifdef SWIG %feature("docstring", "Set gamma, 0 (none) to 100. Returns -1 on failure."); #endif int camera_gamma_set(int fd, int gamma); #ifdef SWIG %feature("docstring", "Get gamma. Returns percentage, or -1 on failure."); #endif int camera_gamma(int fd); #ifdef SWIG %feature("docstring", "Set color (whitebalance), 0 (green) to 100 (max blue & red). Returns -1 on failure."); #endif int camera_color_set(int fd, int color); #ifdef SWIG %feature("docstring", "Get color (whitebalance). Returns percentage, or -1 on failure."); #endif int camera_color(int fd); #ifdef SWIG %feature("docstring", "Set saturation, 0 to 100. Returns -1 on failure."); #endif int camera_saturation_set(int fd, int saturation); #ifdef SWIG %feature("docstring", "Get saturation. Returns percentage, or -1 on failure."); #endif int camera_saturation(int fd); // Framerate #ifdef SWIG %feature("docstring", "Set framerate, 4 to 30. Returns -1 on failure."); #endif int camera_framerate_set(int fd, int fps); #ifdef SWIG %feature("docstring", "Get framerate. Returns 4 to 30, or -1 on failure."); #endif int camera_framerate(int fd); // Capture size #ifdef SWIG %feature("docstring", "Set capture size, 0 to 5 (SQCIF, QSIF, QCIF, SIF, CIF, VGA). Returns -1 on failure."); #endif int camera_capsize_set(int fd, int capsize); #ifdef SWIG %feature("docstring", "Get capture size. Returns 0 to 5, or -1 on failure."); #endif int camera_capsize(int fd); // MPT #ifdef SWIG %feature("docstring", "Perform panning, 0 to 100 (50 is center). Returns -1 on failure."); #endif int camera_panning_set(int fd, int pan); #ifdef SWIG %feature("docstring", "Get panning. Returns 0 to 100, or -1 on failure."); #endif int camera_panning(int fd); #ifdef SWIG %feature("docstring", "Perform tilting, 0 to 100 (50 is center). Returns -1 on failure."); #endif int camera_tilting_set(int fd, int tilt); #ifdef SWIG %feature("docstring", "Get tilting. Returns 0 to 100, or -1 on failure."); #endif int camera_tilting(int fd); // VIEWER FUNCTIONS ////////////////////////////////////////////////////// #ifdef SWIG %feature("docstring", """Init the hardware and SDL viewer, start capturing frames. Returns 0 on success. On failure it returns (in order of actual operations) 1 if the ioctl VIDIOCGWIN failed, 2 if malloc failed, 3 if SDL_Init failed, 4 if SDL_SetVideoMode failed, 5 if SDL_CreateYUVOverlay failed, 6 if SDL_AddTimer failed. fd must be an open file descriptor to PWCDEV."""); #endif int viewer_init(int fd, int width, int height); #ifdef SWIG %feature("docstring", "Start/unpause video."); #endif void viewer_start(); #ifdef SWIG %feature("docstring", "Pause video (not capturing)."); #endif void viewer_pause(); #ifdef SWIG %feature("docstring", "Resize the viewer area to width x height pixels."); #endif void viewer_resize(int width, int height); #ifdef SWIG %feature("docstring", "Quit viewer, shut down SDL, stop capturing, clean up."); #endif void viewer_quit(); #ifdef SWIG %feature("docstring", "Frame handler, for internal use only."); #endif void frame_handler(); #ifdef SWIG %feature("docstring", "Timer callback function, for internal use only."); #endif unsigned int timer_callback(unsigned int interval, void *param); // END ///////////////////////////////////////////////////////////////////