diff options
-rw-r--r-- | src/cameras/uca-pco-camera.c | 19 | ||||
-rw-r--r-- | test/grab.c | 24 |
2 files changed, 33 insertions, 10 deletions
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c index 55a8f5d..27f5427 100644 --- a/src/cameras/uca-pco-camera.c +++ b/src/cameras/uca-pco-camera.c @@ -382,9 +382,22 @@ static void uca_pco_camera_start_recording(UcaCamera *camera, GError **error) guint err = PCO_NOERROR; UcaPcoCameraPrivate *priv = UCA_PCO_CAMERA_GET_PRIVATE(camera); + guint16 binned_width, binned_height; + gboolean use_extended = FALSE; - guint16 binned_width = priv->width / priv->binning_h; - guint16 binned_height = priv->height / priv->binning_v; + g_object_get (camera, "sensor-extended", &use_extended, NULL); + + if (use_extended) { + binned_width = priv->width_ex; + binned_height = priv->height_ex; + } + else { + binned_width = priv->width; + binned_height = priv->height; + } + + binned_width /= priv->binning_h; + binned_height /= priv->binning_v; if ((priv->roi_x + priv->roi_width > binned_width) || (priv->roi_y + priv->roi_height > binned_height)) { g_set_error(error, UCA_PCO_CAMERA_ERROR, UCA_PCO_CAMERA_ERROR_UNSUPPORTED, @@ -548,7 +561,7 @@ static void uca_pco_camera_set_property(GObject *object, guint property_id, cons switch (property_id) { case PROP_SENSOR_EXTENDED: { - guint16 format = g_value_get_boolean(value) ? SENSORFORMAT_EXTENDED : SENSORFORMAT_STANDARD; + guint16 format = g_value_get_boolean (value) ? SENSORFORMAT_EXTENDED : SENSORFORMAT_STANDARD; pco_set_sensor_format(priv->pco, format); } break; diff --git a/test/grab.c b/test/grab.c index fa4d6c3..2a9d9ea 100644 --- a/test/grab.c +++ b/test/grab.c @@ -38,7 +38,9 @@ int main(int argc, char *argv[]) { GError *error = NULL; (void) signal(SIGINT, sigint_handler); - guint sensor_width, sensor_height, roi_width, roi_height, roi_x, roi_y, bits, sensor_rate; + guint sensor_width, sensor_height, sensor_width_extended, sensor_height_extended; + guint roi_width, roi_height, roi_x, roi_y; + guint bits, sensor_rate; g_type_init(); camera = uca_camera_new("pco", &error); @@ -48,18 +50,24 @@ int main(int argc, char *argv[]) return 1; } + g_object_get(G_OBJECT(camera), + "sensor-width", &sensor_width, + "sensor-height", &sensor_height, + "sensor-width-extended", &sensor_width_extended, + "sensor-height-extended", &sensor_height_extended, + NULL); + g_object_set(G_OBJECT(camera), "exposure-time", 0.1, "delay-time", 0.0, "roi-x0", 0, "roi-y0", 0, - "roi-width", 1024, - "roi-height", 512, + "sensor-extended", FALSE, + "roi-width", sensor_width, + "roi-height", sensor_height, NULL); g_object_get(G_OBJECT(camera), - "sensor-width", &sensor_width, - "sensor-height", &sensor_height, "roi-width", &roi_width, "roi-height", &roi_height, "roi-x0", &roi_x, @@ -68,8 +76,10 @@ int main(int argc, char *argv[]) "sensor-pixelrate", &sensor_rate, NULL); - g_print("Sensor: %ix%i px, ROI %ix%i @ (%i, %i) and %i Hz\n", - sensor_width, sensor_height, roi_width, roi_height, roi_x, roi_y, sensor_rate); + g_print("Sensor: %ix%i px (extended: %ix%i), ROI %ix%i @ (%i, %i) and %i Hz\n", + sensor_width, sensor_height, + sensor_width_extended, sensor_height_extended, + roi_width, roi_height, roi_x, roi_y, sensor_rate); const int pixel_size = bits == 8 ? 1 : 2; gpointer buffer = g_malloc0(roi_width * roi_height * pixel_size); |