diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-06-07 15:45:06 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-06-07 15:45:06 +0200 |
commit | bf83e234755ea390c92f05c4b701cf8ee57c2526 (patch) | |
tree | 075b786b0fb954c80480b2d17e4a9082fd7d56c5 | |
parent | bbc279b61484fb073a6d0ab6cc368f26ded5f4d3 (diff) | |
download | uca-bf83e234755ea390c92f05c4b701cf8ee57c2526.tar.gz uca-bf83e234755ea390c92f05c4b701cf8ee57c2526.tar.bz2 uca-bf83e234755ea390c92f05c4b701cf8ee57c2526.tar.xz uca-bf83e234755ea390c92f05c4b701cf8ee57c2526.zip |
Hotpixel correction and cam_state -> uca.h
-rw-r--r-- | src/cameras/pco.c | 11 | ||||
-rw-r--r-- | src/uca-cam.h | 9 | ||||
-rw-r--r-- | src/uca.c | 1 | ||||
-rw-r--r-- | src/uca.h | 11 | ||||
-rw-r--r-- | test/grab.c | 2 |
5 files changed, 34 insertions, 0 deletions
diff --git a/src/cameras/pco.c b/src/cameras/pco.c index c11ba24..e643ab0 100644 --- a/src/cameras/pco.c +++ b/src/cameras/pco.c @@ -90,6 +90,9 @@ static uint32_t uca_pco_set_property(struct uca_camera_priv *cam, enum uca_prope case UCA_PROP_TIMESTAMP_MODE: return pco_set_timestamp_mode(GET_PCO(cam), *((uint16_t *) data)); + case UCA_PROP_HOTPIXEL_CORRECTION: + return pco_set_hotpixel_correction(GET_PCO(cam), *(uint32_t *) data); + default: return err | UCA_ERR_INVALID; } @@ -219,6 +222,14 @@ static uint32_t uca_pco_get_property(struct uca_camera_priv *cam, enum uca_prope } break; + case UCA_PROP_HOTPIXEL_CORRECTION: + { + SC2_Hot_Pixel_Correction_Mode_Response response; + if (pco_read_property(pco, GET_HOT_PIXEL_CORRECTION_MODE, &response, sizeof(response)) == PCO_NOERROR) + uca_set_void(data, uint32_t, response.wMode); + } + break; + default: return UCA_ERR_CAMERA | UCA_ERR_PROP | UCA_ERR_INVALID; } diff --git a/src/uca-cam.h b/src/uca-cam.h index 8b6fc0d..a194054 100644 --- a/src/uca-cam.h +++ b/src/uca-cam.h @@ -19,6 +19,15 @@ extern "C" { enum uca_property_ids; +/** + * Describes the current state of the camera. + */ +enum uca_cam_state { + UCA_CAM_CONFIGURABLE, /**< Camera can be configured and is not recording */ + UCA_CAM_ARMED, /**< Camera is ready for recording */ + UCA_CAM_RECORDING, /**< Camera is currently recording */ +}; + /* * --- non-virtual methods ---------------------------------------------------- */ @@ -84,6 +84,7 @@ static struct uca_property property_map[UCA_PROP_LAST+1] = { { "Grabber.Synchronous", uca_bool, uca_uint32t, uca_readwrite }, { "Mode.Timestamp", uca_na, uca_uint32t, uca_readwrite }, { "Mode.Scan", uca_na, uca_uint32t, uca_readwrite }, + { "Mode.Hotpixel", uca_na, uca_uint32t, uca_readwrite }, { "Interlace.Samplerate", uca_na, uca_uint32t, uca_readwrite }, { "Interlace.Threshold.Pixel", uca_na, uca_uint32t, uca_readwrite }, { "Interlace.Threshold.Row", uca_na, uca_uint32t, uca_readwrite }, @@ -112,6 +112,7 @@ enum uca_property_ids { /* pco.edge specific */ UCA_PROP_TIMESTAMP_MODE, UCA_PROP_SCAN_MODE, + UCA_PROP_HOTPIXEL_CORRECTION, /* IPE camera specific */ UCA_PROP_INTERLACE_SAMPLE_RATE, @@ -225,6 +226,16 @@ union uca_value { }; /** + * Describes the current state of the camera. + */ +enum uca_cam_state { + UCA_CAM_CONFIGURABLE, /**< Camera can be configured and is not recording */ + UCA_CAM_ARMED, /**< Camera is ready for recording */ + UCA_CAM_RECORDING, /**< Camera is currently recording */ +}; + + +/** * Grab callback. * * Register such a callback function with uca_cam_register_callback() to diff --git a/test/grab.c b/test/grab.c index 9f86069..e614e03 100644 --- a/test/grab.c +++ b/test/grab.c @@ -25,6 +25,8 @@ int main(int argc, char *argv[]) val = 1; handle_error(uca_cam_set_property(cam, UCA_PROP_GRAB_SYNCHRONOUS, &val)); + val = 0; + handle_error(uca_cam_set_property(cam, UCA_PROP_HOTPIXEL_CORRECTION, &val)); uint32_t width, height, bits; handle_error(uca_cam_get_property(cam, UCA_PROP_WIDTH, &width, 0)); |