00001
00002 #ifndef vidl_iidc1394_params_h_
00003 #define vidl_iidc1394_params_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <vcl_string.h>
00020 #include <vcl_vector.h>
00021 #include "vidl_pixel_format.h"
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 struct vidl_iidc1394_params
00034 {
00035
00036 enum speed_t { ISO_SPEED_100= 0,
00037 ISO_SPEED_200,
00038 ISO_SPEED_400,
00039 ISO_SPEED_800,
00040 ISO_SPEED_1600,
00041 ISO_SPEED_3200 };
00042
00043
00044 static unsigned int speed_val(speed_t s);
00045
00046
00047 enum frame_rate_t { FRAMERATE_1_875= 32,
00048 FRAMERATE_3_75,
00049 FRAMERATE_7_5,
00050 FRAMERATE_15,
00051 FRAMERATE_30,
00052 FRAMERATE_60,
00053 FRAMERATE_120,
00054 FRAMERATE_240 };
00055
00056
00057 static float frame_rate_val(frame_rate_t r);
00058
00059
00060 enum video_mode_t { MODE_160x120_YUV444= 64,
00061 MODE_320x240_YUV422,
00062 MODE_640x480_YUV411,
00063 MODE_640x480_YUV422,
00064 MODE_640x480_RGB8,
00065 MODE_640x480_MONO8,
00066 MODE_640x480_MONO16,
00067 MODE_800x600_YUV422,
00068 MODE_800x600_RGB8,
00069 MODE_800x600_MONO8,
00070 MODE_1024x768_YUV422,
00071 MODE_1024x768_RGB8,
00072 MODE_1024x768_MONO8,
00073 MODE_800x600_MONO16,
00074 MODE_1024x768_MONO16,
00075 MODE_1280x960_YUV422,
00076 MODE_1280x960_RGB8,
00077 MODE_1280x960_MONO8,
00078 MODE_1600x1200_YUV422,
00079 MODE_1600x1200_RGB8,
00080 MODE_1600x1200_MONO8,
00081 MODE_1280x960_MONO16,
00082 MODE_1600x1200_MONO16,
00083 MODE_EXIF,
00084 MODE_FORMAT7_0,
00085 MODE_FORMAT7_1,
00086 MODE_FORMAT7_2,
00087 MODE_FORMAT7_3,
00088 MODE_FORMAT7_4,
00089 MODE_FORMAT7_5,
00090 MODE_FORMAT7_6,
00091 MODE_FORMAT7_7 };
00092
00093
00094 enum feature_t{ FEATURE_BRIGHTNESS,
00095 FEATURE_EXPOSURE,
00096 FEATURE_SHARPNESS,
00097 FEATURE_WHITE_BALANCE,
00098 FEATURE_HUE,
00099 FEATURE_SATURATION,
00100 FEATURE_GAMMA,
00101 FEATURE_SHUTTER,
00102 FEATURE_GAIN,
00103 FEATURE_IRIS,
00104 FEATURE_FOCUS,
00105 FEATURE_TEMPERATURE,
00106 FEATURE_TRIGGER,
00107 FEATURE_TRIGGER_DELAY,
00108 FEATURE_WHITE_SHADING,
00109 FEATURE_FRAME_RATE,
00110 FEATURE_ZOOM,
00111 FEATURE_PAN,
00112 FEATURE_TILT,
00113 FEATURE_OPTICAL_FILTER,
00114 FEATURE_CAPTURE_SIZE,
00115 FEATURE_CAPTURE_QUALITY};
00116
00117
00118 enum feature_mode_t{ FEATURE_MODE_MANUAL,
00119 FEATURE_MODE_AUTO,
00120 FEATURE_MODE_ONE_PUSH_AUTO};
00121
00122
00123 static vcl_string video_mode_string(video_mode_t m);
00124
00125
00126 static vcl_string feature_string(feature_t f);
00127
00128
00129 static vcl_string feature_mode_string(feature_mode_t fm);
00130
00131
00132 static unsigned int video_format_val(video_mode_t m);
00133
00134 static unsigned int video_mode_val(video_mode_t m);
00135
00136
00137
00138 static vidl_pixel_format pixel_format(video_mode_t m);
00139
00140
00141
00142 static bool resolution(video_mode_t m, unsigned& ni, unsigned& nj);
00143
00144
00145 static video_mode_t video_mode(unsigned int format, unsigned int mode);
00146
00147
00148 struct valid_options;
00149
00150
00151 struct feature_options;
00152
00153
00154
00155
00156 vxl_uint_64 guid_;
00157
00158
00159 speed_t speed_;
00160
00161
00162 bool b_mode_;
00163
00164
00165 frame_rate_t frame_rate_;
00166
00167
00168 video_mode_t video_mode_;
00169
00170
00171 vcl_vector<feature_options> features_;
00172
00173
00174
00175
00176 vidl_iidc1394_params();
00177
00178
00179 vidl_iidc1394_params& guid( vxl_uint_64 the_guid )
00180 { guid_ = the_guid; return *this; }
00181
00182
00183 vidl_iidc1394_params& speed( speed_t s )
00184 { speed_ = s; return *this; }
00185
00186
00187 vidl_iidc1394_params& b_mode( bool b )
00188 { b_mode_ = b; return *this; }
00189
00190
00191 vidl_iidc1394_params& frame_rate( frame_rate_t r )
00192 { frame_rate_ = r; return *this; }
00193
00194
00195 vidl_iidc1394_params& video_mode(video_mode_t m)
00196 { video_mode_ = m; return *this; }
00197 };
00198
00199
00200
00201
00202
00203 struct vidl_iidc1394_params::feature_options
00204 {
00205 feature_t id;
00206 bool available;
00207 bool absolute_capable;
00208 bool readout_capable;
00209 bool on_off_capable;
00210 bool polarity_capable;
00211 bool is_on;
00212 feature_mode_t active_mode;
00213
00214 vcl_vector<feature_mode_t> available_modes;
00215
00216
00217 #if 0
00218 trigger_modes_t trigger_modes;
00219 trigger_mode_t trigger_mode;
00220 trigger_polarity_t trigger_polarity;
00221 trigger_sources_t trigger_sources;
00222 trigger_source_t trigger_source;
00223 #endif
00224
00225 unsigned int min;
00226 unsigned int max;
00227 unsigned int value;
00228 unsigned int BU_value;
00229 unsigned int RV_value;
00230 unsigned int B_value;
00231 unsigned int R_value;
00232 unsigned int G_value;
00233 unsigned int target_value;
00234
00235 bool abs_control;
00236 float abs_value;
00237 float abs_max;
00238 float abs_min;
00239 };
00240
00241
00242
00243
00244
00245
00246 struct vidl_iidc1394_params::valid_options
00247 {
00248
00249 struct valid_mode
00250 {
00251 video_mode_t mode;
00252 vcl_vector<frame_rate_t> frame_rates;
00253 };
00254
00255
00256 struct camera
00257 {
00258 vxl_uint_64 guid;
00259 vcl_string vendor;
00260 vcl_string model;
00261 speed_t speed;
00262 bool b_mode;
00263 vcl_vector<valid_mode> modes;
00264 vcl_vector<vidl_iidc1394_params::feature_options> features;
00265 video_mode_t curr_mode;
00266 frame_rate_t curr_frame_rate;
00267 };
00268
00269
00270
00271 vcl_vector<camera> cameras;
00272 };
00273
00274 #endif // vidl_iidc1394_params_h_