diff options
| author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-07 17:28:07 +0100 | 
|---|---|---|
| committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-07 17:28:07 +0100 | 
| commit | 923dab046564bdfcd7267281b99462f6d866d311 (patch) | |
| tree | 84ae5326b05d0ca069aafc7ebc231e24d9a19a4a /src | |
| parent | 1b9734e1c19a7d3149013005502349eb2b9cd402 (diff) | |
| download | uca-923dab046564bdfcd7267281b99462f6d866d311.tar.gz uca-923dab046564bdfcd7267281b99462f6d866d311.tar.bz2 uca-923dab046564bdfcd7267281b99462f6d866d311.tar.xz uca-923dab046564bdfcd7267281b99462f6d866d311.zip  | |
Add property listing
Diffstat (limited to 'src')
| -rw-r--r-- | src/uca.c | 60 | ||||
| -rw-r--r-- | src/uca.h | 8 | 
2 files changed, 42 insertions, 26 deletions
@@ -25,31 +25,43 @@  #include "cameras/photron.h"  #endif +const char *uca_unit_map[] = { +    "px", +    "bits", +    "ns", +    "µs", +    "ms", +    "s", +    "rows", +    "fps" +    ""  +}; +  static struct uca_property_t property_map[UCA_PROP_LAST+1] = { -    { "name",           uca_na,     uca_string },  -    { "width",          uca_pixel,  uca_uint32t },  -    { "width.min",      uca_pixel,  uca_uint32t },  -    { "width.max",      uca_pixel,  uca_uint32t },  -    { "height",         uca_pixel,  uca_uint32t },  -    { "height.min",     uca_pixel,  uca_uint32t },  -    { "height.max",     uca_pixel,  uca_uint32t },  -    { "offset.x",       uca_pixel,  uca_uint32t },  -    { "offset.y",       uca_pixel,  uca_uint32t },  -    { "bitdepth",       uca_bits,   uca_uint8t },  -    { "exposure",       uca_us,     uca_uint32t },  -    { "exposure.min",   uca_ns,     uca_uint32t },  -    { "exposure.max",   uca_ms,     uca_uint32t },  -    { "delay",          uca_us,     uca_uint32t },  -    { "delay.min",      uca_ns,     uca_uint32t },  -    { "delay.max",      uca_ms,     uca_uint32t },  -    { "framerate",      uca_na,     uca_uint32t },  -    { "triggermode",    uca_na,     uca_uint32t },  -    { "timestampmode",  uca_na,     uca_uint32t },  -    { "scan-mode",      uca_na,     uca_uint32t },  -    { "interlace.samplerate", uca_na, uca_uint32t },  -    { "interlace.threshold.pixel", uca_na, uca_uint32t },  -    { "interlace.threshold.row", uca_na, uca_uint32t },  -    { "correctionmode", uca_na, uca_uint32t },  +    { "general.name",           uca_na,     uca_string },  +    { "image.width",            uca_pixel,  uca_uint32t },  +    { "image.width.min",        uca_pixel,  uca_uint32t },  +    { "image.width.max",        uca_pixel,  uca_uint32t },  +    { "image.height",           uca_pixel,  uca_uint32t },  +    { "image.height.min",       uca_pixel,  uca_uint32t },  +    { "image.height.max",       uca_pixel,  uca_uint32t },  +    { "image.offset.x",         uca_pixel,  uca_uint32t },  +    { "image.offset.y",         uca_pixel,  uca_uint32t },  +    { "image.bitdepth",         uca_bits,   uca_uint8t },  +    { "time.exposure",          uca_us,     uca_uint32t },  +    { "time.exposure.min",      uca_ns,     uca_uint32t },  +    { "time.exposure.max",      uca_ms,     uca_uint32t },  +    { "time.delay",             uca_us,     uca_uint32t },  +    { "time.delay.min",         uca_ns,     uca_uint32t },  +    { "time.delay.max",         uca_ms,     uca_uint32t },  +    { "time.framerate",         uca_fps,    uca_uint32t },  +    { "mode.trigger",           uca_na,     uca_uint32t },  +    { "mode.timestamp",         uca_na,     uca_uint32t },  +    { "mode.scan",              uca_na,     uca_uint32t },  +    { "ipe.interlace.samplerate", uca_na, uca_uint32t },  +    { "ipe.interlace.threshold.pixel", uca_na, uca_uint32t },  +    { "ipe.interlace.threshold.row", uca_na, uca_uint32t },  +    { "mode.correction", uca_na, uca_uint32t },       { NULL, 0, 0 }  }; @@ -93,6 +93,7 @@ enum uca_property_ids {  #define UCA_CORRECT_HOTPIXEL    0x02  #define UCA_CORRECT_GAIN        0x04 +  /**   * \brief Describe a property used by cameras and frame grabbers   */ @@ -100,13 +101,14 @@ struct uca_property_t {      const char *name;      enum uca_unit { -        uca_pixel, +        uca_pixel = 0,          uca_bits,          uca_ns,          uca_us,          uca_ms,          uca_s,          uca_rows, +        uca_fps,          uca_na      } unit; @@ -117,10 +119,12 @@ struct uca_property_t {      } type;  }; +extern const char *uca_unit_map[];      /**< maps unit numbers to corresponding strings */ +  enum uca_errors {      UCA_NO_ERROR = 0,      UCA_ERR_GRABBER_NOT_FOUND, -    UCA_ERR_CAM_NOT_FOUND,             /**< camera probing or initialization failed */ +    UCA_ERR_CAM_NOT_FOUND,              /**< camera probing or initialization failed */      UCA_ERR_PROP_INVALID,               /**< the requested property is not supported by the camera */      UCA_ERR_PROP_GENERAL,               /**< error occured reading/writing the property */      UCA_ERR_PROP_VALUE_OUT_OF_RANGE,    /**< error occured writing the property */  | 
