/usr/include/dc1394/control.h is in libdc1394-22-dev 2.2.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | /*
* 1394-Based Digital Camera Control Library
*
* Generic camera control functions
*
* Written by Damien Douxchamps <ddouxchamps@users.sf.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <dc1394/log.h>
#ifndef __DC1394_CONTROL_H__
#define __DC1394_CONTROL_H__
/*! \file dc1394/control.h
\brief Diverse controls of camera features
\author Gord Peters: main writer
\author Chris Urmson: some additions
\author Damien Douxchamps: some additions
\author Peter Antoniac: documentation maintainer
\author Rudolf Leitgeb: documentation writer
This is the main include file of the library. It lists most of the library
functions, enumerations and data structures.
*/
/**
* Enumeration of trigger modes
*/
typedef enum {
DC1394_TRIGGER_MODE_0= 384,
DC1394_TRIGGER_MODE_1,
DC1394_TRIGGER_MODE_2,
DC1394_TRIGGER_MODE_3,
DC1394_TRIGGER_MODE_4,
DC1394_TRIGGER_MODE_5,
DC1394_TRIGGER_MODE_14,
DC1394_TRIGGER_MODE_15
} dc1394trigger_mode_t;
#define DC1394_TRIGGER_MODE_MIN DC1394_TRIGGER_MODE_0
#define DC1394_TRIGGER_MODE_MAX DC1394_TRIGGER_MODE_15
#define DC1394_TRIGGER_MODE_NUM (DC1394_TRIGGER_MODE_MAX - DC1394_TRIGGER_MODE_MIN + 1)
/**
* Enumeration of camera features
*/
typedef enum {
DC1394_FEATURE_BRIGHTNESS= 416,
DC1394_FEATURE_EXPOSURE,
DC1394_FEATURE_SHARPNESS,
DC1394_FEATURE_WHITE_BALANCE,
DC1394_FEATURE_HUE,
DC1394_FEATURE_SATURATION,
DC1394_FEATURE_GAMMA,
DC1394_FEATURE_SHUTTER,
DC1394_FEATURE_GAIN,
DC1394_FEATURE_IRIS,
DC1394_FEATURE_FOCUS,
DC1394_FEATURE_TEMPERATURE,
DC1394_FEATURE_TRIGGER,
DC1394_FEATURE_TRIGGER_DELAY,
DC1394_FEATURE_WHITE_SHADING,
DC1394_FEATURE_FRAME_RATE,
DC1394_FEATURE_ZOOM,
DC1394_FEATURE_PAN,
DC1394_FEATURE_TILT,
DC1394_FEATURE_OPTICAL_FILTER,
DC1394_FEATURE_CAPTURE_SIZE,
DC1394_FEATURE_CAPTURE_QUALITY
} dc1394feature_t;
#define DC1394_FEATURE_MIN DC1394_FEATURE_BRIGHTNESS
#define DC1394_FEATURE_MAX DC1394_FEATURE_CAPTURE_QUALITY
#define DC1394_FEATURE_NUM (DC1394_FEATURE_MAX - DC1394_FEATURE_MIN + 1)
/**
* Enumeration of trigger sources
*/
typedef enum {
DC1394_TRIGGER_SOURCE_0= 576,
DC1394_TRIGGER_SOURCE_1,
DC1394_TRIGGER_SOURCE_2,
DC1394_TRIGGER_SOURCE_3,
DC1394_TRIGGER_SOURCE_SOFTWARE
} dc1394trigger_source_t;
#define DC1394_TRIGGER_SOURCE_MIN DC1394_TRIGGER_SOURCE_0
#define DC1394_TRIGGER_SOURCE_MAX DC1394_TRIGGER_SOURCE_SOFTWARE
#define DC1394_TRIGGER_SOURCE_NUM (DC1394_TRIGGER_SOURCE_MAX - DC1394_TRIGGER_SOURCE_MIN + 1)
/**
* External trigger polarity
*/
typedef enum {
DC1394_TRIGGER_ACTIVE_LOW= 704,
DC1394_TRIGGER_ACTIVE_HIGH
} dc1394trigger_polarity_t;
#define DC1394_TRIGGER_ACTIVE_MIN DC1394_TRIGGER_ACTIVE_LOW
#define DC1394_TRIGGER_ACTIVE_MAX DC1394_TRIGGER_ACTIVE_HIGH
#define DC1394_TRIGGER_ACTIVE_NUM (DC1394_TRIGGER_ACTIVE_MAX - DC1394_TRIGGER_ACTIVE_MIN + 1)
/**
* Control modes for a feature (excl. absolute control)
*/
typedef enum {
DC1394_FEATURE_MODE_MANUAL= 736,
DC1394_FEATURE_MODE_AUTO,
DC1394_FEATURE_MODE_ONE_PUSH_AUTO
} dc1394feature_mode_t;
#define DC1394_FEATURE_MODE_MIN DC1394_FEATURE_MODE_MANUAL
#define DC1394_FEATURE_MODE_MAX DC1394_FEATURE_MODE_ONE_PUSH_AUTO
#define DC1394_FEATURE_MODE_NUM (DC1394_FEATURE_MODE_MAX - DC1394_FEATURE_MODE_MIN + 1)
/**
* List of feature modes
*/
typedef struct
{
uint32_t num;
dc1394feature_mode_t modes[DC1394_FEATURE_MODE_NUM];
} dc1394feature_modes_t;
/**
* List of trigger modes
*/
typedef struct
{
uint32_t num;
dc1394trigger_mode_t modes[DC1394_TRIGGER_MODE_NUM];
} dc1394trigger_modes_t;
/**
* List of trigger sources
*/
typedef struct
{
uint32_t num;
dc1394trigger_source_t sources[DC1394_TRIGGER_SOURCE_NUM];
} dc1394trigger_sources_t;
/**
* A structure containing all information about a feature.
*
* Some fields are only valid for some features (e.g. trigger, white balance,...)
*/
typedef struct __dc1394feature_info_t_struct
{
dc1394feature_t id;
dc1394bool_t available;
dc1394bool_t absolute_capable;
dc1394bool_t readout_capable;
dc1394bool_t on_off_capable;
dc1394bool_t polarity_capable;
dc1394switch_t is_on;
dc1394feature_mode_t current_mode;
dc1394feature_modes_t modes;
dc1394trigger_modes_t trigger_modes;
dc1394trigger_mode_t trigger_mode;
dc1394trigger_polarity_t trigger_polarity;
dc1394trigger_sources_t trigger_sources;
dc1394trigger_source_t trigger_source;
uint32_t min;
uint32_t max;
uint32_t value;
uint32_t BU_value;
uint32_t RV_value;
uint32_t B_value;
uint32_t R_value;
uint32_t G_value;
uint32_t target_value;
dc1394switch_t abs_control;
float abs_value;
float abs_max;
float abs_min;
} dc1394feature_info_t;
/**
* The list of features
*/
typedef struct __dc1394featureset_t
{
dc1394feature_info_t feature[DC1394_FEATURE_NUM];
} dc1394featureset_t;
#ifdef __cplusplus
extern "C" {
#endif
/***************************************************************************
Features
***************************************************************************/
/**
* Collects the available features for the camera described by node and stores them in features.
*/
dc1394error_t dc1394_feature_get_all(dc1394camera_t *camera, dc1394featureset_t *features);
/**
* Stores the bounds and options associated with the feature described by feature->feature_id
*/
dc1394error_t dc1394_feature_get(dc1394camera_t *camera, dc1394feature_info_t *feature);
/**
* Displays the bounds and options of the given feature
*/
dc1394error_t dc1394_feature_print(dc1394feature_info_t *feature, FILE *fd);
/**
* Displays the bounds and options of every feature supported by the camera
*/
dc1394error_t dc1394_feature_print_all(dc1394featureset_t *features, FILE *fd);
/**
* Gets the whitebalance values
*/
dc1394error_t dc1394_feature_whitebalance_get_value(dc1394camera_t *camera, uint32_t *u_b_value, uint32_t *v_r_value);
/**
* Sets the whitebalance values
*/
dc1394error_t dc1394_feature_whitebalance_set_value(dc1394camera_t *camera, uint32_t u_b_value, uint32_t v_r_value);
/**
* Gets the temperature values (target and current)
*/
dc1394error_t dc1394_feature_temperature_get_value(dc1394camera_t *camera, uint32_t *target_temperature, uint32_t *temperature);
/**
* Sets the temperature values (target only) FIXME: COULD BE DROPPED? already in the standard feature_set_value()?
*/
dc1394error_t dc1394_feature_temperature_set_value(dc1394camera_t *camera, uint32_t target_temperature);
/**
* Gets the white shading values
*/
dc1394error_t dc1394_feature_whiteshading_get_value(dc1394camera_t *camera, uint32_t *r_value, uint32_t *g_value, uint32_t *b_value);
/**
* Sets the white shading values
*/
dc1394error_t dc1394_feature_whiteshading_set_value(dc1394camera_t *camera, uint32_t r_value, uint32_t g_value, uint32_t b_value);
/**
* Gets the value of a feature
*/
dc1394error_t dc1394_feature_get_value(dc1394camera_t *camera, dc1394feature_t feature, uint32_t *value);
/**
* Sets the value of a feature
*/
dc1394error_t dc1394_feature_set_value(dc1394camera_t *camera, dc1394feature_t feature, uint32_t value);
/**
* Tells whether a feature is present or not
*/
dc1394error_t dc1394_feature_is_present(dc1394camera_t *camera, dc1394feature_t feature, dc1394bool_t *value);
/**
* Tells whether a feature is readable or not
*/
dc1394error_t dc1394_feature_is_readable(dc1394camera_t *camera, dc1394feature_t feature, dc1394bool_t *value);
/**
* Gets the boundaries of a feature
*/
dc1394error_t dc1394_feature_get_boundaries(dc1394camera_t *camera, dc1394feature_t feature, uint32_t *min, uint32_t *max);
/**
* Tells whether a feature is switcheable or not (ON/OFF)
*/
dc1394error_t dc1394_feature_is_switchable(dc1394camera_t *camera, dc1394feature_t feature, dc1394bool_t *value);
/**
* Gets the power status of a feature (ON or OFF)
*/
dc1394error_t dc1394_feature_get_power(dc1394camera_t *camera, dc1394feature_t feature, dc1394switch_t *pwr);
/**
* Sets the power status of a feature (ON or OFF)
*/
dc1394error_t dc1394_feature_set_power(dc1394camera_t *camera, dc1394feature_t feature, dc1394switch_t pwr);
/**
* Gets the list of control modes for a feature (manual, auto, etc...)
*/
dc1394error_t dc1394_feature_get_modes(dc1394camera_t *camera, dc1394feature_t feature, dc1394feature_modes_t *modes);
/**
* Gets the current control modes for a feature
*/
dc1394error_t dc1394_feature_get_mode(dc1394camera_t *camera, dc1394feature_t feature, dc1394feature_mode_t *mode);
/**
* Sets the current control modes for a feature
*/
dc1394error_t dc1394_feature_set_mode(dc1394camera_t *camera, dc1394feature_t feature, dc1394feature_mode_t mode);
/**
* Tells whether a feature can be controlled in absolute mode
*/
dc1394error_t dc1394_feature_has_absolute_control(dc1394camera_t *camera, dc1394feature_t feature, dc1394bool_t *value);
/**
* Gets the absolute boundaries of a feature
*/
dc1394error_t dc1394_feature_get_absolute_boundaries(dc1394camera_t *camera, dc1394feature_t feature, float *min, float *max);
/**
* Gets the absolute value of a feature
*/
dc1394error_t dc1394_feature_get_absolute_value(dc1394camera_t *camera, dc1394feature_t feature, float *value);
/**
* Sets the absolute value of a feature
*/
dc1394error_t dc1394_feature_set_absolute_value(dc1394camera_t *camera, dc1394feature_t feature, float value);
/**
* Gets the status of absolute control of a feature
*/
dc1394error_t dc1394_feature_get_absolute_control(dc1394camera_t *camera, dc1394feature_t feature, dc1394switch_t *pwr);
/**
* Sets the feature in absolute control mode (ON/OFF)
*/
dc1394error_t dc1394_feature_set_absolute_control(dc1394camera_t *camera, dc1394feature_t feature, dc1394switch_t pwr);
/***************************************************************************
Trigger
***************************************************************************/
/**
* Sets the polarity of the external trigger
*/
dc1394error_t dc1394_external_trigger_set_polarity(dc1394camera_t *camera, dc1394trigger_polarity_t polarity);
/**
* Gets the polarity of the external trigger
*/
dc1394error_t dc1394_external_trigger_get_polarity(dc1394camera_t *camera, dc1394trigger_polarity_t *polarity);
/**
* Tells whether the external trigger can change its polarity or not.
*/
dc1394error_t dc1394_external_trigger_has_polarity(dc1394camera_t *camera, dc1394bool_t *polarity_capable);
/**
* Switch between internal and external trigger
*/
dc1394error_t dc1394_external_trigger_set_power(dc1394camera_t *camera, dc1394switch_t pwr);
/**
* Gets the status of the external trigger
*/
dc1394error_t dc1394_external_trigger_get_power(dc1394camera_t *camera, dc1394switch_t *pwr);
/**
* Sets the external trigger mode
*/
dc1394error_t dc1394_external_trigger_set_mode(dc1394camera_t *camera, dc1394trigger_mode_t mode);
/**
* Gets the external trigger mode
*/
dc1394error_t dc1394_external_trigger_get_mode(dc1394camera_t *camera, dc1394trigger_mode_t *mode);
/**
* Sets the external trigger source
*/
dc1394error_t dc1394_external_trigger_set_source(dc1394camera_t *camera, dc1394trigger_source_t source);
/**
* Gets the external trigger source
*/
dc1394error_t dc1394_external_trigger_get_source(dc1394camera_t *camera, dc1394trigger_source_t *source);
/**
* Gets the list of available external trigger source
*/
dc1394error_t dc1394_external_trigger_get_supported_sources(dc1394camera_t *camera, dc1394trigger_sources_t *sources);
/**
* Turn software trigger on or off
*/
dc1394error_t dc1394_software_trigger_set_power(dc1394camera_t *camera, dc1394switch_t pwr);
/**
* Gets the state of software trigger
*/
dc1394error_t dc1394_software_trigger_get_power(dc1394camera_t *camera, dc1394switch_t *pwr);
/***************************************************************************
PIO, SIO and Strobe Functions
***************************************************************************/
/**
* Sends a quadlet on the PIO (output)
*/
dc1394error_t dc1394_pio_set(dc1394camera_t *camera, uint32_t value);
/**
* Gets the current quadlet at the PIO (input)
*/
dc1394error_t dc1394_pio_get(dc1394camera_t *camera, uint32_t *value);
/***************************************************************************
Other functionalities
***************************************************************************/
/**
* reset a camera to factory default settings
*/
dc1394error_t dc1394_camera_reset(dc1394camera_t *camera);
/**
* turn a camera on or off
*/
dc1394error_t dc1394_camera_set_power(dc1394camera_t *camera, dc1394switch_t pwr);
/**
* Download a camera setup from the memory.
*/
dc1394error_t dc1394_memory_busy(dc1394camera_t *camera, dc1394bool_t *value);
/**
* Uploads a camera setup in the memory.
*
* Note that this operation can only be performed a certain number of
* times for a given camera, as it requires reprogramming of an EEPROM.
*/
dc1394error_t dc1394_memory_save(dc1394camera_t *camera, uint32_t channel);
/**
* Tells whether the writing of the camera setup in memory is finished or not.
*/
dc1394error_t dc1394_memory_load(dc1394camera_t *camera, uint32_t channel);
#ifdef __cplusplus
}
#endif
#endif /* __DC1394_CONTROL_H__ */
|