diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-02-28 15:11:51 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-02-28 15:11:51 +0100 |
commit | b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3 (patch) | |
tree | 4a0b4269bb557d2f9eca2b079da32e8320d0f91c | |
parent | f588f10b6fc6e452d42a66abc56028fe21cd56c2 (diff) | |
download | libuca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.tar.gz libuca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.tar.bz2 libuca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.tar.xz libuca-b715cc76cfd8d972663bd2dd15c461f0e6ed5fc3.zip |
Complete frame grabber abstraction
-rw-r--r-- | src/cameras/pco.c | 52 | ||||
-rw-r--r-- | src/cameras/pco.h | 3 | ||||
-rw-r--r-- | src/grabbers/me4.c | 42 | ||||
-rw-r--r-- | src/grabbers/me4.h | 8 | ||||
-rw-r--r-- | src/uca-cam.c | 52 | ||||
-rw-r--r-- | src/uca-cam.h | 94 | ||||
-rw-r--r-- | src/uca-grabber.h | 1 | ||||
-rw-r--r-- | src/uca.c | 107 | ||||
-rw-r--r-- | src/uca.h | 91 |
9 files changed, 266 insertions, 184 deletions
diff --git a/src/cameras/pco.c b/src/cameras/pco.c index 88f1e23..a556614 100644 --- a/src/cameras/pco.c +++ b/src/cameras/pco.c @@ -1,21 +1,16 @@ #include <stdlib.h> #include <string.h> -#include <clser.h> -#include <fgrab_struct.h> -#include <fgrab_prototyp.h> #include <libpco/libpco.h> #include "uca.h" #include "uca-cam.h" +#include "uca-grabber.h" #include "pco.h" -struct pco_cam_t { - struct pco_edge_t *pco; - Fg_Struct *fg; -}; +/* TODO: REMOVE THIS ASAP */ +#include <fgrab_struct.h> -#define GET_PCO(uca) (((struct pco_cam_t *)(uca->user))->pco) -#define GET_FG(uca) (((struct pco_cam_t *)(uca->user))->fg) +#define GET_PCO(uca) ((struct pco_edge_t *)(uca->user)) #define set_void(p, type, value) { *((type *) p) = value; } @@ -53,32 +48,32 @@ static uint32_t uca_pco_acquire_image(struct uca_camera_t *cam, void *buffer) static uint32_t uca_pco_destroy(struct uca_camera_t *cam) { - Fg_FreeGrabber(GET_FG(cam)); pco_destroy(GET_PCO(cam)); - free(cam->user); return UCA_NO_ERROR; } static uint32_t uca_pco_set_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data) { + struct uca_grabber_t *grabber = cam->grabber; + switch (property) { case UCA_PROP_WIDTH: - if (Fg_setParameter(GET_FG(cam), FG_WIDTH, (uint32_t *) data, PORT_A) != FG_OK) + if (grabber->set_property(grabber, FG_WIDTH, (uint32_t *) data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; case UCA_PROP_HEIGHT: - if (Fg_setParameter(GET_FG(cam), FG_HEIGHT, (uint32_t *) data, PORT_A) != FG_OK) + if (grabber->set_property(grabber, FG_HEIGHT, (uint32_t *) data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; case UCA_PROP_X_OFFSET: - if (Fg_setParameter(GET_FG(cam), FG_XOFFSET, (uint32_t *) data, PORT_A) != FG_OK) + if (grabber->set_property(grabber, FG_XOFFSET, (uint32_t *) data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; case UCA_PROP_Y_OFFSET: - if (Fg_setParameter(GET_FG(cam), FG_YOFFSET, (uint32_t *) data, PORT_A) != FG_OK) + if (grabber->set_property(grabber, FG_YOFFSET, (uint32_t *) data) != UCA_NO_ERROR) return UCA_ERR_PROP_VALUE_OUT_OF_RANGE; break; @@ -98,6 +93,7 @@ static uint32_t uca_pco_set_property(struct uca_camera_t *cam, enum uca_property static uint32_t uca_pco_get_property(struct uca_camera_t *cam, enum uca_property_ids property, void *data) { struct pco_edge_t *pco = GET_PCO(cam); + struct uca_grabber_t *grabber = cam->grabber; switch (property) { case UCA_PROP_NAME: @@ -142,12 +138,12 @@ static uint32_t uca_pco_get_property(struct uca_camera_t *cam, enum uca_property break; case UCA_PROP_X_OFFSET: - if (Fg_getParameter(GET_FG(cam), FG_XOFFSET, (uint32_t *) data, PORT_A) != FG_OK) + if (grabber->get_property(grabber, FG_XOFFSET, (uint32_t *) data) != UCA_NO_ERROR) return UCA_ERR_PROP_GENERAL; break; case UCA_PROP_Y_OFFSET: - if (Fg_getParameter(GET_FG(cam), FG_YOFFSET, (uint32_t *) data, PORT_A) != FG_OK) + if (grabber->get_property(grabber, FG_YOFFSET, (uint32_t *) data) != UCA_NO_ERROR) return UCA_ERR_PROP_GENERAL; break; @@ -182,26 +178,22 @@ uint32_t uca_pco_alloc(struct uca_camera_t *cam, uint32_t n_buffers) } -uint32_t uca_pco_init(struct uca_camera_t **cam) +uint32_t uca_pco_init(struct uca_camera_t **cam, struct uca_grabber_t *grabber) { - struct pco_cam_t *pco_cam = (struct pco_cam_t *) malloc(sizeof(struct pco_cam_t)); - struct pco_edge_t *pco = pco_cam->pco = pco_init(); + struct pco_edge_t *pco = pco_init(); if (pco == NULL) { - free(pco_cam); return UCA_ERR_INIT_NOT_FOUND; } if ((pco->serial_ref == NULL) || !pco_active(pco)) { - free(pco_cam); pco_destroy(pco); return UCA_ERR_INIT_NOT_FOUND; } - Fg_Struct *fg = pco_cam->fg = Fg_Init("libFullAreaGray8.so", 0); - struct uca_camera_t *uca = (struct uca_camera_t *) malloc(sizeof(struct uca_camera_t)); - uca->user = pco_cam; + uca->user = pco; + uca->grabber = grabber; /* Camera found, set function pointers... */ uca->destroy = &uca_pco_destroy; @@ -221,13 +213,13 @@ uint32_t uca_pco_init(struct uca_camera_t **cam) /* Prepare frame grabber for recording */ int val = FG_CL_8BIT_FULL_10; - Fg_setParameter(fg, FG_CAMERA_LINK_CAMTYP, &val, PORT_A); + grabber->set_property(grabber, FG_CAMERA_LINK_CAMTYP, &val); val = FG_GRAY; - Fg_setParameter(fg, FG_FORMAT, &val, PORT_A); + grabber->set_property(grabber, FG_FORMAT, &val); val = FREE_RUN; - Fg_setParameter(fg, FG_TRIGGERMODE, &val, PORT_A); + grabber->set_property(grabber, FG_TRIGGERMODE, &val); int width, height; pco_get_actual_size(pco, &width, &height); @@ -235,8 +227,8 @@ uint32_t uca_pco_init(struct uca_camera_t **cam) /* Yes, we really have to take an image twice as large because we set the * CameraLink interface to 8-bit 10 Taps, but are actually using 5x16 bits. */ width *= 2; - Fg_setParameter(fg, FG_WIDTH, &width, PORT_A); - Fg_setParameter(fg, FG_HEIGHT, &height, PORT_A); + grabber->set_property(grabber, FG_WIDTH, &width); + grabber->set_property(grabber, FG_HEIGHT, &height); uca->state = UCA_CAM_CONFIGURABLE; *cam = uca; diff --git a/src/cameras/pco.h b/src/cameras/pco.h index 240e675..4025002 100644 --- a/src/cameras/pco.h +++ b/src/cameras/pco.h @@ -2,7 +2,8 @@ #define __UNIFIED_CAMERA_ACCESS_PCO_H struct uca_camera_t; +struct uca_grabber_t; -uint32_t uca_pco_init(struct uca_camera_t **uca); +uint32_t uca_pco_init(struct uca_camera_t **uca, struct uca_grabber_t *grabber); #endif diff --git a/src/grabbers/me4.c b/src/grabbers/me4.c index e69de29..aa61946 100644 --- a/src/grabbers/me4.c +++ b/src/grabbers/me4.c @@ -0,0 +1,42 @@ + +#include <stdlib.h> +#include <clser.h> +#include <fgrab_struct.h> +#include <fgrab_prototyp.h> + +#include "uca.h" +#include "uca-grabber.h" + +#define GET_FG(grabber) ((Fg_Struct *)(grabber->user)) + +uint32_t uca_me4_destroy(struct uca_grabber_t *grabber) +{ + Fg_FreeGrabber(GET_FG(grabber)); +} + +uint32_t uca_me4_set_property(struct uca_grabber_t *grabber, enum uca_property_ids property, void *data) +{ + return Fg_setParameter(GET_FG(grabber), property, data, PORT_A) == FG_OK ? UCA_NO_ERROR : UCA_ERR_PROP_GENERAL; +} + +uint32_t uca_me4_get_property(struct uca_grabber_t *grabber, enum uca_property_ids property, void *data) +{ + return Fg_getParameter(GET_FG(grabber), property, data, PORT_A) == FG_OK ? UCA_NO_ERROR : UCA_ERR_PROP_GENERAL; +} + +uint32_t uca_me4_init(struct uca_grabber_t **grabber) +{ + /* FIXME: find out if this board/grabber is running */ + Fg_Struct *fg = Fg_Init("libFullAreaGray8.so", 0); + if (fg == NULL) + return UCA_ERR_INIT_NOT_FOUND; + + struct uca_grabber_t *uca = (struct uca_grabber_t *) malloc(sizeof(struct uca_grabber_t)); + uca->user = fg; + uca->destroy = &uca_me4_destroy; + uca->set_property = &uca_me4_set_property; + uca->get_property = &uca_me4_get_property; + + *grabber = uca; + return UCA_NO_ERROR; +} diff --git a/src/grabbers/me4.h b/src/grabbers/me4.h index e69de29..a7a7b3c 100644 --- a/src/grabbers/me4.h +++ b/src/grabbers/me4.h @@ -0,0 +1,8 @@ +#ifndef __UNIFIED_CAMERA_ACCESS_ME4_H +#define __UNIFIED_CAMERA_ACCESS_ME4_H + +struct uca_grabber_t; + +uint32_t uca_me4_init(struct uca_grabber_t **grabber); + +#endif diff --git a/src/uca-cam.c b/src/uca-cam.c index a51a5ae..2618b84 100644 --- a/src/uca-cam.c +++ b/src/uca-cam.c @@ -8,55 +8,3 @@ enum uca_cam_state uca_get_camera_state(struct uca_camera_t *cam) return cam->state; } -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 }, - { NULL, 0, 0 } -}; - -enum uca_property_ids uca_get_property_id(const char *property_name) -{ - char *name; - int i = 0; - while (property_map[i].name != NULL) { - if (!strcmp(property_map[i].name, property_name)) - return i; - i++; - } - return UCA_ERR_PROP_INVALID; -} - -struct uca_property_t *uca_get_full_property(enum uca_property_ids property_id) -{ - if ((property_id >= 0) && (property_id < UCA_PROP_LAST)) - return &property_map[property_id]; - return NULL; -} - -const char* uca_get_property_name(enum uca_property_ids property_id) -{ - if ((property_id >= 0) && (property_id < UCA_PROP_LAST)) - return property_map[property_id].name; -} diff --git a/src/uca-cam.h b/src/uca-cam.h index 99ed5f2..aacd5c3 100644 --- a/src/uca-cam.h +++ b/src/uca-cam.h @@ -4,6 +4,7 @@ #include <stdint.h> struct uca_camera_t; +struct uca_grabber_t; struct uca_property_t; enum uca_property_ids; @@ -22,7 +23,7 @@ enum uca_cam_state uca_get_camera_state(struct uca_camera_t *cam); * \brief Camera probing and initialization * \return UCA_ERR_INIT_NOT_FOUND if camera is not found or could not be initialized */ -typedef uint32_t (*uca_cam_init) (struct uca_camera_t **cam); +typedef uint32_t (*uca_cam_init) (struct uca_camera_t **cam, struct uca_grabber_t *grabber); /** * \brief Free camera resouces @@ -55,96 +56,7 @@ typedef uint32_t (*uca_cam_alloc) (struct uca_camera_t *cam, uint32_t n_buffers) */ typedef uint32_t (*uca_cam_acquire_image) (struct uca_camera_t *cam, void *buffer); -/** - * \brief Convert a property string to the corresponding ID - */ -enum uca_property_ids uca_get_property_id(const char *property_name); - -/** - * \brief Convert a property ID to the corresponding string - */ -const char* uca_get_property_name(enum uca_property_ids property_id); - -/** - * \brief Return the full property structure for a given ID - */ -struct uca_property_t *uca_get_full_property(enum uca_property_ids property_id); - - -/* The property IDs must start with 0 and must be continuous. Whenever this - * library is released, the IDs must not change to guarantee binary compatibility! */ -enum uca_property_ids { - UCA_PROP_NAME = 0, - UCA_PROP_WIDTH, - UCA_PROP_WIDTH_MIN, - UCA_PROP_WIDTH_MAX, - UCA_PROP_HEIGHT, - UCA_PROP_HEIGHT_MIN, - UCA_PROP_HEIGHT_MAX, - UCA_PROP_X_OFFSET, - UCA_PROP_Y_OFFSET, - UCA_PROP_BITDEPTH, - UCA_PROP_EXPOSURE, - UCA_PROP_EXPOSURE_MIN, - UCA_PROP_EXPOSURE_MAX, - UCA_PROP_DELAY, - UCA_PROP_DELAY_MIN, - UCA_PROP_DELAY_MAX, - UCA_PROP_FRAMERATE, - UCA_PROP_TRIGGER_MODE, - - /* pco.edge specific */ - UCA_PROP_TIMESTAMP_MODE, - UCA_PROP_SCAN_MODE, - - /* IPE camera specific */ - UCA_PROP_INTERLACE_SAMPLE_RATE, - UCA_PROP_INTERLACE_PIXEL_THRESH, - UCA_PROP_INTERLACE_ROW_THRESH, - - /* Photon Focus specific */ - UCA_PROP_CORRECTION_MODE, - - UCA_PROP_LAST -}; - -/* Possible timestamp modes for UCA_PROP_TIMESTAMP_MODE */ -#define UCA_TIMESTAMP_ASCII 0x01 -#define UCA_TIMESTAMP_BINARY 0x02 - -/* Trigger mode for UCA_PROP_TRIGGERMODE */ -#define UCA_TRIGGER_AUTO 1 -#define UCA_TRIGGER_INTERNAL 2 -#define UCA_TRIGGER_EXTERNAL 3 - -/* Correction modes for UCA_PROP_CORRECTION_MODE */ -#define UCA_CORRECT_OFFSET 0x01 -#define UCA_CORRECT_HOTPIXEL 0x02 -#define UCA_CORRECT_GAIN 0x04 -/** - * \brief Describe a camera property - */ -struct uca_property_t { - const char *name; - - enum uca_unit { - uca_pixel, - uca_bits, - uca_ns, - uca_us, - uca_ms, - uca_s, - uca_rows, - uca_na - } unit; - - enum uca_types { - uca_uint32t, - uca_uint8t, - uca_string - } type; -}; enum uca_cam_state { UCA_CAM_ERROR, @@ -164,6 +76,8 @@ struct uca_camera_t { /* Private */ uca_cam_destroy destroy; + + struct uca_grabber_t *grabber; enum uca_cam_state state; void *user; /**< private user data to be used by the camera driver */ diff --git a/src/uca-grabber.h b/src/uca-grabber.h index b01f453..ac2b955 100644 --- a/src/uca-grabber.h +++ b/src/uca-grabber.h @@ -36,6 +36,7 @@ struct uca_grabber_t { struct uca_grabber_t *next; /* Function pointers to grabber-specific methods */ + uca_grabber_destroy destroy; uca_grabber_set_property set_property; uca_grabber_get_property get_property; @@ -25,13 +25,47 @@ #include "cameras/photron.h" #endif +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 }, + { NULL, 0, 0 } +}; struct uca_t *uca_init() { struct uca_t *uca = (struct uca_t *) malloc(sizeof(struct uca_t)); uca->cameras = NULL; - uca_cam_init inits[] = { + uca_grabber_init grabber_inits[] = { +#ifdef HAVE_ME4 + uca_me4_init, +#endif + NULL + }; + + uca_cam_init cam_inits[] = { #ifdef HAVE_PCO_EDGE uca_pco_init, #endif @@ -44,15 +78,33 @@ struct uca_t *uca_init() #ifdef HAVE_PH uca_photron_init, #endif - NULL }; + NULL + }; int i = 0; - struct uca_camera_t* current = NULL; + struct uca_camera_t *current = NULL; + + /* Probe each frame grabber that is configured */ + struct uca_grabber_t *grabber = NULL; + while (grabber_inits[i] != NULL) { + uca_grabber_init init = grabber_inits[i]; + /* FIXME: we don't only want to take the first one */ + if (init(&grabber) != UCA_ERR_INIT_NOT_FOUND) + break; + } + + if (grabber == NULL) { + free(uca); + return NULL; + } + grabber->next = NULL; - while (inits[i] != NULL) { + /* Probe each camera that is configured */ + i = 0; + while (cam_inits[i] != NULL) { struct uca_camera_t *cam = NULL; - uca_cam_init init = inits[i]; - if (init(&cam) != UCA_ERR_INIT_NOT_FOUND) { + uca_cam_init init = cam_inits[i]; + if (init(&cam, grabber) != UCA_ERR_INIT_NOT_FOUND) { if (current == NULL) uca->cameras = current = cam; else { @@ -74,14 +126,47 @@ struct uca_t *uca_init() void uca_destroy(struct uca_t *uca) { if (uca != NULL) { - struct uca_camera_t *current = uca->cameras, *tmp; - while (current != NULL) { - tmp = current; - current->destroy(current); - current = current->next; + struct uca_camera_t *cam = uca->cameras, *tmp; + while (cam != NULL) { + tmp = cam; + cam->destroy(cam); + cam = cam->next; free(tmp); } + + struct uca_grabber_t *grabber = uca->grabbers, *tmpg; + while (grabber != NULL) { + tmpg = grabber; + grabber->destroy(grabber); + grabber = grabber->next; + free(grabber); + } + free(uca); } } +enum uca_property_ids uca_get_property_id(const char *property_name) +{ + char *name; + int i = 0; + while (property_map[i].name != NULL) { + if (!strcmp(property_map[i].name, property_name)) + return i; + i++; + } + return UCA_ERR_PROP_INVALID; +} + +struct uca_property_t *uca_get_full_property(enum uca_property_ids property_id) +{ + if ((property_id >= 0) && (property_id < UCA_PROP_LAST)) + return &property_map[property_id]; + return NULL; +} + +const char* uca_get_property_name(enum uca_property_ids property_id) +{ + if ((property_id >= 0) && (property_id < UCA_PROP_LAST)) + return property_map[property_id].name; +} @@ -26,6 +26,97 @@ struct uca_t *uca_init(void); */ void uca_destroy(struct uca_t *uca); +/** + * \brief Convert a property string to the corresponding ID + */ +enum uca_property_ids uca_get_property_id(const char *property_name); + +/** + * \brief Convert a property ID to the corresponding string + */ +const char* uca_get_property_name(enum uca_property_ids property_id); + +/** + * \brief Return the full property structure for a given ID + */ +struct uca_property_t *uca_get_full_property(enum uca_property_ids property_id); + + +/* The property IDs must start with 0 and must be continuous. Whenever this + * library is released, the IDs must not change to guarantee binary compatibility! */ +enum uca_property_ids { + UCA_PROP_NAME = 0, + UCA_PROP_WIDTH, + UCA_PROP_WIDTH_MIN, + UCA_PROP_WIDTH_MAX, + UCA_PROP_HEIGHT, + UCA_PROP_HEIGHT_MIN, + UCA_PROP_HEIGHT_MAX, + UCA_PROP_X_OFFSET, + UCA_PROP_Y_OFFSET, + UCA_PROP_BITDEPTH, + UCA_PROP_EXPOSURE, + UCA_PROP_EXPOSURE_MIN, + UCA_PROP_EXPOSURE_MAX, + UCA_PROP_DELAY, + UCA_PROP_DELAY_MIN, + UCA_PROP_DELAY_MAX, + UCA_PROP_FRAMERATE, + UCA_PROP_TRIGGER_MODE, + + /* pco.edge specific */ + UCA_PROP_TIMESTAMP_MODE, + UCA_PROP_SCAN_MODE, + + /* IPE camera specific */ + UCA_PROP_INTERLACE_SAMPLE_RATE, + UCA_PROP_INTERLACE_PIXEL_THRESH, + UCA_PROP_INTERLACE_ROW_THRESH, + + /* Photon Focus specific */ + UCA_PROP_CORRECTION_MODE, + + UCA_PROP_LAST +}; + +/* Possible timestamp modes for UCA_PROP_TIMESTAMP_MODE */ +#define UCA_TIMESTAMP_ASCII 0x01 +#define UCA_TIMESTAMP_BINARY 0x02 + +/* Trigger mode for UCA_PROP_TRIGGERMODE */ +#define UCA_TRIGGER_AUTO 1 +#define UCA_TRIGGER_INTERNAL 2 +#define UCA_TRIGGER_EXTERNAL 3 + +/* Correction modes for UCA_PROP_CORRECTION_MODE */ +#define UCA_CORRECT_OFFSET 0x01 +#define UCA_CORRECT_HOTPIXEL 0x02 +#define UCA_CORRECT_GAIN 0x04 + +/** + * \brief Describe a property used by cameras and frame grabbers + */ +struct uca_property_t { + const char *name; + + enum uca_unit { + uca_pixel, + uca_bits, + uca_ns, + uca_us, + uca_ms, + uca_s, + uca_rows, + uca_na + } unit; + + enum uca_types { + uca_uint32t, + uca_uint8t, + uca_string + } type; +}; + #define UCA_NO_ERROR 0 #define UCA_ERR_INIT_NOT_FOUND 1 /**< camera probing or initialization failed */ |