diff options
author | Timo Dritschler <timo.dritschler@kit.edu> | 2015-05-13 17:06:33 +0200 |
---|---|---|
committer | Timo Dritschler <timo.dritschler@kit.edu> | 2015-05-19 11:37:03 +0200 |
commit | 5e24887e06c306552dfd5f48f7ad94cc170bca30 (patch) | |
tree | 55f6671b6285f6691e9bc7dc6c27a5a3c18379ba /src | |
parent | 86d398e2029299e5f7de22263f97d770d146cab2 (diff) | |
download | uca-5e24887e06c306552dfd5f48f7ad94cc170bca30.tar.gz uca-5e24887e06c306552dfd5f48f7ad94cc170bca30.tar.bz2 uca-5e24887e06c306552dfd5f48f7ad94cc170bca30.tar.xz uca-5e24887e06c306552dfd5f48f7ad94cc170bca30.zip |
UcaCamera base class: Changed properties
Changed sensor-width, sensor-height and sensor-bitdepth to construct only
Added uca_camera_pspec_set_writable
mock: allow characterization at construction time
Its now possible to set sensor-width, sensor-height and sensor-bitdepth at construction time
Creation of random data is now controlled by a property and can be set while recording
Diffstat (limited to 'src')
-rw-r--r-- | src/uca-camera.c | 29 | ||||
-rw-r--r-- | src/uca-camera.h | 3 |
2 files changed, 26 insertions, 6 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c index a312a39..c36451c 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -372,15 +372,15 @@ uca_camera_class_init (UcaCameraClass *klass) g_param_spec_uint(uca_camera_props[PROP_SENSOR_WIDTH], "Width of sensor", "Width of the sensor in pixels", - 1, G_MAXUINT, 1, - G_PARAM_READABLE); + 1, G_MAXUINT, 512, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); camera_properties[PROP_SENSOR_HEIGHT] = g_param_spec_uint(uca_camera_props[PROP_SENSOR_HEIGHT], "Height of sensor", "Height of the sensor in pixels", - 1, G_MAXUINT, 1, - G_PARAM_READABLE); + 1, G_MAXUINT, 512, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); camera_properties[PROP_SENSOR_PIXEL_WIDTH] = g_param_spec_double (uca_camera_props[PROP_SENSOR_PIXEL_WIDTH], @@ -400,8 +400,8 @@ uca_camera_class_init (UcaCameraClass *klass) g_param_spec_uint(uca_camera_props[PROP_SENSOR_BITDEPTH], "Number of bits per pixel", "Number of bits per pixel", - 1, 32, 1, - G_PARAM_READABLE); + 1, 32, 8, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); camera_properties[PROP_SENSOR_HORIZONTAL_BINNING] = g_param_spec_uint(uca_camera_props[PROP_SENSOR_HORIZONTAL_BINNING], @@ -1154,7 +1154,24 @@ uca_camera_set_writable (UcaCamera *camera, GParamSpec *pspec; pspec = get_param_spec_by_name (camera, prop_name); + uca_camera_pspec_set_writable (pspec, writable); +} +/** + * uca_camera_pspec_set_writable: (skip) + * @pspec: A #GParamSpec + * @writable: %TRUE if property can be written during acquisition + * + * Sets a flag that defines if the property defined by @pspec can be written + * during an acquisition. This can be used during UcaCamera class + * initialization. + * + * Since: 2.1 + */ +void +uca_camera_pspec_set_writable (GParamSpec *pspec, + gboolean writable) +{ if (pspec != NULL) { if (g_param_spec_get_qdata (pspec, UCA_WRITABLE_QUARK) != NULL) g_warning ("::%s is already fixed", pspec->name); diff --git a/src/uca-camera.h b/src/uca-camera.h index 97d3e6e..af95123 100644 --- a/src/uca-camera.h +++ b/src/uca-camera.h @@ -179,6 +179,9 @@ UcaUnit uca_camera_get_unit (UcaCamera *camera, void uca_camera_set_writable (UcaCamera *camera, const gchar *prop_name, gboolean writable); +void uca_camera_pspec_set_writable + (GParamSpec *pspec, + gboolean writable); gboolean uca_camera_is_writable_during_acquisition (UcaCamera *camera, const gchar *prop_name); |