summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-05-02 10:31:22 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2013-05-02 10:31:22 +0200
commit5a9276f2ca8efd32ba35224bf83ab4f024a0d8de (patch)
treefd897c45deb816980b7886543151b65028ed7e68 /src
parent4784c2e457649d6452817f134aba33dff668b028 (diff)
downloaduca-5a9276f2ca8efd32ba35224bf83ab4f024a0d8de.tar.gz
uca-5a9276f2ca8efd32ba35224bf83ab4f024a0d8de.tar.bz2
uca-5a9276f2ca8efd32ba35224bf83ab4f024a0d8de.tar.xz
uca-5a9276f2ca8efd32ba35224bf83ab4f024a0d8de.zip
Add sensor-pixel-width and sensor-pixel-height
To all camera authors: you should override these values and provide the correct pixel sizes.
Diffstat (limited to 'src')
-rw-r--r--src/uca-camera.c28
-rw-r--r--src/uca-camera.h2
2 files changed, 30 insertions, 0 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c
index 10a54b3..d0c99dc 100644
--- a/src/uca-camera.c
+++ b/src/uca-camera.c
@@ -86,6 +86,8 @@ const gchar *uca_camera_props[N_BASE_PROPERTIES] = {
"name",
"sensor-width",
"sensor-height",
+ "sensor-pixel-width",
+ "sensor-pixel-height",
"sensor-bitdepth",
"sensor-horizontal-binning",
"sensor-horizontal-binnings",
@@ -195,6 +197,16 @@ uca_camera_get_property(GObject *object, guint property_id, GValue *value, GPara
g_value_set_uint (value, 0);
break;
+ case PROP_SENSOR_PIXEL_WIDTH:
+ /* 10um is an arbitrary default, cameras should definitely override
+ * this. */
+ g_value_set_double (value, 10e-6);
+ break;
+
+ case PROP_SENSOR_PIXEL_HEIGHT:
+ g_value_set_double (value, 10e-6);
+ break;
+
case PROP_SENSOR_HORIZONTAL_BINNINGS:
g_value_set_boxed (value, priv->h_binnings);
break;
@@ -252,6 +264,20 @@ uca_camera_class_init (UcaCameraClass *klass)
1, G_MAXUINT, 1,
G_PARAM_READABLE);
+ camera_properties[PROP_SENSOR_PIXEL_WIDTH] =
+ g_param_spec_double (uca_camera_props[PROP_SENSOR_PIXEL_WIDTH],
+ "Width of sensor pixel in meters",
+ "Width of sensor pixel in meters",
+ G_MINDOUBLE, G_MAXDOUBLE, 10e-6,
+ G_PARAM_READABLE);
+
+ camera_properties[PROP_SENSOR_PIXEL_HEIGHT] =
+ g_param_spec_double (uca_camera_props[PROP_SENSOR_PIXEL_HEIGHT],
+ "Height of sensor pixel in meters",
+ "Height of sensor pixel in meters",
+ G_MINDOUBLE, G_MAXDOUBLE, 10e-6,
+ G_PARAM_READABLE);
+
camera_properties[PROP_SENSOR_BITDEPTH] =
g_param_spec_uint(uca_camera_props[PROP_SENSOR_BITDEPTH],
"Number of bits per pixel",
@@ -437,6 +463,8 @@ uca_camera_init (UcaCamera *camera)
uca_camera_set_property_unit (camera_properties[PROP_SENSOR_WIDTH], UCA_UNIT_PIXEL);
uca_camera_set_property_unit (camera_properties[PROP_SENSOR_HEIGHT], UCA_UNIT_PIXEL);
+ uca_camera_set_property_unit (camera_properties[PROP_SENSOR_PIXEL_WIDTH], UCA_UNIT_METER);
+ uca_camera_set_property_unit (camera_properties[PROP_SENSOR_PIXEL_HEIGHT], UCA_UNIT_METER);
uca_camera_set_property_unit (camera_properties[PROP_SENSOR_BITDEPTH], UCA_UNIT_COUNT);
uca_camera_set_property_unit (camera_properties[PROP_SENSOR_HORIZONTAL_BINNING], UCA_UNIT_PIXEL);
uca_camera_set_property_unit (camera_properties[PROP_SENSOR_VERTICAL_BINNING], UCA_UNIT_PIXEL);
diff --git a/src/uca-camera.h b/src/uca-camera.h
index f6fdace..cf21609 100644
--- a/src/uca-camera.h
+++ b/src/uca-camera.h
@@ -68,6 +68,8 @@ enum {
PROP_NAME,
PROP_SENSOR_WIDTH,
PROP_SENSOR_HEIGHT,
+ PROP_SENSOR_PIXEL_WIDTH,
+ PROP_SENSOR_PIXEL_HEIGHT,
PROP_SENSOR_BITDEPTH,
PROP_SENSOR_HORIZONTAL_BINNING,
PROP_SENSOR_HORIZONTAL_BINNINGS,