-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path01-single-acquisition.c
More file actions
52 lines (39 loc) · 1.1 KB
/
01-single-acquisition.c
File metadata and controls
52 lines (39 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* SPDX-License-Identifier:Unlicense */
/* Aravis header */
#include <arv.h>
/* Standard headers */
#include <stdlib.h>
#include <stdio.h>
/*
* Connect to the first available camera, then acquire a single buffer.
*/
int
main (int argc, char **argv)
{
ArvCamera *camera;
ArvBuffer *buffer;
GError *error = NULL;
/* Connect to the first available camera */
camera = arv_camera_new (NULL, &error);
if (ARV_IS_CAMERA (camera)) {
printf ("Found camera '%s'\n", arv_camera_get_model_name (camera, NULL));
/* Acquire a single buffer */
buffer = arv_camera_acquisition (camera, 0, &error);
if (ARV_IS_BUFFER (buffer)) {
/* Display some informations about the retrieved buffer */
printf ("Acquired %d×%d buffer\n",
arv_buffer_get_image_width (buffer),
arv_buffer_get_image_height (buffer));
/* Destroy the buffer */
g_clear_object (&buffer);
}
/* Destroy the camera instance */
g_clear_object (&camera);
}
if (error != NULL) {
/* An error happened, display the correspdonding message */
printf ("Error: %s\n", error->message);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}