From 216dcc7271b2eadc5d2681a44098e7ddc5450898 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 28 Oct 2018 02:28:33 +0100 Subject: Hard-code CMOSIS20 parameters --- config.h.in | 3 +++ uca-ufo-camera.c | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config.h.in b/config.h.in index 4cbc926..5cdc2b7 100644 --- a/config.h.in +++ b/config.h.in @@ -1,2 +1,5 @@ #cmakedefine CMOSIS_SENSOR_WIDTH @CMOSIS_SENSOR_WIDTH@ #cmakedefine CMOSIS_SENSOR_HEIGHT @CMOSIS_SENSOR_HEIGHT@ +#define CMOSIS_PIXEL_WIDTH 6.4e-6 +#define CMOSIS_PIXEL_HEIGHT 6.4e-6 +#define CMOSIS_SENSOR_NAME "Ufo Camera w/ CMOSIS CMV20000" diff --git a/uca-ufo-camera.c b/uca-ufo-camera.c index 40bc13a..76a3501 100644 --- a/uca-ufo-camera.c +++ b/uca-ufo-camera.c @@ -17,12 +17,15 @@ #include "config.h" +#define _XOPEN_SOURCE 500 + #include #include #include #include #include #include +#include #include #include #include @@ -90,6 +93,8 @@ static gint base_overrideables[] = { PROP_NAME, PROP_SENSOR_WIDTH, PROP_SENSOR_HEIGHT, + PROP_SENSOR_PIXEL_WIDTH, + PROP_SENSOR_PIXEL_HEIGHT, PROP_SENSOR_BITDEPTH, PROP_EXPOSURE_TIME, PROP_FRAMES_PER_SECOND, @@ -594,6 +599,12 @@ uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, G case PROP_SENSOR_HEIGHT: g_value_set_uint (value, CMOSIS_SENSOR_HEIGHT); break; + case PROP_SENSOR_PIXEL_WIDTH: + g_value_set_double (value, CMOSIS_PIXEL_WIDTH); + break; + case PROP_SENSOR_PIXEL_HEIGHT: + g_value_set_double (value, CMOSIS_PIXEL_HEIGHT); + break; case PROP_SENSOR_BITDEPTH: g_value_set_uint (value, priv->n_bits); break; @@ -655,7 +666,7 @@ uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, G g_value_set_uint (value, priv->roi_height); break; case PROP_NAME: - g_value_set_string (value, "Ufo Camera w/ CMOSIS CMV2000"); + g_value_set_string (value, CMOSIS_SENSOR_NAME); break; case PROP_TIMEOUT: g_value_set_uint64 (value, priv->timeout); -- cgit v1.2.3