Main Page | Files | Data Structures | Functions | Global Variables |
include/gpiv/gpiv-cam.h
Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 c-style: "K&R" -*- */
00002 
00003 /*-----------------------------------------------------------------------------
00004    libgpiv - library for Particle Image Velocimetry
00005 
00006    Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Gerber van der Graaf
00007    <gerber_graaf@users.sourceforge.net>
00008 
00009    This file is part of libgpiv.
00010 
00011    Libgpiv is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; either version 2, or (at your option)
00014    any later version.
00015 
00016    This program is distributed in the hope that it will be useful,
00017    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019    GNU General Public License for more details.
00020 
00021    You should have received a copy of the GNU General Public License
00022    along with this program; if not, write to the Free Software Foundation,
00023    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
00024 
00025 
00026 
00027 
00028 -------------------------------------------------------------------------------
00029 LIBRARY:                libgpiv
00030 FILENAME:               cam.h
00031 SOURCE:                 cam.c
00032 EXTERNAL FUNCTIONS:
00033                         gpiv_cam_get_camvar
00034                         gpiv_cam_free_camvar
00035                         gpiv_cam_default_parameters
00036                         gpiv_cam_read_parameters
00037                         gpiv_cam_check_parameters_read
00038                         gpiv_cam_parameters_set
00039                         gpiv_cam_test_parameter
00040                         gpiv_cam_fprint_parameters
00041 
00042 ---------------------------------------------------------------------------- */
00043 
00052 #ifndef __LIBGPIV_CAM_H__
00053 #define __LIBGPIV_CAM_H__
00054 
00055 
00056 
00057 /*
00058  * Default values of CamPar
00059  */
00060 #define GPIV_CAMPAR_DEFAULT__MODE 1         
00061 #define GPIV_CAMPAR_DEFAULT__CYCLES 1       
00062 #define GPIV_CAMPAR_DEFAULT__FNAME "gpiv_img"   
00064 #define GPIV_CAMPAR_CYCLES_MIN 1 
00065 #define GPIV_CAMPAR_CYCLES_MAX 1 
00067 /*
00068  * Keys of CamPar to read values from configuration files
00069  */
00070 #define GPIV_CAMPAR_KEY "CAM"            
00071 #define GPIV_CAMPAR_KEY__MODE "Mode"     
00072 #define GPIV_CAMPAR_KEY__CYCLES "Cycles" 
00073 #define GPIV_CAMPAR_KEY__FNAME "Fname"   
00075 #define GPIV_CAMPAR_CYCLES_MIN 1
00076 #define GPIV_CAMPAR_CYCLES_MAX 1
00077 
00081 enum GpivCamMode {
00082     GPIV_CAM_MODE__PERIODIC = 1,
00083     GPIV_CAM_MODE__DURATION,    
00084     GPIV_CAM_MODE__ONE_SHOT_IRQ,
00085     GPIV_CAM_MODE__TRIGGER_IRQ, 
00086     GPIV_CAM_MODE__INCREMENT,   
00087     GPIV_CAM_MODE__DOUBLE,      
00088 };
00089 
00090 typedef struct __GpivCamPar GpivCamPar;
00097 struct __GpivCamPar {
00098     enum GpivCamMode mode;      
00099     guint cycles;               
00100     gchar fname[GPIV_MAX_CHARS];
00101     gboolean mode__set;         
00102     gboolean cycles__set;       
00103     gboolean fname__set;        
00104 };
00105 
00106 
00107 
00108 typedef struct __GpivCamVar GpivCamVar;
00114 struct __GpivCamVar {
00115     guint numNodes;             
00116     guint numCameras;           
00117     guint maxspeed;             
00118     guint port;                 
00119     raw1394handle_t handle;     
00120     nodeid_t *camera_nodes;     
00122     dc1394_cameracapture *capture;
00123     dc1394_camerainfo *camera;
00124     dc1394_feature_info *feature_info;
00125     dc1394_feature_set *feature_set;
00126     dc1394_miscinfo *misc_info;
00127 };
00128 
00129 
00130 
00131 
00138 GpivCamVar *
00139 gpiv_cam_get_camvar             (const gboolean     verbose
00140                                 );
00141 
00142 
00143 
00150 gchar *
00151 gpiv_cam_free_camvar            (GpivCamVar         *cam_var
00152                                 );
00153 
00154 
00155 
00163 void
00164 gpiv_cam_default_parameters         (GpivCamPar         *cam_par_default,
00165                                     const gboolean      force
00166                                     );
00167 
00168 
00169 
00178 void 
00179 gpiv_cam_read_parameters        (FILE           *fp_par, 
00180                                 GpivCamPar      *cam_par, 
00181                                 const gboolean      verbose
00182                                 );
00183 
00184 
00185 
00196 gchar *
00197 gpiv_cam_check_parameters_read      (GpivCamPar         *cam_par,
00198                                     const GpivCamPar    *cam_par_default
00199                                     );
00200 
00201 
00202 
00210 void
00211 gpiv_cam_parameters__set        (GpivCamPar         *cam_par,
00212                                 const gboolean      flag
00213                                 );
00214 
00215 
00216 
00224 gchar *
00225 gpiv_cam_test_parameter         (const GpivCamPar   *cam_par
00226                                 );
00227 
00228 
00229 
00237 void 
00238 gpiv_cam_print_parameters       (FILE           *fp_par_out, 
00239                                 const GpivCamPar    *cam_par
00240                                 );
00241 
00242 
00243 
00244 #endif /*__LIBGPIV_CAM_H__ */