Update of /cvsroot/artoolkit/artoolkit/include/AR
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9605
Modified Files:
gsub.h param.h arMulti.h gsubUtil.h matrix.h config.h.in ar.h
video.h
Log Message:
Add doxygen docs. Linux video driver updates and patches.
Index: param.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/param.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** param.h 4 Nov 2004 08:51:15 -0000 1.1.1.1
--- param.h 22 Nov 2004 02:11:05 -0000 1.2
***************
*** 1,14 ****
! /*******************************************************
! *
! * Author: Takeshi Mita, Shinsaku Hiura, Hirokazu Kato
! *
! * tm...@in...
! * shi...@sy...
! * ka...@sy...
! *
! * Revision: 4.1
! * Date: 01/12/07
! *
! *******************************************************/
#ifndef AR_PARAM_H
#define AR_PARAM_H
--- 1,32 ----
! /* --------------------------------------------------------------------------
! * Copyright (C) 2004 Hitlab NZ.
! * The distribution policy is describe on the Copyright.txt furnish
! * with this library.
! * -------------------------------------------------------------------------*/
! /**
! * \file param.h
! * \brief ARToolkit global structure (parameters) subroutines.
! *
! * This file contains principal routines for loading, saving, and modify
! * camera parameters for of ARToolkit library. Different structures are used
! * for modify in run-time this parameters in the library. A file structure
! * is use for input/output.
! * \remark
! *
! * History :
! *
! * \author Takeshi Mita tm...@in...
! * \author Shinsaku Hiura shi...@sy...
! * \author Hirokazu Kato ka...@sy...
!
! * \version 4.1
! * \date 01/12/07
! **/
! /* --------------------------------------------------------------------------
! * History :
! * Rev Date Who Changes
! *
! *----------------------------------------------------------------------------*/
!
#ifndef AR_PARAM_H
#define AR_PARAM_H
***************
*** 17,22 ****
--- 35,67 ----
#endif
+ // ============================================================================
+ // Public includes.
+ // ============================================================================
+
#include <AR/config.h>
+ // ============================================================================
+ // Public types and defines.
+ // ============================================================================
+
+ /** \struct ARParam
+ * \brief camera intrinsic parameters.
+ *
+ * this structure contains the main parameters for
+ * the intrinsic parameters of the camera
+ * representation. The camera used is a pinhole
+ * camera with standard parameters. User can
+ * report on Computer Vision Book for more informations.
+ * (like Three-Dimensional Computer Vision
+ * (Artificial Intelligence) by Olivier Faugeras).
+ * \param xsize length of the image (in pixels).
+ * \param ysize height of the image (in pixels).
+ * \param mat perspective matrix (K).
+ * \param dist_factor radial distorsions factor
+ * dist_factor[0]=x center of distorsion
+ * dist_factor[1]=y center of distorsion
+ * dist_factor[2]=distorsion factor
+ * dist_factor[3]=scale factor
+ */
typedef struct {
int xsize, ysize;
***************
*** 34,57 ****
} ARSParam;
int arParamGet( double global[][3], double screen[][2], int data_num,
double mat[3][4] );
int arParamDecomp( ARParam *source, ARParam *icpara, double trans[3][4] );
int arParamDecompMat( double source[3][4], double cpara[3][4], double trans[3][4] );
!
! int arParamIdeal2Observ( const double dist_factor[4], const double ix, const double iy,
double *ox, double *oy );
! int arParamObserv2Ideal( const double dist_factor[4], const double ox, const double oy,
double *ix, double *iy );
int arParamChangeSize( ARParam *source, int xsize, int ysize, ARParam *newparam );
int arParamSave( char *filename, int num, ARParam *param, ...);
! int arParamLoad( const char *filename, int num, ARParam *param, ...);
int arParamDisp( ARParam *param );
--- 79,198 ----
} ARSParam;
+ // ============================================================================
+ // Public globals.
+ // ============================================================================
+ // ============================================================================
+ // Public functions.
+ // ============================================================================
+ /** \fn int arParamGet( double global[][3], double screen[][2], int data_num,
+ double mat[3][4] )
+ * \brief XXXBK
+ *
+ * XXXBK
+ * \param global XXXBK
+ * \param screen XXXBK
+ * \param data_num XXXBK
+ * \param mat XXXBK
+ * \return XXXBK
+ */
int arParamGet( double global[][3], double screen[][2], int data_num,
double mat[3][4] );
+ /** \fn int arParamDecomp( ARParam *source, ARParam *icpara, double trans[3][4] )
+ * \brief XXXBK
+ *
+ * XXXBK
+ * \param source XXXBK
+ * \param icpara XXXBK
+ * \param trans XXXBK
+ * \return XXXBK
+ */
int arParamDecomp( ARParam *source, ARParam *icpara, double trans[3][4] );
+ /** \fn int arParamDecompMat( double source[3][4], double cpara[3][4], double trans[3][4] )
+ * \brief XXXBK
+ *
+ * XXXBK
+ * \param source XXXBK
+ * \param cpara XXXBK
+ * \param trans XXXBK
+ * \return XXXBK
+ */
int arParamDecompMat( double source[3][4], double cpara[3][4], double trans[3][4] );
! /** \fn int arParamIdeal2Observ( double dist_factor[4], double ix, double iy,
! double *ox, double *oy )
! * \brief XXXBK
! *
! * XXXBK
! * \param dist_factor XXXBK
! * \param ix XXXBK
! * \param iy XXXBK
! * \param ox XXXBK
! * \param oy XXXBK
! * \return XXXBK
! */
! int arParamIdeal2Observ( double dist_factor[4], double ix, double iy,
double *ox, double *oy );
! /** \fn int arParamObserv2Ideal( double dist_factor[4], double ox, double oy,
! double *ix, double *iy )
! * \brief XXXBK
! *
! * XXXBK
! * \param dist_factor XXXBK
! * \param ox XXXBK
! * \param oy XXXBK
! * \param ix XXXBK
! * \param iy XXXBK
! * \return XXXBK
! */
! int arParamObserv2Ideal( double dist_factor[4], double ox, double oy,
double *ix, double *iy );
+ /** \fn int arParamChangeSize( ARParam *source, int xsize, int ysize, ARParam *newparam )
+ * \brief change the camera size parameters.
+ *
+ * Change the size variable in camera intrinsic parameters.
+ * \param source name of the source parameters structure
+ * \param xsize new length size
+ * \param ysize new height size
+ * \param newparam name of the destination parameters structure.
+ * \return 0
+ */
int arParamChangeSize( ARParam *source, int xsize, int ysize, ARParam *newparam );
+ /** \fn int arParamSave( char *filename, int num, ARParam *param, ...)
+ * \brief save a camera intrinsic parameters.
+ *
+ * Save manipulated camera intrinsic parameters in a file.
+ * \param filename name of the parameters file.
+ * \param num XXXBK
+ * \param param parameters to save
+ * \return 0 if success, -1 if Error (file not found, file structure problem)
+ */
int arParamSave( char *filename, int num, ARParam *param, ...);
!
! /** \fn int arParamLoad( char *filename, int num, ARParam *param, ...)
! * \brief load the camera intrinsic parameters.
! *
! * Load camera intrinsic parameters in the ARToolkit Library from
! * a file (itselft, a resulted output of calibration step).
! * \param filename name of the parameters file.
! * \param num XXXBK
! * \param param result of the loaded parameters
! * \return 0 if success, -1 if Error (file not found, file structure problem)
! */
! int arParamLoad( char *filename, int num, ARParam *param, ...);
!
! /** \fn int arParamDisp( ARParam *param )
! * \brief display parameters.
! *
! * Display the structure of the camera instrinsic parameters argument.
! * \param param structure to display
! * \return 0
! */
int arParamDisp( ARParam *param );
***************
*** 59,65 ****
--- 200,210 ----
int arsParamChangeSize( ARSParam *source, int xsize, int ysize, ARSParam *newparam );
+
int arsParamSave( char *filename, ARSParam *sparam );
+
int arsParamLoad( char *filename, ARSParam *sparam );
+
int arsParamDisp( ARSParam *sparam );
+
int arsParamGetMat( double matL[3][4], double matR[3][4],
double cparaL[3][4], double cparaR[3][4], double matL2R[3][4] );
***************
*** 68,70 ****
}
#endif
! #endif
--- 213,215 ----
}
#endif
! #endif
Index: config.h.in
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/config.h.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** config.h.in 4 Nov 2004 08:51:11 -0000 1.1.1.1
--- config.h.in 22 Nov 2004 02:11:05 -0000 1.2
***************
*** 1,201 ****
! #ifndef AR_CONFIG_H
! #define AR_CONFIG_H
!
! /*------------------------------------------------------------*/
! /* */
! /* For Linux, you should define one of below 3 input method */
! /* AR_INPUT_V4L: use of standard Video4Linux Library */
! /* AR_INPUT_DV: use of DV Camera */
! /* AR_INPUT_1394CAM: use of 1394 Digital Camara */
! /* */
! /*------------------------------------------------------------*/
! #ifdef __linux
! #undef AR_INPUT_V4L
! #undef AR_INPUT_DV
! #undef AR_INPUT_1394CAM
!
! # ifdef AR_INPUT_V4L
! # define AR_PIX_FORMAT_BGR
! # undef AR_PIX_FORMAT_BGRA
! # endif
!
! # ifdef AR_INPUT_DV
! # define AR_PIX_FORMAT_RGB
! # undef AR_PIX_FORMAT_BGRA
! # endif
!
! # ifdef AR_INPUT_1394CAM
! # define AR_PIX_FORMAT_RGB
! # endif
!
! # undef AR_BIG_ENDIAN
! # define AR_LITTLE_ENDIAN
! #endif
!
!
! /*------------------------------------------------------------*/
! /* For SGI */
! /*------------------------------------------------------------*/
! #ifdef __sgi
! # define AR_BIG_ENDIAN
! # undef AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_ABGR
! #endif
!
! /*------------------------------------------------------------*/
! /* For Windows */
! /*------------------------------------------------------------*/
! #ifdef _WIN32
! # undef AR_BIG_ENDIAN
! # define AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_BGRA
! #endif
!
! /*------------------------------------------------------------*/
! /* For Mac OS X */
! /*------------------------------------------------------------*/
! #ifdef __APPLE__
! # define AR_BIG_ENDIAN
! # undef AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_2vuy
! #endif
!
!
! /*------------------------------------------------------------*/
!
! #define AR_DRAW_BY_GL_DRAW_PIXELS 0
! #define AR_DRAW_BY_TEXTURE_MAPPING 1
! #define AR_DRAW_TEXTURE_FULL_IMAGE 0
! #define AR_DRAW_TEXTURE_HALF_IMAGE 1
! #define AR_IMAGE_PROC_IN_FULL 0
! #define AR_IMAGE_PROC_IN_HALF 1
! #define AR_FITTING_TO_IDEAL 0
! #define AR_FITTING_TO_INPUT 1
!
! #define AR_TEMPLATE_MATCHING_COLOR 0
! #define AR_TEMPLATE_MATCHING_BW 1
! #define AR_MATCHING_WITHOUT_PCA 0
! #define AR_MATCHING_WITH_PCA 1
! #define DEFAULT_TEMPLATE_MATCHING_MODE AR_TEMPLATE_MATCHING_COLOR
! #define DEFAULT_MATCHING_PCA_MODE AR_MATCHING_WITHOUT_PCA
!
!
! #ifdef __linux
! # ifdef AR_INPUT_V4L
! # define VIDEO_MODE_PAL 0
! # define VIDEO_MODE_NTSC 1
! # define VIDEO_MODE_SECAM 2
! # define DEFAULT_VIDEO_DEVICE "/dev/video0"
! # define DEFAULT_VIDEO_WIDTH 640
! # define DEFAULT_VIDEO_HEIGHT 480
! # define DEFAULT_VIDEO_CHANNEL 1
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_NTSC
! # endif
!
! # ifdef AR_INPUT_DV
! # define VIDEO_MODE_PAL 0
! # define VIDEO_MODE_NTSC 1
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_NTSC
! # endif
!
! # ifdef AR_INPUT_1394CAM
! #undef DRAGONFLY
! # define VIDEO_NODE_ANY -1
! # define VIDEO_MODE_320x240_YUV422 32
! # define VIDEO_MODE_640x480_YUV411 33
! # define VIDEO_MODE_640x480_RGB 34
! # define VIDEO_MODE_640x480_YUV411_HALF 35
! # define VIDEO_MODE_640x480_MONO 36
! # define VIDEO_MODE_640x480_MONO_COLOR 37
! # define VIDEO_MODE_640x480_MONO_COLOR_HALF 38
! # define VIDEO_FRAME_RATE_1_875 1
! # define VIDEO_FRAME_RATE_3_75 2
! # define VIDEO_FRAME_RATE_7_5 3
! # define VIDEO_FRAME_RATE_15 4
! # define VIDEO_FRAME_RATE_30 5
! # define VIDEO_FRAME_RATE_60 6
! # define DEFAULT_VIDEO_NODE VIDEO_NODE_ANY
! # ifndef DRAGONFLY
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_640x480_YUV411_HALF
! # else
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_640x480_MONO_COLOR_HALF
! # endif
! # define DEFAULT_VIDEO_FRAME_RATE VIDEO_FRAME_RATE_30
! # endif
!
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_HALF
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_IDEAL
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_TEXTURE_MAPPING
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_HALF_IMAGE
! #endif
!
! #ifdef __sgi
! # define VIDEO_FULL 0
! # define VIDEO_HALF 1
! # define DEFAULT_VIDEO_SIZE VIDEO_FULL
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_HALF
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_INPUT
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_GL_DRAW_PIXELS
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_HALF_IMAGE
! #endif
!
! #ifdef _WIN32
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_FULL
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_INPUT
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_GL_DRAW_PIXELS
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_FULL_IMAGE
! #endif
!
! #ifdef __APPLE__
! # define DEFAULT_VIDEO_WIDTH 640
! # define DEFAULT_VIDEO_HEIGHT 480
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_HALF
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_IDEAL
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_TEXTURE_MAPPING
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_FULL_IMAGE
! #undef APPLE_TEXTURE_FAST_TRANSFER
! #endif
!
!
! /* For NVIDIA OpenGL Driver */
! #undef AR_OPENGL_TEXTURE_RECTANGLE
!
!
!
! #if defined(AR_PIX_FORMAT_ABGR) || defined(AR_PIX_FORMAT_BGRA) || defined(AR_PIX_FORMAT_RGBA) || defined(AR_PIX_FORMAT_ARGB)
! # define AR_PIX_SIZE 4
! #elif defined(AR_PIX_FORMAT_BGR) || defined(AR_PIX_FORMAT_RGB)
! # define AR_PIX_SIZE 3
! #elif defined(AR_PIX_FORMAT_2vuy) || defined(AR_PIX_FORMAT_yuvs)
! # define AR_PIX_SIZE 2
! #else
! # error Unknown pixel format defined in config.h.
! #endif
!
!
! #define AR_GET_TRANS_MAT_MAX_LOOP_COUNT 5
! #define AR_GET_TRANS_MAT_MAX_FIT_ERROR 1.0
! #define AR_GET_TRANS_CONT_MAT_MAX_FIT_ERROR 1.0
!
! #define AR_AREA_MAX 100000
! #define AR_AREA_MIN 70
!
!
! #define AR_SQUARE_MAX 30
! #define AR_CHAIN_MAX 10000
! #define AR_PATT_NUM_MAX 50
! #define AR_PATT_SIZE_X 16
! #define AR_PATT_SIZE_Y 16
! #define AR_PATT_SAMPLE_NUM 64
!
! #define AR_GL_CLIP_NEAR 50.0
! #define AR_GL_CLIP_FAR 5000.0
!
! #define AR_HMD_XSIZE 640
! #define AR_HMD_YSIZE 480
!
! #define AR_PARAM_NMIN 6
! #define AR_PARAM_NMAX 1000
! #define AR_PARAM_C34 100.0
!
! #endif
--- 1,205 ----
! #ifndef AR_CONFIG_H
! #define AR_CONFIG_H
!
! /*------------------------------------------------------------*/
! /* */
! /* For Linux, you should define one of below 3 input method */
! /* AR_INPUT_V4L: use of standard Video4Linux Library */
! /* AR_INPUT_DV: use of DV Camera */
! /* AR_INPUT_1394CAM: use of 1394 Digital Camara */
! /* */
! /*------------------------------------------------------------*/
! #ifdef __linux
! #undef AR_INPUT_V4L
! #undef AR_INPUT_DV
! #undef AR_INPUT_1394CAM
!
! # ifdef AR_INPUT_V4L
! # ifdef USE_EYETOY
! # define AR_PIX_FORMAT_RGB
! # else
! # define AR_PIX_FORMAT_BGR
! # endif
! # undef AR_PIX_FORMAT_BGRA
! # endif
!
! # ifdef AR_INPUT_DV
! # define AR_PIX_FORMAT_RGB
! # undef AR_PIX_FORMAT_BGRA
! # endif
!
! # ifdef AR_INPUT_1394CAM
! # define AR_PIX_FORMAT_RGB
! # endif
!
! # undef AR_BIG_ENDIAN
! # define AR_LITTLE_ENDIAN
! #endif
!
!
! /*------------------------------------------------------------*/
! /* For SGI */
! /*------------------------------------------------------------*/
! #ifdef __sgi
! # define AR_BIG_ENDIAN
! # undef AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_ABGR
! #endif
!
! /*------------------------------------------------------------*/
! /* For Windows */
! /*------------------------------------------------------------*/
! #ifdef _WIN32
! # undef AR_BIG_ENDIAN
! # define AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_BGRA
! #endif
!
! /*------------------------------------------------------------*/
! /* For Mac OS X */
! /*------------------------------------------------------------*/
! #ifdef __APPLE__
! # define AR_BIG_ENDIAN
! # undef AR_LITTLE_ENDIAN
! # define AR_PIX_FORMAT_2vuy
! #endif
!
!
! /*------------------------------------------------------------*/
!
! #define AR_DRAW_BY_GL_DRAW_PIXELS 0
! #define AR_DRAW_BY_TEXTURE_MAPPING 1
! #define AR_DRAW_TEXTURE_FULL_IMAGE 0
! #define AR_DRAW_TEXTURE_HALF_IMAGE 1
! #define AR_IMAGE_PROC_IN_FULL 0
! #define AR_IMAGE_PROC_IN_HALF 1
! #define AR_FITTING_TO_IDEAL 0
! #define AR_FITTING_TO_INPUT 1
!
! #define AR_TEMPLATE_MATCHING_COLOR 0
! #define AR_TEMPLATE_MATCHING_BW 1
! #define AR_MATCHING_WITHOUT_PCA 0
! #define AR_MATCHING_WITH_PCA 1
! #define DEFAULT_TEMPLATE_MATCHING_MODE AR_TEMPLATE_MATCHING_COLOR
! #define DEFAULT_MATCHING_PCA_MODE AR_MATCHING_WITHOUT_PCA
!
!
! #ifdef __linux
! # ifdef AR_INPUT_V4L
! # define VIDEO_MODE_PAL 0
! # define VIDEO_MODE_NTSC 1
! # define VIDEO_MODE_SECAM 2
! # define DEFAULT_VIDEO_DEVICE "/dev/video0"
! # define DEFAULT_VIDEO_WIDTH 640
! # define DEFAULT_VIDEO_HEIGHT 480
! # define DEFAULT_VIDEO_CHANNEL 1
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_NTSC
! # endif
!
! # ifdef AR_INPUT_DV
! # define VIDEO_MODE_PAL 0
! # define VIDEO_MODE_NTSC 1
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_NTSC
! # endif
!
! # ifdef AR_INPUT_1394CAM
! #undef DRAGONFLY
! # define VIDEO_NODE_ANY -1
! # define VIDEO_MODE_320x240_YUV422 32
! # define VIDEO_MODE_640x480_YUV411 33
! # define VIDEO_MODE_640x480_RGB 34
! # define VIDEO_MODE_640x480_YUV411_HALF 35
! # define VIDEO_MODE_640x480_MONO 36
! # define VIDEO_MODE_640x480_MONO_COLOR 37
! # define VIDEO_MODE_640x480_MONO_COLOR_HALF 38
! # define VIDEO_FRAME_RATE_1_875 1
! # define VIDEO_FRAME_RATE_3_75 2
! # define VIDEO_FRAME_RATE_7_5 3
! # define VIDEO_FRAME_RATE_15 4
! # define VIDEO_FRAME_RATE_30 5
! # define VIDEO_FRAME_RATE_60 6
! # define DEFAULT_VIDEO_NODE VIDEO_NODE_ANY
! # ifndef DRAGONFLY
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_640x480_YUV411_HALF
! # else
! # define DEFAULT_VIDEO_MODE VIDEO_MODE_640x480_MONO_COLOR_HALF
! # endif
! # define DEFAULT_VIDEO_FRAME_RATE VIDEO_FRAME_RATE_30
! # endif
!
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_HALF
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_IDEAL
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_TEXTURE_MAPPING
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_HALF_IMAGE
! #endif
!
! #ifdef __sgi
! # define VIDEO_FULL 0
! # define VIDEO_HALF 1
! # define DEFAULT_VIDEO_SIZE VIDEO_FULL
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_HALF
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_INPUT
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_GL_DRAW_PIXELS
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_HALF_IMAGE
! #endif
!
! #ifdef _WIN32
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_FULL
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_INPUT
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_GL_DRAW_PIXELS
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_FULL_IMAGE
! #endif
!
! #ifdef __APPLE__
! # define DEFAULT_VIDEO_WIDTH 640
! # define DEFAULT_VIDEO_HEIGHT 480
! # define DEFAULT_IMAGE_PROC_MODE AR_IMAGE_PROC_IN_HALF
! # define DEFAULT_FITTING_MODE AR_FITTING_TO_IDEAL
! # define DEFAULT_DRAW_MODE AR_DRAW_BY_TEXTURE_MAPPING
! # define DEFAULT_DRAW_TEXTURE_IMAGE AR_DRAW_TEXTURE_FULL_IMAGE
! #undef APPLE_TEXTURE_FAST_TRANSFER
! #endif
!
!
! /* For NVIDIA OpenGL Driver */
! #undef AR_OPENGL_TEXTURE_RECTANGLE
!
!
!
! #if defined(AR_PIX_FORMAT_ABGR) || defined(AR_PIX_FORMAT_BGRA) || defined(AR_PIX_FORMAT_RGBA) || defined(AR_PIX_FORMAT_ARGB)
! # define AR_PIX_SIZE 4
! #elif defined(AR_PIX_FORMAT_BGR) || defined(AR_PIX_FORMAT_RGB)
! # define AR_PIX_SIZE 3
! #elif defined(AR_PIX_FORMAT_2vuy) || defined(AR_PIX_FORMAT_yuvs)
! # define AR_PIX_SIZE 2
! #else
! # error Unknown pixel format defined in config.h.
! #endif
!
!
! #define AR_GET_TRANS_MAT_MAX_LOOP_COUNT 5
! #define AR_GET_TRANS_MAT_MAX_FIT_ERROR 1.0
! #define AR_GET_TRANS_CONT_MAT_MAX_FIT_ERROR 1.0
!
! #define AR_AREA_MAX 100000
! #define AR_AREA_MIN 70
!
!
! #define AR_SQUARE_MAX 30
! #define AR_CHAIN_MAX 10000
! #define AR_PATT_NUM_MAX 50
! #define AR_PATT_SIZE_X 16
! #define AR_PATT_SIZE_Y 16
! #define AR_PATT_SAMPLE_NUM 64
!
! #define AR_GL_CLIP_NEAR 50.0
! #define AR_GL_CLIP_FAR 5000.0
!
! #define AR_HMD_XSIZE 640
! #define AR_HMD_YSIZE 480
!
! #define AR_PARAM_NMIN 6
! #define AR_PARAM_NMAX 1000
! #define AR_PARAM_C34 100.0
!
! #endif
Index: matrix.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/matrix.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** matrix.h 4 Nov 2004 08:51:15 -0000 1.1.1.1
--- matrix.h 22 Nov 2004 02:11:05 -0000 1.2
***************
*** 1,7 ****
! /*******************************************************
! * matrix.h matrix handring library header
! *
! *
! *******************************************************/
#ifndef AR_MATRIX_H
#define AR_MATRIX_H
--- 1,30 ----
! /* --------------------------------------------------------------------------
! * Copyright (C) 2004 Hitlab NZ.
! * The distribution policy is describe on the Copyright.txt furnish
! * with this library.
! * -------------------------------------------------------------------------*/
! /**
! * \file matrix.h
! * \brief ARToolkit algebric mathematics subroutines.
! *
! * This package include matrix, vector manipulation routine. In complement
! * to must classical routines (inversion, innerproduct), it includes a PCA (Principal)
! * Component Analysis) routine.
! * For the structure of the matrix see ARMat.
! * \remark
! *
! * History :
! *
! * \author Hirokazu Kato ka...@sy...
! * \version
! * \date
! *
! **/
! /* --------------------------------------------------------------------------
! * History :
! * Rev Date Who Changes
! *
! *----------------------------------------------------------------------------*/
!
#ifndef AR_MATRIX_H
#define AR_MATRIX_H
***************
*** 10,17 ****
--- 33,47 ----
#endif
+ // ============================================================================
+ // Public includes.
+ // ============================================================================
#include <math.h>
#include <AR/config.h>
+ // ============================================================================
+ // Public types and defines.
+ // ============================================================================
+
/* === matrix definition ===
***************
*** 25,28 ****
--- 55,74 ----
=========================== */
+ /** \struct ARMat
+ * \brief matrix structure.
+ *
+ * Defined the structure of the matrix type based on a dynamic allocation.
+ * The matrix format is :<br>
+ * <---- clm ---><br>
+ * [ 10 20 30 ] ^<br>
+ * [ 20 10 15 ] |<br>
+ * [ 12 23 13 ] row<br>
+ * [ 20 10 15 ] |<br>
+ * [ 13 14 15 ] v<br>
+ *
+ * \param m content of matrix
+ * \param row number of lines in matrix
+ * \param clm number of column in matrix
+ */
typedef struct {
double *m;
***************
*** 31,34 ****
--- 77,90 ----
} ARMat;
+ /** \struct ARVec
+ * \brief vector structure.
+ *
+ * The vector format is :<br>
+ * <---- clm ---><br>
+ * [ 10 20 30 ]<br>
+ * Defined the structure of the vector type based on a dynamic allocation.
+ * \param m content of vector
+ * \param clm number of column in matrix
+ */
typedef struct {
double *v;
***************
*** 36,79 ****
} ARVec;
!
/* 0 origin */
#define ARELEM0(mat,r,c) ((mat)->m[(r)*((mat)->clm)+(c)])
/* 1 origin */
#define ARELEM1(mat,row,clm) ARELEM0(mat,row-1,clm-1)
ARMat *arMatrixAlloc(int row, int clm);
int arMatrixFree(ARMat *m);
int arMatrixDup(ARMat *dest, ARMat *source);
ARMat *arMatrixAllocDup(ARMat *source);
int arMatrixUnit(ARMat *unit);
ARMat *arMatrixAllocUnit(int dim);
int arMatrixMul(ARMat *dest, ARMat *a, ARMat *b);
ARMat *arMatrixAllocMul(ARMat *a, ARMat *b);
int arMatrixTrans(ARMat *dest, ARMat *source);
ARMat *arMatrixAllocTrans(ARMat *source);
int arMatrixInv(ARMat *dest, ARMat *source);
int arMatrixSelfInv(ARMat *m);
ARMat *arMatrixAllocInv(ARMat *source);
double arMatrixDet(ARMat *m);
int arMatrixPCA( ARMat *input, ARMat *evec, ARVec *ev, ARVec *mean );
int arMatrixPCA2( ARMat *input, ARMat *evec, ARVec *ev );
int arMatrixDisp(ARMat *m);
!
ARVec *arVecAlloc( int clm );
int arVecFree( ARVec *v );
int arVecDisp( ARVec *v );
double arVecHousehold( ARVec *x );
double arVecInnerproduct( ARVec *x, ARVec *y );
int arVecTridiagonalize( ARMat *a, ARVec *d, ARVec *e );
--- 92,359 ----
} ARVec;
! /** \def ARELEM0(mat,r,c)
! * \brief macro function that give direct access to an element (0 origin)
! *
! *
! */
/* 0 origin */
#define ARELEM0(mat,r,c) ((mat)->m[(r)*((mat)->clm)+(c)])
+
+ /** \def ARELEM1(mat,row,clm)
+ * \brief macro function that give direct access to an element (1 origin)
+ *
+ *
+ */
/* 1 origin */
#define ARELEM1(mat,row,clm) ARELEM0(mat,row-1,clm-1)
+ // ============================================================================
+ // Public globals.
+ // ============================================================================
+ // ============================================================================
+ // Public functions.
+ // ============================================================================
+ /** \fn ARMat *arMatrixAlloc(int row, int clm)
+ * \brief creates a new matrix.
+ *
+ * Allocate and initialize a new matrix structure.
+ * XXXBK initializing ?? to 0 m ??
+ * \param row number of line
+ * \param clm number of column
+ * \return the matrix structure, NULL if allocation is impossible
+ */
ARMat *arMatrixAlloc(int row, int clm);
+
+ /** \fn int arMatrixFree(ARMat *m)
+ * \brief deletes a matrix.
+ *
+ * Delete a matrix structure (deallocate used memory).
+ * \param m matrix to delete
+ * \return 0
+ */
int arMatrixFree(ARMat *m);
+ /** \fn int arMatrixDup(ARMat *dest, ARMat *source)
+ * \brief copy a matrix
+ *
+ * copy one matrix to another. The two ARMat must
+ * be allocate
+ * \param dest the destination matrix of the copy
+ * \param source the original matrix source
+ * \return 0 if success, -1 if error (matrix with different size)
+ */
int arMatrixDup(ARMat *dest, ARMat *source);
+
+ /** \fn ARMat *arMatrixAllocDup(ARMat *source)
+ * \brief dumps a new matrix
+ *
+ * Allocates and recopy the original source matrix.
+ * \param source the source matrix to copy
+ * \return the matrix if success, NULL if error
+ */
ARMat *arMatrixAllocDup(ARMat *source);
+ /** \fn int arMatrixUnit(ARMat *unit)
+ * \brief Creates a unit matrix.
+ *
+ * Transforms the source parameter matrix to
+ * a unit matrix (all values are modified).
+ * the unit matrix needs to be allocated.
+ * \param unit the matrix to transform
+ * \return 0 if success, -1 if error
+ */
int arMatrixUnit(ARMat *unit);
+
+ /** \fn int arMatrixAllocUnit(int dim)
+ * \brief Creates a unit matrix.
+ *
+ * Allocates and initializes a matrix to a
+ * a unit matrix.
+ * \param dim dimensions of the unit matrix (square)
+ * \return the matrix allocated if success, NULL if error
+ */
ARMat *arMatrixAllocUnit(int dim);
+ /** \fn int arMatrixMul(ARMat *dest, ARMat *a, ARMat *b)
+ * \brief Multiply two matrix
+ *
+ * Multiply two matrix and copy the result in another
+ * the product is this one : dest = a * b. The destination
+ * matrix must be allocated. Matrix a and b need to have
+ * the same size (the source matrix is unmodified).
+ * \param dest final matrix product
+ * \param a first matrix
+ * \param b second matrix
+ * \return 0 if success, -1 if error
+ */
int arMatrixMul(ARMat *dest, ARMat *a, ARMat *b);
+
+ /** \fn ARMat *arMatrixAllocMul(ARMat *a, ARMat *b)
+ * \brief Multiply two matrix with memory allocation.
+ *
+ * multiply two matrix and copy the result in a new
+ * allocate matrix (the source matrix is unmodified).
+ * the product is this one : dest = a * b
+ *
+ * \param a first matrix
+ * \param b second matrix
+ * \return the allocated matrix if success, NULL if error
+ */
ARMat *arMatrixAllocMul(ARMat *a, ARMat *b);
+ /** \fn int arMatrixTrans(ARMat *dest, ARMat *source)
+ * \brief transposes a matrix.
+ *
+ * Transposes a matrix. The destination matrix
+ * must be allocated (the source matrix is unmodified).
+ * \param dest the destination matrix of the copy
+ * \param source the source matrix
+ * \return 0 if success, -1 if error
+ */
int arMatrixTrans(ARMat *dest, ARMat *source);
+
+ /** \fn ARMat *arMatrixAllocTrans(ARMat *source)
+ * \brief transposes a matrix with allocation.
+ *
+ * transposes a matrix and copy the result in a new
+ * allocate matrix (the source matrix is unmodified).
+ * \param source the matrix to transpose
+ * \return the allocated matrix if success, NULL if error
+ */
ARMat *arMatrixAllocTrans(ARMat *source);
+ /** \fn int arMatrixInv(ARMat *dest, ARMat *source)
+ * \brief inverse a matrix.
+ *
+ * inverse a matrix and copy the result in a new
+ * one (the source matrix is unmodified). the destination
+ * matrix must be allocated. the source matrix need to be a
+ * square matrix.
+ * \param dest result matrix of the inverse operation
+ * \param source source matrix
+ * \return 0 if success, -1 if error
+ */
int arMatrixInv(ARMat *dest, ARMat *source);
+
+ /** \fn int arMatrixSelfInv(ARMat *m)
+ * \brief inverses a matrix.
+ *
+ * Inverses a matrix and copy the result in
+ * the same structure.
+ * \param m the matrix to inverse
+ * \return 0 if success, -1 if error
+ */
int arMatrixSelfInv(ARMat *m);
+
+ /** \fn int arMatrixAllocInv(ARMat *source)
+ * \brief inverses a matrix.
+ *
+ * Inverses a matrix and copy the result in
+ * in a new allocated structure.
+ * \param source the matrix to inverse
+ * \return the inversed matrix if success, NULL if error
+ */
ARMat *arMatrixAllocInv(ARMat *source);
+ /** \fn int arMatrixDet(ARMat *m)
+ * \brief compute determinant of a matrix.
+ *
+ * Compute the determinant of a matrix.
+ * \param m matrix source
+ * \return the computed determinant
+ */
double arMatrixDet(ARMat *m);
+ /** \fn int arMatrixPCA( ARMat *input, ARMat *evec, ARVec *ev, ARVec *mean )
+ * \brief compute the PCA of a matrix.
+ *
+ * XXXBK
+ * \param input XXXBK
+ * \param evec XXXBK
+ * \param ev XXXBK
+ * \param mean XXXBK
+ * \return XXXBK
+ */
int arMatrixPCA( ARMat *input, ARMat *evec, ARVec *ev, ARVec *mean );
+
+ /** \fn int arMatrixPCA2( ARMat *input, ARMat *evec, ARVec *ev )
+ * \brief compute the PCA of a matrix.
+ *
+ * XXXBK
+ * \param input XXXBK
+ * \param evec XXXBK
+ * \param ev XXXBK
+ * \return XXXBK
+ */
int arMatrixPCA2( ARMat *input, ARMat *evec, ARVec *ev );
+ /** \fn int arMatrixDisp(ARMat *m)
+ * \brief display content of a matrix.
+ *
+ * Display in current console, the content of
+ * the matrix. The display is done line by line.
+ * \param m
+ * \return 0
+ */
int arMatrixDisp(ARMat *m);
! /** \fn ARVec *arVecAlloc( int clm )
! * \brief creates a new vector.
! *
! * Allocates and initializes new vector structure.
! * \param clm dimension of vector
! * \return the allocated vector, NULL if error
! */
ARVec *arVecAlloc( int clm );
+
+ /** \fn int arVecFree( ARVec *v )
+ * \brief delete a vector.
+ *
+ * Delete a vector structure (deallocate used memory).
+ * \param v vector to delete
+ * \return 0
+ */
int arVecFree( ARVec *v );
+
+ /** \fn int arVecDisp( ARVec *v )
+ * \brief display a vector.
+ *
+ * Display element of a vector.
+ * \param v the vector to display
+ * \return 0
+ */
int arVecDisp( ARVec *v );
+
+ /** \fn double arVecHousehold( ARVec *x )
+ * \brief XXXBK
+ *
+ * XXXBK: for QR decomposition ?? (can't success to find french translation of this term)
+ * \param x XXXBK
+ * \return XXXBK
+ */
double arVecHousehold( ARVec *x );
+
+ /** \fn double arVecInnerproduct( ARVec *x, ARVec *y )
+ * \brief Computes the inner product of 2 vectors.
+ *
+ * computes the inner product of the two argument vectors.
+ * the operation done is a=x.y (and a is return)
+ * \param x first vector source
+ * \param y second vector source
+ * \return the computed innerproduct
+ */
double arVecInnerproduct( ARVec *x, ARVec *y );
+
+ /** \fn int arVecTridiagonalize( ARMat *a, ARVec *d, ARVec *e )
+ * \brief XXXBK
+ *
+ * XXXBK
+ * \param a XXXBK
+ * \param d XXXBK
+ * \param e XXXBK
+ * \return XXXBK
+ */
int arVecTridiagonalize( ARMat *a, ARVec *d, ARVec *e );
***************
*** 83,84 ****
--- 363,365 ----
#endif
#endif
+
Index: gsubUtil.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/gsubUtil.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** gsubUtil.h 4 Nov 2004 08:51:14 -0000 1.1.1.1
--- gsubUtil.h 22 Nov 2004 02:11:05 -0000 1.2
***************
*** 1,15 ****
! #ifndef AR_GSUB_UTIL_H
! #define AR_GSUB_UTIL_H
! #ifdef __cplusplus
! extern "C" {
! #endif
! #include <AR/param.h>
! void argUtilCalibHMD( int targetId, int thresh2,
! void (*postFunc)(ARParam *lpara, ARParam *rpara) );
! #ifdef __cplusplus
! }
! #endif
! #endif
--- 1,70 ----
! /* --------------------------------------------------------------------------
! * Copyright (C) 2004 Hitlab NZ.
! * The distribution policy is describe on the Copyright.txt furnish
! * with this library.
! * -------------------------------------------------------------------------*/
! /**
! * \file gsubUtil.h
! * \brief ARToolkit OpenGL utilities subroutines.
! *
! * Complement routines of gsub module.
! * \remark
! *
! * History :
! *
! * \author Hirokazu Kato ka...@sy...
! * \version
! * \date
! **/
! /* --------------------------------------------------------------------------
! * History :
! * Rev Date Who Changes
! *
! *----------------------------------------------------------------------------*/
! #ifndef AR_GSUB_UTIL_H
! #define AR_GSUB_UTIL_H
! #ifdef __cplusplus
! extern "C" {
! #endif
!
! // ============================================================================
! // Public includes.
! // ============================================================================
!
! #include <AR/param.h>
!
! // ============================================================================
! // Public types and defines.
! // ============================================================================
! // ============================================================================
! // Public globals.
! // ============================================================================
! // ============================================================================
! // Public functions.
! // ============================================================================
! /** \fn void argUtilCalibHMD( int targetId, int thresh2,
! void (*postFunc)(ARParam *lpara, ARParam *rpara) )
! * \brief utility function for calibrate an HMD.
! *
! * This function offers a full calibration run-time routines for an optical HMD (mono
! * or stereo).
! * It is useful for estimate transformation between user eye position and
! * camera position. You will find more informations on the calibration routine
! * on opticalcalibration.html .This function modify gsub state of left and right camera
! * intrinsic parameters.
! * \param targetId the target used for the calibration step.
! * \param thresh2 lighting threshold value to use
! * \param postFunc a callback function used to analysis computed internal camera
! * parameters. if your application is mono display, only lpara contains a value.
! * lpara and rpara are NULL if the calibration failed.
! */
! void argUtilCalibHMD( int targetId, int thresh2,
! void (*postFunc)(ARParam *lpara, ARParam *rpara) );
!
! #ifdef __cplusplus
! }
! #endif
! #endif
Index: video.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/video.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** video.h 4 Nov 2004 08:51:15 -0000 1.1.1.1
--- video.h 22 Nov 2004 02:11:05 -0000 1.2
***************
*** 1,126 ****
! /*
! *
! * Author: Hirokazu Kato, Atsishi Nakazawa.
! * Modified by Thomas Pintaric.
! *
! *
! * ka...@sy...
! * nak...@in...
! * pin...@im...
! *
! * Revision: 4.3b
! * Date: 2003/02/02
! *
! */
! /*
! * Copyright (c) 2004-2004 Philip Lamb (PRL) ph...@ed.... All rights reserved.
! *
! * Rev Date Who Changes
! * 2.6.8 2004-07-20 PRL Rewrite for ARToolKit 2.68.2
! *
! */
! /*
! *
! * This file is part of ARToolKit.
! *
! * ARToolKit is free software; you can redistribute it and/or modify
! * it under the terms of the GNU General Public License as published by
! * the Free Software Foundation; either version 2 of the License, or
! * (at your option) any later version.
! *
! * ARToolKit is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
! *
! * You should have received a copy of the GNU General Public License
! * along with ARToolKit; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! *
! */
!
! #ifndef AR_VIDEO_H
! #define AR_VIDEO_H
!
! #ifdef __cplusplus
! extern "C" {
! #endif
!
! #include <AR/config.h>
! #include <AR/ar.h>
!
! #ifdef _WIN32
! # include <AR/sys/videoWin32DirectShow.h>
! # ifdef LIBARVIDEO_EXPORTS
! # define AR_DLL_API __declspec(dllexport)
! # else
! # ifdef _DLL
! # define AR_DLL_API __declspec(dllimport)
! # else
! # define AR_DLL_API extern
! # endif
! # endif
! #else
! # define AR_DLL_API
! #endif
!
! #ifdef __linux
! # ifdef AR_INPUT_V4L
! # include <AR/sys/videoLinuxV4L.h>
! # endif
! # ifdef AR_INPUT_DV
! # include <AR/sys/videoLinuxDV.h>
! # endif
! # ifdef AR_INPUT_1394CAM
! # include <AR/sys/videoLinux1394Cam.h>
! # endif
! #endif
!
! #ifdef __sgi
! # include <AR/sys/videoSGI.h>
! #endif
!
! #ifdef __APPLE__
! # include <AR/sys/videoMacOSX.h>
! #endif
!
! AR_DLL_API int arVideoDispOption(void);
! AR_DLL_API int arVideoOpen(char *config);
! AR_DLL_API int arVideoClose(void);
! AR_DLL_API int arVideoCapStart(void);
! AR_DLL_API int arVideoCapStop(void);
! AR_DLL_API int arVideoCapNext(void);
! AR_DLL_API ARUint8* arVideoGetImage(void);
! AR_DLL_API int arVideoInqSize(int *x, int *y);
!
! AR_DLL_API int ar2VideoDispOption(void);
! AR_DLL_API AR2VideoParamT *ar2VideoOpen(char *config);
! AR_DLL_API int ar2VideoClose(AR2VideoParamT *vid);
! AR_DLL_API int ar2VideoCapStart(AR2VideoParamT *vid);
! AR_DLL_API int ar2VideoCapNext(AR2VideoParamT *vid);
! AR_DLL_API int ar2VideoCapStop(AR2VideoParamT *vid);
! AR_DLL_API ARUint8 *ar2VideoGetImage(AR2VideoParamT *vid);
! AR_DLL_API int ar2VideoInqSize(AR2VideoParamT *vid, int *x, int *y);
!
! // Functions added for Studierstube/OpenTracker.
! #ifdef _WIN32
! # ifndef __MEMORY_BUFFER_HANDLE__
! # define __MEMORY_BUFFER_HANDLE__
! # define DEFAULT_NUMBER_OF_ALLOCATOR_BUFFERS 3
! typedef struct _MemoryBufferHandle
! {
! unsigned long n; // sample number
! __int64 t; // timestamp
! } MemoryBufferHandle;
! # endif // __MEMORY_BUFFER_HANDLE__
! AR_DLL_API int ar2VideoInqFreq(AR2VideoParamT *vid, float *fps);
! AR_DLL_API int ar2VideoInqFlipping(AR2VideoParamT *vid, int *flipH, int *flipV);
! AR_DLL_API unsigned char *ar2VideoLockBuffer(AR2VideoParamT *vid, MemoryBufferHandle *pHandle);
! AR_DLL_API int ar2VideoUnlockBuffer(AR2VideoParamT *vid, MemoryBufferHandle Handle);
! #endif // _WIN32
!
! #ifdef __cplusplus
! }
! #endif
! #endif // AR_VIDEO_H
--- 1,327 ----
! /* --------------------------------------------------------------------------
! * Copyright (c) 2004-2004 Philip Lamb (PRL) ph...@ed.... All rights reserved.
! * This file is part of ARToolKit.
! *
! * ARToolKit is free software; you can redistribute it and/or modify
! * it under the terms of the GNU General Public License as published by
! * the Free Software Foundation; either version 2 of the License, or
! * (at your option) any later version.
! *
! * ARToolKit is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU General Public License for more details.
! *
! * You should have received a copy of the GNU General Public License
! * along with ARToolKit; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! * -------------------------------------------------------------------------*/
! /**
! * \file video.h
! * \brief ARToolkit video subroutines.
! *
! * This component furnishs a multi-platform video support for ARToolkit.
! * It provides access to hardware video input available on different machines, OS.
! * For each platform a specific sub-component have been implemented, unified in the
! * same interface (with the prefix function name arVideoXXX).
! *
! * The actual supported platforms (and the driver/library used) are:
! * - Windows: with DirectShow (VFW obsolete).
! * - Linux: with V4L, IEEE1394 Library.
! * - Macintosh: with QuickTime 6.
! * - SGI: with VL.
! *
! * This component have two separated interfaces according to your videos input
! * number:
! * - one single alone camera: used the <b>arXXX</b> functions (XXX template name).
! * - multiple camera: used the <b>ar2XXX</b> functions (XXX template name).
! *
! * More information are available on <a href="video.html">the video page</a>.
! *
! * \remark
! * the arXXX uses a global variable and wrap all calls to ar2XXX functions
! * - WINDOWS: only one camera is supported.
! *
! * History :
! * modified by Thomas Pintaric (pin...@im...) for adding
! * a fully transparent DirectShow Driver.
! *
! * \author Hirokazu Kato ka...@sy...
! * \author Atsishi Nakazawa nak...@in...
! * \author Thomas Pintaric pin...@im...
! * \version 4.3b
! * \date 03/02/02
! *
! *
! **/
! /* --------------------------------------------------------------------------
! * History :
! * Rev Date Who Changes
! * 2.6.8 2004-07-20 PRL Rewrite for ARToolKit 2.68.2
! *
! *----------------------------------------------------------------------------*/
!
! #ifndef AR_VIDEO_H
! #define AR_VIDEO_H
!
! #ifdef __cplusplus
! extern "C" {
! #endif
!
! // ============================================================================
! // Public includes.
! // ============================================================================
!
! #include <AR/config.h>
! #include <AR/ar.h>
!
! // ============================================================================
! // Public types and defines.
! // ============================================================================
!
! #ifdef _WIN32
! # include <AR/sys/videoWin32DirectShow.h>
! # ifdef LIBARVIDEO_EXPORTS
! # define AR_DLL_API __declspec(dllexport)
! # else
! # ifdef _DLL
! # define AR_DLL_API __declspec(dllimport)
! # else
! # define AR_DLL_API extern
! # endif
! # endif
! #else
! # define AR_DLL_API
! #endif
!
! #ifdef __linux
! # ifdef AR_INPUT_V4L
! # include <AR/sys/videoLinuxV4L.h>
! # endif
! # ifdef AR_INPUT_DV
! # include <AR/sys/videoLinuxDV.h>
! # endif
! # ifdef AR_INPUT_1394CAM
! # include <AR/sys/videoLinux1394Cam.h>
! # endif
! #endif
!
! #ifdef __sgi
! # include <AR/sys/videoSGI.h>
! #endif
!
! #ifdef __APPLE__
! # include <AR/sys/videoMacOSX.h>
! #endif
!
! // ============================================================================
! // Public globals.
! // ============================================================================
! // ============================================================================
! // Public functions.
! // ============================================================================
!
! /*
! mono-camera
! */
!
! /** \fn int arVideoDispOption( void )
! * \brief display the video option.
! *
! * According to your platform, output in the
! * standard console the video option available.
! * \return 0
! */
! AR_DLL_API int arVideoDispOption(void);
!
! /** \fn int arVideoOpen( char *config )
! * \brief open a video source.
! *
! * this function open a video input path with the
! * driver (and device) present on your platform.
! * According to your operating system and the
! * hardware the initialization will be different : a
! * generic string structure is used for this issue.
! * You can find all details in this <a href="videoconfig.html">
! * webpage</a>
! * \param config string of the selected video configuration.
! * \return 0 if successful, -1 if a video path couldnt be opened
! */
! AR_DLL_API int arVideoOpen(char *config);
!
! /** \fn int arVideoClose( void )
! * \brief close the video source.
! * a function that needs to be called in order to shut down the video capture
! * \return 0 if shut down successfully, otherwise 1.
! */
! AR_DLL_API int arVideoClose(void);
!
! /** \fn int arVideoCapStart( void )
! * \brief start the capture of video.
! *
! * This function start the video capture routine. According
! * to the architecture can start a video thread, call a specific
! * run-time function in the driver.
! * \remark this function coupled with arVideoCapStop, can
! * be call many times in your program (reduce the CPU load
! * when they stop for long and critical operations)
! * \return 0 if successful, -1 if the capture can't be start
! */
! AR_DLL_API int arVideoCapStart(void);
!
! /** \fn int arVideoCapStop( void )
! * \brief stop the capture of video.
! *
! * This function stop the video capture routine. According
! * to the architecture can stop a video thread, call a specific
! * run-time function in the driver.
! * \remark this function coupled with arVideoCapStart, can
! * be call many times in your program (reduce the CPU load
! * when they stop for long and critical operations)
! * \return 0 if successful, -1 if the capture can't be stop
! */
! AR_DLL_API int arVideoCapStop(void);
!
! /** \fn int arVideoCapNext( void )
! * \brief call for the next grabbed video frame.
! *
! * According to your platform, this function can
! * be have different effects. A call to the function
! * indicates that a new frame can be grabbed. The outcome
! * is you can't use more the last video frame. You need to
! * call this function after analysis the video image and
! * display it.
! *
! * \remark if your video grabber is multithread, this
! * function do nothing since a buffer is still available.
! * \return 0 if successful, -1 if the next grabbed frame can't be start
! */
! AR_DLL_API int arVideoCapNext(void);
!
! /** \fn ARUint8 *arVideoGetImage( void )
! * \brief get the video image.
! *
! * This function return a buffer with a captured video image.
! * XXXBK : do we need to delete the pointed area ?
! * is the area still available in the next call ?
! * \return a pointer to the captured video frame, or NULL if a frame isnt captured.
! */
! AR_DLL_API ARUint8* arVideoGetImage(void);
!
! /** \fn int arVideoInqSize( int *x, int *y )
! * \brief get the video image size.
! *
! * a function that returns the size of the captured video frame.
! * \param x a pointer to the length of the captured image
! * \param y a pointer to the width of the captured image
! * \return 0 if the dimensions are found successfully, otherwise 1
! */
! AR_DLL_API int arVideoInqSize(int *x, int *y);
!
! /*
! multiple cameras
! */
!
! /** \fn int ar2VideoDispOption ( void )
! * \brief display the video option (multiple video inputs)
! *
! * idem of arVideoDispOption for multiple video sources.
! * \return 0
! */
! AR_DLL_API int ar2VideoDispOption(void);
!
! /** \fn AR2VideoParamT *ar2VideoOpen ( char *config )
! * \brief open a video source (multiple video inputs)
! *
! * idem of arVideoOpen for multiple video sources (the selected
! * source in argument).
! * \param config string of the selected video configuration.
! * \return 0 if successful, -1 if a video path couldnt be opened
! */
! AR_DLL_API AR2VideoParamT *ar2VideoOpen(char *config);
!
! /** \fn int ar2VideoClose ( AR2VideoParamT *vid )
! * \brief close a video source (multiple video inputs)
! *
! * idem of arVideoClose for multiple video sources (the selected
! * source in argument).
! * \param vid a video handle structure for multi-camera grabbing
! * \return 0 if shut down successfully, otherwise 1.
! */
! AR_DLL_API int ar2VideoClose(AR2VideoParamT *vid);
!
! /** \fn int ar2VideoCapStart (AR2VideoParamT *vid )
! * \brief start the capture of a video source (multiple video inputs)
! *
! * idem of arVideoCapStart for multiple video sources (the selected
! * source in argument).
! * \param vid a video handle structure for multi-camera grabbing
! * \return 0 if successful, -1 if the capture can't be start
! */
! AR_DLL_API int ar2VideoCapStart(AR2VideoParamT *vid);
!
! /** \fn int ar2VideoCapNext ( AR2VideoParamT *vid )
! * \brief call for the next grabbed video frame of a video source (multiple video inputs)
! *
! * idem of arVideoCapNext for multiple video sources (the selected
! * source in argument).
! * \param vid a video handle structure for multi-camera grabbing
! * \return 0 if successful, -1 if the next grabbed frame can't be start
! */
! AR_DLL_API int ar2VideoCapNext(AR2VideoParamT *vid);
!
! /** \fn int ar2VideoCapStop ( AR2VideoParamT *vid )
! * \brief stop the capture of a video source (multiple video inputs)
! *
! * idem of arVideoCapStop for multiple video sources (the selected
! * source in argument).
! * \param vid a video handle structure for multi-camera grabbing
! * \return 0 if successful, -1 if the next grabbed frame can't be stop
! */
! AR_DLL_API int ar2VideoCapStop(AR2VideoParamT *vid);
!
! /** \fn int ar2VideoGetImage ( AR2VideoParamT *vid )
! * \brief get a video image from a video source (multiple video inputs)
! *
! * idem of arVideoGetImage for multiple video sources (the selected
! * source in argument).
! * \param vid a video handle structure for multi-camera grabbing
! * \return a pointer to the captured video frame, or NULL if a frame isnt captured.
! */
! AR_DLL_API ARUint8 *ar2VideoGetImage(AR2VideoParamT *vid);
!
! /** \fn int ar2VideoInqSize ( AR2VideoParamT *vid, int *x,int *y )
! * \brief get the video image size of a video source (multiple video inputs)
! *
! * idem of arVideoInqSize for multiple video sources (the selected
! * source in argument).
! * \param vid a video handle structure for multi-camera grabbing
! * \param x a pointer to the length of the captured image
! * \param y a pointer to the width of the captured image
! * \return 0 if the dimensions are found successfully, otherwise 1
! */
! AR_DLL_API int ar2VideoInqSize(AR2VideoParamT *vid, int *x, int *y);
!
! // Functions added for Studierstube/OpenTracker.
! #ifdef _WIN32
! # ifndef __MEMORY_BUFFER_HANDLE__
! # define __MEMORY_BUFFER_HANDLE__
! # define DEFAULT_NUMBER_OF_ALLOCATOR_BUFFERS 3
! typedef struct _MemoryBufferHandle
! {
! unsigned long n; // sample number
! __int64 t; // timestamp
! } MemoryBufferHandle;
! # endif // __MEMORY_BUFFER_HANDLE__
! AR_DLL_API int ar2VideoInqFreq(AR2VideoParamT *vid, float *fps);
! AR_DLL_API int ar2VideoInqFlipping(AR2VideoParamT *vid, int *flipH, int *flipV);
! AR_DLL_API unsigned char *ar2VideoLockBuffer(AR2VideoParamT *vid, MemoryBufferHandle *pHandle);
! AR_DLL_API int ar2VideoUnlockBuffer(AR2VideoParamT *vid, MemoryBufferHandle Handle);
! #endif // _WIN32
!
! #ifdef __cplusplus
! }
! #endif
!
! #endif // AR_VIDEO_H
Index: gsub.h
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/include/AR/gsub.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** gsub.h 4 Nov 2004 08:51:11 -0000 1.1.1.1
--- gsub.h 22 Nov 2004 02:11:05 -0000 1.2
***************
*** 1,45 ****
! #ifndef AR_GSUB_H
! #define AR_GSUB_H
! #ifdef __cplusplus
! extern "C" {
! #endif
!
!
! #include <AR/config.h>
! #include <AR/param.h>
! #include <AR/ar.h>
! extern int argDrawMode;
! extern int argTexmapMode;
! void argInit( ARParam *cparam, double zoom, int fullFlag, int xwin, int ywin, int hmd_flag );
! void argLoadHMDparam( ARParam *lparam, ARParam *rparam );
! void argCleanup( void );
! void argSwapBuffers( void );
! void argMainLoop( void (*mouseFunc)(int button, int state, int x, int y),
void (*keyFunc)(unsigned char key, int x, int y),
! void (*mainFunc)(void) );
!
!
void argDrawMode2D( void );
void argDraw2dLeft( void );
void argDraw2dRight( void );
void argDrawMode3D( void );
void argDraw3dLeft( void );
- void argDraw3dRight( void );
- void argDraw3dCamera( int xwin, int ywin );
void argConvGlpara( double para[3][4], double gl_para[16] );
void argConvGLcpara( ARParam *param, double gnear, double gfar, double m[16] );
void argDispImage( ARUint8 *image, int xwin, int ywin );
void argDispHalfImage( ARUint8 *image, int xwin, int ywin );
void argDrawSquare( double vertex[4][2], int xwin, int ywin );
void argLineSeg( double x1, double y1, double x2, double y2, int xwin, int ywin );
void argLineSegHMD( double x1, double y1, double x2, double y2 );
void argInqSetting( int *hmdMode,
int *gMiniXnum2, int *gMiniYnum2,
--- 1,312 ----
! /* --------------------------------------------------------------------------
! * Copyright (C) 2004 Hitlab NZ.
! * The distribution policy is describe on the Copyright.txt furnish
! * with this library.
! * -------------------------------------------------------------------------*/
! /**
! * \file gsub.h
! * \brief ARToolkit OpenGL subroutines.
! *
! * This file contains the main display functions used in ARToolkit Library.
! * It contains wrapped functions of GLUT and openGL for doing real-time
! * rendering. This choice give us a large multi-platform support for the display
! * module of ARToolkit.
! * \remark The supported stereo mode is interleaved stereo mode (only for i-glasses display).
! *
! * History :
! *
! * \author Hirokazu Kato ka...@sy...
! * \version
! * \date
! **/
! /* --------------------------------------------------------------------------
! * History :
! * Rev Date Who Changes
! *
! *----------------------------------------------------------------------------*/
!
! #ifndef AR_GSUB_H
! #define AR_GSUB_H
! #ifdef __cplusplus
! extern "C" {
! #endif
!
! // ============================================================================
! // Public includes.
! // ============================================================================
!
! #include <AR/config.h>
! #include <AR/param.h>
! #include <AR/ar.h>
!
! // ============================================================================
! // Public types and defines.
! // ============================================================================
! // ============================================================================
! // Public globals.
! // ============================================================================
! /** \var int argDrawMode
! * \brief define the draw configuration mode.
! *
! * Define the draw mode for display of the video background.
! * The possible values are :
! * - AR_DRAW_BY_GL_DRAW_PIXELS: use the GL_DRAW_PIXELS function
! * - AR_DRAW_BY_TEXTURE_MAPPING: use a quad mesh with a texture mapping
! * of the video.
! * by default: DEFAULT_DRAW_MODE in config.h
! * \rem choice and performance depends on your hardware and your openGL driver.
! */
! extern int argDrawMode;
!
! /** \var int argTexmapMode
! * \brief define the texture map configuration mode.
! *
! * If the draw mode is AR_DRAW_BY_TEXTURE_MAPPING, you can
! * configure the copy mode of the texture mapping.
! * The possible values are :
! * - AR_DRAW_TEXTURE_FULL_IMAGE: texture mapping full resolution.
! * - AR_DRAW_TEXTURE_HALF_IMAGE: texture mapping half resolution.
! * by default: DEFAULT_DRAW_TEXTURE_IMAGE in config.h
! */
! extern int argTexmapMode;
!
! // ============================================================================
! // Public functions.
! // ========================...
[truncated message content] |