diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-08 13:56:00 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-08 13:56:00 +0100 |
commit | c7b0d014b3a568ceb2db5d582a57cb7002face5e (patch) | |
tree | 7d2faff2da40e016b1980472d96e6d6fc1afab40 /src | |
parent | 3804fd2355997cc5d2b811ffcbc546a367aa2b48 (diff) | |
download | libuca-c7b0d014b3a568ceb2db5d582a57cb7002face5e.tar.gz libuca-c7b0d014b3a568ceb2db5d582a57cb7002face5e.tar.bz2 libuca-c7b0d014b3a568ceb2db5d582a57cb7002face5e.tar.xz libuca-c7b0d014b3a568ceb2db5d582a57cb7002face5e.zip |
Add more offset properties
Diffstat (limited to 'src')
-rw-r--r-- | src/cameras/pf.c | 11 | ||||
-rw-r--r-- | src/uca-cam.h | 8 | ||||
-rw-r--r-- | src/uca.c | 4 | ||||
-rw-r--r-- | src/uca.h | 4 |
4 files changed, 22 insertions, 5 deletions
diff --git a/src/cameras/pf.c b/src/cameras/pf.c index 0703f69..92ffa5d 100644 --- a/src/cameras/pf.c +++ b/src/cameras/pf.c @@ -21,6 +21,7 @@ #define FG_CAMERA_LINK_CAMTYP 11011 #define FG_CL_8BIT_FULL_8 308 #define FG_TRIGGERMODE 8100 +#define FG_EXPOSURE 10020 /**< Exposure Time in us (Brigthness) (float) */ #define set_void(p, type, value) { *((type *) p) = value; } @@ -38,7 +39,11 @@ static struct uca_pf_map uca_to_pf[] = { { UCA_PROP_HEIGHT_MIN, "Window.H.Min" }, { UCA_PROP_HEIGHT_MAX, "Window.H.Max" }, { UCA_PROP_X_OFFSET, "Window.X" }, + { UCA_PROP_X_OFFSET_MIN,"Window.X.Min" }, + { UCA_PROP_X_OFFSET_MAX,"Window.X.Max" }, { UCA_PROP_Y_OFFSET, "Window.Y" }, + { UCA_PROP_Y_OFFSET_MIN,"Window.Y.Min" }, + { UCA_PROP_Y_OFFSET_MAX,"Window.Y.Max" }, { UCA_PROP_EXPOSURE, "ExposureTime" }, { UCA_PROP_EXPOSURE_MIN, "ExposureTime.Min" }, { UCA_PROP_EXPOSURE_MAX, "ExposureTime.Max" }, @@ -105,12 +110,14 @@ static uint32_t uca_pf_set_property(struct uca_camera_t *cam, enum uca_property_ return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; - /* case UCA_PROP_EXPOSURE: if (grabber->set_property(grabber, FG_EXPOSURE, (uint32_t *) data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; + + value.value.f = (float) *((uint32_t *) data); + if (pfDevice_SetProperty(0, t, &value) < 0) + return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; - */ default: return UCA_ERR_PROP_INVALID; diff --git a/src/uca-cam.h b/src/uca-cam.h index 5710b0a..a7f1827 100644 --- a/src/uca-cam.h +++ b/src/uca-cam.h @@ -39,15 +39,17 @@ typedef uint32_t (*uca_cam_destroy) (struct uca_camera_t *cam); /** * \brief Set a property - * \param[in] property_name Name of the property as defined in XXX + * \param[in] property ID of the property as defined in XXX + * \param[out] data Where to read the property's value from * \return UCA_ERR_PROP_INVALID if property is not supported on the camera or * UCA_ERR_PROP_VALUE_OUT_OF_RANGE if value cannot be set. */ typedef uint32_t (*uca_cam_set_property) (struct uca_camera_t *cam, enum uca_property_ids property, void *data); /** - * \brief Set a property - * \param[in] property_name Name of the property as defined in XXX + * \brief Get a property + * \param[in] property ID of the property as defined in XXX + * \param[out] data Where to store the property's value * \return UCA_ERR_PROP_INVALID if property is not supported on the camera */ typedef uint32_t (*uca_cam_get_property) (struct uca_camera_t *cam, enum uca_property_ids property, void *data); @@ -46,7 +46,11 @@ static struct uca_property_t property_map[UCA_PROP_LAST+1] = { { "image.height.min", uca_pixel, uca_uint32t, uca_read }, { "image.height.max", uca_pixel, uca_uint32t, uca_read }, { "image.offset.x", uca_pixel, uca_uint32t, uca_readwrite }, + { "image.offset.x.min", uca_pixel, uca_uint32t, uca_read }, + { "image.offset.x.max", uca_pixel, uca_uint32t, uca_read }, { "image.offset.y", uca_pixel, uca_uint32t, uca_readwrite }, + { "image.offset.y.min", uca_pixel, uca_uint32t, uca_read }, + { "image.offset.y.max", uca_pixel, uca_uint32t, uca_read }, { "image.bitdepth", uca_bits, uca_uint8t, uca_read}, { "time.exposure", uca_us, uca_uint32t, uca_readwrite }, { "time.exposure.min", uca_ns, uca_uint32t, uca_read }, @@ -53,7 +53,11 @@ enum uca_property_ids { UCA_PROP_HEIGHT_MIN, UCA_PROP_HEIGHT_MAX, UCA_PROP_X_OFFSET, + UCA_PROP_X_OFFSET_MIN, + UCA_PROP_X_OFFSET_MAX, UCA_PROP_Y_OFFSET, + UCA_PROP_Y_OFFSET_MIN, + UCA_PROP_Y_OFFSET_MAX, UCA_PROP_BITDEPTH, UCA_PROP_EXPOSURE, UCA_PROP_EXPOSURE_MIN, |