photo.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2009, Robert Bosch LLC.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the Robert Bosch nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *
35  *********************************************************************/
36 #ifndef PHOTO_H
37 #define PHOTO_H
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 #include <gphoto2/gphoto2-camera.h>
44 #include <gphoto2/gphoto2-port-log.h>
45 #include <gphoto2/gphoto2-setting.h>
46 #include <gphoto2/gphoto2-filesys.h>
47 #include <photo/photo_image.h>
48 
49 #define PHOTO_MODE_DIRECT 0
50 #define PHOTO_MODE_TO_FILE 1
51 
52 typedef struct {
53  Camera *cam;
54  GPContext *context;
55  int mode;
56 } photo_t, *photo_p;
57 
58 /* initialize a new photo */
59 photo_p photo_initialize(void);
60 
61 /* release photo memory */
62 void photo_free(photo_p photo);
63 
64 /* open a specific USB connection the photo */
65 int photo_open(photo_p photo, const char *model, const char *port);
66 
67 /* open the first photo detected on the USB bus */
68 int photo_autodetect(photo_p photo);
69 
70 /* close the photo */
71 int photo_close(photo_p photo);
72 
73 /* set a photo parameter */
74 int photo_set_config(photo_p photo, const char *param, const char *value);
75 
76 /* get a photo parameter */
77 int photo_get_config(photo_p photo, const char *param, char **value);
78 
79 /* capture an image */
80 int photo_capture(photo_p photo, photo_image_p image);
81 
82 /* capture an image to file */
83 int photo_capture_to_file(photo_p photo, const char *filename);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif
Definition: photo.h:52
int mode
Definition: photo.h:55
int photo_get_config(photo_p photo, const char *param, char **value)
GPContext * context
Definition: photo.h:54
void photo_free(photo_p photo)
Camera * cam
Definition: photo.h:53
photo_p photo_initialize(void)
int photo_capture_to_file(photo_p photo, const char *filename)
struct photo_t * photo_p
int photo_set_config(photo_p photo, const char *param, const char *value)
int photo_capture(photo_p photo, photo_image_p image)
int photo_close(photo_p photo)
int photo_open(photo_p photo, const char *model, const char *port)
int photo_autodetect(photo_p photo)


photo
Author(s): Benjamin Pitzer
autogenerated on Mon Feb 28 2022 23:12:30