diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2015-05-19 12:02:36 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2015-05-19 12:02:36 +0200 |
commit | b9388b6b30d8eb66f91c817f0c409c0af3753289 (patch) | |
tree | 5c9062eb0440dbb88b78b92a16ab11b5406e753b /src | |
parent | 106745eed96ac97b9cc5c4250746842a19eaef65 (diff) | |
parent | 06c5667a7be7b11a87b939e78d41efe90fc437ae (diff) | |
download | uca-b9388b6b30d8eb66f91c817f0c409c0af3753289.tar.gz uca-b9388b6b30d8eb66f91c817f0c409c0af3753289.tar.bz2 uca-b9388b6b30d8eb66f91c817f0c409c0af3753289.tar.xz uca-b9388b6b30d8eb66f91c817f0c409c0af3753289.zip |
Merge pull request #67 from ufo-kit/mock-dynamic-size
Mock dynamic size
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); |