summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2015-05-19 12:02:36 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2015-05-19 12:02:36 +0200
commitb9388b6b30d8eb66f91c817f0c409c0af3753289 (patch)
tree5c9062eb0440dbb88b78b92a16ab11b5406e753b /src
parent106745eed96ac97b9cc5c4250746842a19eaef65 (diff)
parent06c5667a7be7b11a87b939e78d41efe90fc437ae (diff)
downloadlibuca-b9388b6b30d8eb66f91c817f0c409c0af3753289.tar.gz
libuca-b9388b6b30d8eb66f91c817f0c409c0af3753289.tar.bz2
libuca-b9388b6b30d8eb66f91c817f0c409c0af3753289.tar.xz
libuca-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.c29
-rw-r--r--src/uca-camera.h3
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);