[aravis] camera: add width and height get_bounds functions.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] camera: add width and height get_bounds functions.
- Date: Wed, 16 Feb 2011 09:30:07 +0000 (UTC)
commit d784fe4947e9a55bc3db5e06d831b42f682cd8a8
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Tue Feb 15 22:17:56 2011 +0100
camera: add width and height get_bounds functions.
src/arvcamera.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
src/arvcamera.h | 8 +++++---
2 files changed, 47 insertions(+), 8 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index b18ed66..f39688c 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -169,7 +169,7 @@ arv_camera_get_sensor_size (ArvCamera *camera, gint *width, gint *height)
*/
void
-arv_camera_set_region (ArvCamera *camera, int x, int y, int width, int height)
+arv_camera_set_region (ArvCamera *camera, gint x, gint y, gint width, gint height)
{
g_return_if_fail (ARV_IS_CAMERA (camera));
@@ -209,6 +209,36 @@ arv_camera_get_region (ArvCamera *camera, gint *x, gint *y, gint *width, gint *h
*height = arv_device_get_integer_feature_value (camera->priv->device, "Height");
}
+void
+arv_camera_get_width_bounds (ArvCamera *camera, gint *min, gint *max)
+{
+ gint64 min64, max64;
+
+ g_return_if_fail (ARV_IS_CAMERA (camera));
+
+ arv_device_get_integer_feature_bounds (camera->priv->device, "Width", &min64, &max64);
+
+ if (min != NULL)
+ *min = min64;
+ if (max != NULL)
+ *max = max64;
+}
+
+void
+arv_camera_get_height_bounds (ArvCamera *camera, gint *min, gint *max)
+{
+ gint64 min64, max64;
+
+ g_return_if_fail (ARV_IS_CAMERA (camera));
+
+ arv_device_get_integer_feature_bounds (camera->priv->device, "Height", &min64, &max64);
+
+ if (min != NULL)
+ *min = min64;
+ if (max != NULL)
+ *max = max64;
+}
+
/**
* arv_camera_set_binning:
* @camera: a #ArvCamera
@@ -560,7 +590,7 @@ arv_camera_get_exposure_time_auto (ArvCamera *camera)
*/
void
-arv_camera_set_gain (ArvCamera *camera, gint64 gain)
+arv_camera_set_gain (ArvCamera *camera, gint gain)
{
g_return_if_fail (ARV_IS_CAMERA (camera));
@@ -576,7 +606,7 @@ arv_camera_set_gain (ArvCamera *camera, gint64 gain)
* Return value: the current gain setting.
*/
-gint64
+gint
arv_camera_get_gain (ArvCamera *camera)
{
g_return_val_if_fail (ARV_IS_CAMERA (camera), 0.0);
@@ -585,11 +615,18 @@ arv_camera_get_gain (ArvCamera *camera)
}
void
-arv_camera_get_gain_bounds (ArvCamera *camera, gint64 *min, gint64 *max)
+arv_camera_get_gain_bounds (ArvCamera *camera, gint *min, gint *max)
{
+ gint64 min64, max64;
+
g_return_if_fail (ARV_IS_CAMERA (camera));
- arv_device_get_integer_feature_bounds (camera->priv->device, "GainRaw", min, max);
+ arv_device_get_integer_feature_bounds (camera->priv->device, "GainRaw", &min64, &max64);
+
+ if (min != NULL)
+ *min = min64;
+ if (max != NULL)
+ *max = max64;
}
void
diff --git a/src/arvcamera.h b/src/arvcamera.h
index 3471046..3ab3be6 100644
--- a/src/arvcamera.h
+++ b/src/arvcamera.h
@@ -66,6 +66,8 @@ const char * arv_camera_get_device_id (ArvCamera *camera);
void arv_camera_get_sensor_size (ArvCamera *camera, gint *width, gint *height);
void arv_camera_set_region (ArvCamera *camera, gint x, gint y, gint width, gint height);
void arv_camera_get_region (ArvCamera *camera, gint *x, gint *y, gint *width, gint *height);
+void arv_camera_get_width_bounds (ArvCamera *camera, gint *min, gint *max);
+void arv_camera_get_height_bounds (ArvCamera *camera, gint *min, gint *max);
void arv_camera_set_binning (ArvCamera *camera, gint dx, gint dy);
void arv_camera_get_binning (ArvCamera *camera, gint *dx, gint *dy);
void arv_camera_set_pixel_format (ArvCamera *camera, ArvPixelFormat format);
@@ -91,9 +93,9 @@ ArvAuto arv_camera_get_exposure_time_auto (ArvCamera *camera);
/* 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);
+void arv_camera_set_gain (ArvCamera *camera, gint gain);
+gint arv_camera_get_gain (ArvCamera *camera);
+void arv_camera_get_gain_bounds (ArvCamera *camera, gint *min, gint *max);
void arv_camera_set_gain_auto (ArvCamera *camera, ArvAuto auto_mode);
ArvAuto arv_camera_get_gain_auto (ArvCamera *camera);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]