[aravis] arv_camera: add helper functions for gain and exposure bounds.



commit 3ab718145bb4bc363903052a67c23243768439c2
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Tue Jan 4 23:17:04 2011 +0100

    arv_camera: add helper functions for gain and exposure bounds.

 docs/reference/aravis/aravis-sections.txt |    4 +++
 src/arvcamera.c                           |   16 +++++++++++++
 src/arvcamera.h                           |    2 +
 src/arvdevice.c                           |   36 +++++++++++++++++++++++++++-
 src/arvdevice.h                           |   12 ++++++++-
 5 files changed, 66 insertions(+), 4 deletions(-)
---
diff --git a/docs/reference/aravis/aravis-sections.txt b/docs/reference/aravis/aravis-sections.txt
index 357eebd..63b3198 100644
--- a/docs/reference/aravis/aravis-sections.txt
+++ b/docs/reference/aravis/aravis-sections.txt
@@ -25,8 +25,10 @@ arv_camera_get_frame_rate
 arv_camera_set_trigger
 arv_camera_set_exposure_time
 arv_camera_get_exposure_time
+arv_camera_get_exposure_time_bounds
 arv_camera_set_gain
 arv_camera_get_gain
+arv_camera_get_gain_bounds
 arv_camera_get_payload
 ArvAcquisitionMode
 arv_acquisition_mode_to_string
@@ -145,8 +147,10 @@ arv_device_set_string_feature_value
 arv_device_get_string_feature_value
 arv_device_set_integer_feature_value
 arv_device_get_integer_feature_value
+arv_device_get_integer_feature_bounds
 arv_device_set_float_feature_value
 arv_device_get_float_feature_value
+arv_device_get_float_feature_bounds
 <SUBSECTION Standard>
 ARV_DEVICE
 ARV_IS_DEVICE
diff --git a/src/arvcamera.c b/src/arvcamera.c
index 25e5763..fa1eef1 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -477,6 +477,14 @@ arv_camera_get_exposure_time (ArvCamera *camera)
 	return arv_device_get_float_feature_value (camera->priv->device, "ExposureTimeAbs");
 }
 
+void
+arv_camera_get_exposure_time_bounds (ArvCamera *camera, double *min, double *max)
+{
+	g_return_if_fail (ARV_IS_CAMERA (camera));
+
+	arv_device_get_float_feature_bounds (camera->priv->device, "ExposureTimeAbs", min, max);
+}
+
 /* Analog control */
 
 /**
@@ -512,6 +520,14 @@ arv_camera_get_gain (ArvCamera *camera)
 	return arv_device_get_integer_feature_value (camera->priv->device, "GainRaw");
 }
 
+void
+arv_camera_get_gain_bounds (ArvCamera *camera, gint64 *min, gint64 *max)
+{
+	g_return_if_fail (ARV_IS_CAMERA (camera));
+
+	arv_device_get_integer_feature_bounds (camera->priv->device, "GainRaw", min, max);
+}
+
 /* Transport layer control */
 
 /**
diff --git a/src/arvcamera.h b/src/arvcamera.h
index 85aa5f8..ff2c42d 100644
--- a/src/arvcamera.h
+++ b/src/arvcamera.h
@@ -98,11 +98,13 @@ void		arv_camera_set_trigger			(ArvCamera *camera, const char *source);
 
 void 		arv_camera_set_exposure_time 		(ArvCamera *camera, double exposure_time_us);
 double 		arv_camera_get_exposure_time 		(ArvCamera *camera);
+void		arv_camera_get_exposure_time_bounds	(ArvCamera *camera, double *min, double *max);
 
 /* Analog control */
 
 void 		arv_camera_set_gain	 	(ArvCamera *camera, gint64 gain);
 gint64 		arv_camera_get_gain 		(ArvCamera *camera);
+void		arv_camera_get_gain_bounds	(ArvCamera *camera, gint64 *min, gint64 *max);
 
 /* Transport layer control */
 
diff --git a/src/arvdevice.c b/src/arvdevice.c
index 5a0d8af..c4247d7 100644
--- a/src/arvdevice.c
+++ b/src/arvdevice.c
@@ -151,7 +151,7 @@ arv_device_get_string_feature_value (ArvDevice *device, const char *feature)
 }
 
 void
-arv_device_set_integer_feature_value (ArvDevice *device, const char *feature, guint64 value)
+arv_device_set_integer_feature_value (ArvDevice *device, const char *feature, gint64 value)
 {
 	ArvGc *genicam;
 	ArvGcNode *node;
@@ -168,7 +168,7 @@ arv_device_set_integer_feature_value (ArvDevice *device, const char *feature, gu
 		arv_gc_boolean_set_value (ARV_GC_BOOLEAN (node), value);
 }
 
-guint64
+gint64
 arv_device_get_integer_feature_value (ArvDevice *device, const char *feature)
 {
 	ArvGc *genicam;
@@ -189,6 +189,25 @@ arv_device_get_integer_feature_value (ArvDevice *device, const char *feature)
 }
 
 void
+arv_device_get_integer_feature_bounds (ArvDevice *device, const char *feature, gint64 *min, gint64 *max)
+{
+	ArvGc *genicam;
+	ArvGcNode *node;
+
+	genicam = arv_device_get_genicam (device);
+	g_return_if_fail (ARV_IS_GC (genicam));
+
+	node = arv_gc_get_node (genicam, feature);
+	if (ARV_IS_GC_INTEGER (node)) {
+		if (min != NULL)
+			*min = arv_gc_integer_get_min (ARV_GC_INTEGER (node));
+		if (max != NULL)
+			*max = arv_gc_integer_get_max (ARV_GC_INTEGER (node));
+		return;
+	}
+}
+
+void
 arv_device_set_float_feature_value (ArvDevice *device, const char *feature, double value)
 {
 	ArvGc *genicam;
@@ -206,6 +225,19 @@ arv_device_get_float_feature_value (ArvDevice *device, const char *feature)
 	return arv_gc_float_get_value (ARV_GC_FLOAT (arv_gc_get_node (genicam, feature)));
 }
 
+void
+arv_device_get_float_feature_bounds (ArvDevice *device, const char *feature, double *min, double *max)
+{
+	ArvGc *genicam;
+
+	genicam = arv_device_get_genicam (device);
+
+	if (min != NULL)
+		*min = arv_gc_float_get_min (ARV_GC_FLOAT (arv_gc_get_node (genicam, feature)));
+	if (max != NULL)
+		*max = arv_gc_float_get_max (ARV_GC_FLOAT (arv_gc_get_node (genicam, feature)));
+}
+
 static void
 arv_device_init (ArvDevice *device)
 {
diff --git a/src/arvdevice.h b/src/arvdevice.h
index 3e871a3..32250b0 100644
--- a/src/arvdevice.h
+++ b/src/arvdevice.h
@@ -65,13 +65,21 @@ gboolean 	arv_device_read_register	(ArvDevice *device, guint32 address, guint32
 gboolean	arv_device_write_register 	(ArvDevice *device, guint32 address, guint32 value);
 
 ArvGc *		arv_device_get_genicam			(ArvDevice *device);
+
 void 		arv_device_execute_command 		(ArvDevice *device, const char *feature);
+
 void		arv_device_set_string_feature_value	(ArvDevice *device, const char *feature, const char *value);
 const char *	arv_device_get_string_feature_value	(ArvDevice *device, const char *feature);
-void		arv_device_set_integer_feature_value	(ArvDevice *device, const char *feature, guint64 value);
-guint64		arv_device_get_integer_feature_value	(ArvDevice *device, const char *feature);
+
+void		arv_device_set_integer_feature_value	(ArvDevice *device, const char *feature, gint64 value);
+gint64		arv_device_get_integer_feature_value	(ArvDevice *device, const char *feature);
+void 		arv_device_get_integer_feature_bounds 	(ArvDevice *device, const char *feature,
+							 gint64 *min, gint64 *max);
+
 void		arv_device_set_float_feature_value	(ArvDevice *device, const char *feature, double value);
 double		arv_device_get_float_feature_value	(ArvDevice *device, const char *feature);
+void 		arv_device_get_float_feature_bounds 	(ArvDevice *device, const char *feature,
+							 double *min, double *max);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]