RaspiCamControl.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2013, Broadcom Europe Ltd
3 Copyright (c) 2013, James Hughes
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8  * Redistributions of source code must retain the above copyright
9  notice, this list of conditions and the following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright
11  notice, this list of conditions and the following disclaimer in the
12  documentation and/or other materials provided with the distribution.
13  * Neither the name of the copyright holder nor the
14  names of its contributors may be used to endorse or promote products
15  derived from this software without specific prior written permission.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef RASPICAMCONTROL_H_
30 #define RASPICAMCONTROL_H_
31 
32 #include "interface/mmal/mmal.h"
33 #include "interface/mmal/mmal_logging.h"
34 #include "interface/mmal/util/mmal_default_components.h"
35 #include "interface/mmal/util/mmal_util.h"
36 #include "interface/mmal/util/mmal_util_params.h"
37 #include "interface/vmcs_host/vc_vchi_gencmd.h"
38 
39 /* Various parameters
40  *
41  * Exposure Mode
42  * MMAL_PARAM_EXPOSUREMODE_OFF,
43  MMAL_PARAM_EXPOSUREMODE_AUTO,
44  MMAL_PARAM_EXPOSUREMODE_NIGHT,
45  MMAL_PARAM_EXPOSUREMODE_NIGHTPREVIEW,
46  MMAL_PARAM_EXPOSUREMODE_BACKLIGHT,
47  MMAL_PARAM_EXPOSUREMODE_SPOTLIGHT,
48  MMAL_PARAM_EXPOSUREMODE_SPORTS,
49  MMAL_PARAM_EXPOSUREMODE_SNOW,
50  MMAL_PARAM_EXPOSUREMODE_BEACH,
51  MMAL_PARAM_EXPOSUREMODE_VERYLONG,
52  MMAL_PARAM_EXPOSUREMODE_FIXEDFPS,
53  MMAL_PARAM_EXPOSUREMODE_ANTISHAKE,
54  MMAL_PARAM_EXPOSUREMODE_FIREWORKS,
55  *
56  * AWB Mode
57  * MMAL_PARAM_AWBMODE_OFF,
58  MMAL_PARAM_AWBMODE_AUTO,
59  MMAL_PARAM_AWBMODE_SUNLIGHT,
60  MMAL_PARAM_AWBMODE_CLOUDY,
61  MMAL_PARAM_AWBMODE_SHADE,
62  MMAL_PARAM_AWBMODE_TUNGSTEN,
63  MMAL_PARAM_AWBMODE_FLUORESCENT,
64  MMAL_PARAM_AWBMODE_INCANDESCENT,
65  MMAL_PARAM_AWBMODE_FLASH,
66  MMAL_PARAM_AWBMODE_HORIZON,
67  *
68  * Image FX
69  MMAL_PARAM_IMAGEFX_NONE,
70  MMAL_PARAM_IMAGEFX_NEGATIVE,
71  MMAL_PARAM_IMAGEFX_SOLARIZE,
72  MMAL_PARAM_IMAGEFX_POSTERIZE,
73  MMAL_PARAM_IMAGEFX_WHITEBOARD,
74  MMAL_PARAM_IMAGEFX_BLACKBOARD,
75  MMAL_PARAM_IMAGEFX_SKETCH,
76  MMAL_PARAM_IMAGEFX_DENOISE,
77  MMAL_PARAM_IMAGEFX_EMBOSS,
78  MMAL_PARAM_IMAGEFX_OILPAINT,
79  MMAL_PARAM_IMAGEFX_HATCH,
80  MMAL_PARAM_IMAGEFX_GPEN,
81  MMAL_PARAM_IMAGEFX_PASTEL,
82  MMAL_PARAM_IMAGEFX_WATERCOLOUR,
83  MMAL_PARAM_IMAGEFX_FILM,
84  MMAL_PARAM_IMAGEFX_BLUR,
85  MMAL_PARAM_IMAGEFX_SATURATION,
86  MMAL_PARAM_IMAGEFX_COLOURSWAP,
87  MMAL_PARAM_IMAGEFX_WASHEDOUT,
88  MMAL_PARAM_IMAGEFX_POSTERISE,
89  MMAL_PARAM_IMAGEFX_COLOURPOINT,
90  MMAL_PARAM_IMAGEFX_COLOURBALANCE,
91  MMAL_PARAM_IMAGEFX_CARTOON,
92 
93  */
94 
95 // There isn't actually a MMAL structure for the following, so make one
96 typedef struct {
97  int enable;
98  int u, v;
100 
101 typedef struct {
102  int enable;
103  int width, height;
104  int quality;
106 
107 typedef struct {
108  double x;
109  double y;
110  double w;
111  double h;
113 
115 typedef struct {
116  int sharpness;
117  int contrast;
120  int ISO;
123  MMAL_PARAM_EXPOSUREMODE_T exposureMode;
124  MMAL_PARAM_EXPOSUREMETERINGMODE_T exposureMeterMode;
125  MMAL_PARAM_AWBMODE_T awbMode;
126  MMAL_PARAM_IMAGEFX_T imageEffect;
127  MMAL_PARAMETER_IMAGEFX_PARAMETERS_T imageEffectsParameters;
129  int rotation;
130  int hflip;
131  int vflip;
133  int shutter_speed;
136 
137 MMAL_PARAM_EXPOSUREMODE_T exposure_mode_from_string(const char* str);
138 MMAL_PARAM_AWBMODE_T awb_mode_from_string(const char* str);
139 
140 void raspicamcontrol_check_configuration(int min_gpu_mem);
141 
142 int raspicamcontrol_cycle_test(MMAL_COMPONENT_T& camera);
143 
144 int raspicamcontrol_set_all_parameters(MMAL_COMPONENT_T& camera, const RASPICAM_CAMERA_PARAMETERS& params);
146 
148 
149 void raspicamcontrol_check_configuration(int min_gpu_mem);
150 
151 // Individual setting functions
152 int raspicamcontrol_set_saturation(MMAL_COMPONENT_T& camera, int saturation);
153 int raspicamcontrol_set_sharpness(MMAL_COMPONENT_T& camera, int sharpness);
154 int raspicamcontrol_set_contrast(MMAL_COMPONENT_T& camera, int contrast);
155 int raspicamcontrol_set_brightness(MMAL_COMPONENT_T& camera, int brightness);
156 int raspicamcontrol_set_ISO(MMAL_COMPONENT_T& camera, int ISO);
157 int raspicamcontrol_set_metering_mode(MMAL_COMPONENT_T& camera, MMAL_PARAM_EXPOSUREMETERINGMODE_T mode);
158 int raspicamcontrol_set_video_stabilisation(MMAL_COMPONENT_T& camera, int vstabilisation);
159 int raspicamcontrol_set_exposure_compensation(MMAL_COMPONENT_T& camera, int exp_comp);
160 int raspicamcontrol_set_exposure_mode(MMAL_COMPONENT_T& camera, MMAL_PARAM_EXPOSUREMODE_T mode);
161 int raspicamcontrol_set_awb_mode(MMAL_COMPONENT_T& camera, MMAL_PARAM_AWBMODE_T awb_mode);
162 int raspicamcontrol_set_imageFX(MMAL_COMPONENT_T& camera, MMAL_PARAM_IMAGEFX_T imageFX);
163 int raspicamcontrol_set_colourFX(MMAL_COMPONENT_T& camera, const MMAL_PARAM_COLOURFX_T* colourFX);
164 int raspicamcontrol_set_rotation(MMAL_COMPONENT_T& camera, int rotation);
165 int raspicamcontrol_set_flips(MMAL_COMPONENT_T& camera, int hflip, int vflip);
166 int raspicamcontrol_set_ROI(MMAL_COMPONENT_T& camera, PARAM_FLOAT_RECT_T rect);
167 int raspicamcontrol_set_shutter_speed(MMAL_COMPONENT_T& camera, int shutter_speed);
168 
169 // Individual getting functions
170 int raspicamcontrol_get_saturation(MMAL_COMPONENT_T& camera);
171 int raspicamcontrol_get_sharpness(MMAL_COMPONENT_T& camera);
172 int raspicamcontrol_get_contrast(MMAL_COMPONENT_T& camera);
173 int raspicamcontrol_get_brightness(MMAL_COMPONENT_T& camera);
174 int raspicamcontrol_get_ISO(MMAL_COMPONENT_T& camera);
175 MMAL_PARAM_EXPOSUREMETERINGMODE_T raspicamcontrol_get_metering_mode(MMAL_COMPONENT_T& camera);
176 int raspicamcontrol_get_video_stabilisation(MMAL_COMPONENT_T& camera);
177 int raspicamcontrol_get_exposure_compensation(MMAL_COMPONENT_T& camera);
179 MMAL_PARAM_EXPOSUREMODE_T raspicamcontrol_get_exposure_mode(MMAL_COMPONENT_T& camera);
180 MMAL_PARAM_AWBMODE_T raspicamcontrol_get_awb_mode(MMAL_COMPONENT_T& camera);
181 MMAL_PARAM_IMAGEFX_T raspicamcontrol_get_imageFX(MMAL_COMPONENT_T& camera);
182 MMAL_PARAM_COLOURFX_T raspicamcontrol_get_colourFX(MMAL_COMPONENT_T& camera);
183 
184 #endif /* RASPICAMCONTROL_H_ */
MMAL_PARAM_AWBMODE_T awbMode
MMAL_PARAM_COLOURFX_T colourEffects
int raspicamcontrol_set_sharpness(MMAL_COMPONENT_T &camera, int sharpness)
int exposureCompensation
0 or 1 (false or true)
int raspicamcontrol_set_exposure_compensation(MMAL_COMPONENT_T &camera, int exp_comp)
int raspicamcontrol_set_shutter_speed(MMAL_COMPONENT_T &camera, int shutter_speed)
PARAM_FLOAT_RECT_T roi
0 or 1
MMAL_PARAM_IMAGEFX_T imageEffect
int raspicamcontrol_set_brightness(MMAL_COMPONENT_T &camera, int brightness)
int raspicamcontrol_get_contrast(MMAL_COMPONENT_T &camera)
MMAL_PARAM_EXPOSUREMETERINGMODE_T exposureMeterMode
MMAL_PARAM_THUMBNAIL_CONFIG_T raspicamcontrol_get_thumbnail_parameters(MMAL_COMPONENT_T &camera)
int raspicamcontrol_set_video_stabilisation(MMAL_COMPONENT_T &camera, int vstabilisation)
void raspicamcontrol_dump_parameters(const RASPICAM_CAMERA_PARAMETERS &params)
void raspicamcontrol_check_configuration(int min_gpu_mem)
int raspicamcontrol_get_ISO(MMAL_COMPONENT_T &camera)
MMAL_PARAM_AWBMODE_T raspicamcontrol_get_awb_mode(MMAL_COMPONENT_T &camera)
MMAL_PARAM_COLOURFX_T raspicamcontrol_get_colourFX(MMAL_COMPONENT_T &camera)
MMAL_PARAM_EXPOSUREMETERINGMODE_T raspicamcontrol_get_metering_mode(MMAL_COMPONENT_T &camera)
MMAL_PARAM_EXPOSUREMODE_T exposure_mode_from_string(const char *str)
int raspicamcontrol_get_brightness(MMAL_COMPONENT_T &camera)
MMAL_PARAM_EXPOSUREMODE_T raspicamcontrol_get_exposure_mode(MMAL_COMPONENT_T &camera)
int raspicamcontrol_set_exposure_mode(MMAL_COMPONENT_T &camera, MMAL_PARAM_EXPOSUREMODE_T mode)
void raspicamcontrol_set_defaults(RASPICAM_CAMERA_PARAMETERS &params)
int raspicamcontrol_set_ROI(MMAL_COMPONENT_T &camera, PARAM_FLOAT_RECT_T rect)
int raspicamcontrol_set_flips(MMAL_COMPONENT_T &camera, int hflip, int vflip)
int raspicamcontrol_get_video_stabilisation(MMAL_COMPONENT_T &camera)
int raspicamcontrol_set_awb_mode(MMAL_COMPONENT_T &camera, MMAL_PARAM_AWBMODE_T awb_mode)
MMAL_PARAM_EXPOSUREMODE_T exposureMode
-10 to +10 ?
int raspicamcontrol_set_ISO(MMAL_COMPONENT_T &camera, int ISO)
int raspicamcontrol_get_exposure_compensation(MMAL_COMPONENT_T &camera)
struct contain camera settings
int videoStabilisation
TODO : what range?
MMAL_PARAM_AWBMODE_T awb_mode_from_string(const char *str)
int raspicamcontrol_set_all_parameters(MMAL_COMPONENT_T &camera, const RASPICAM_CAMERA_PARAMETERS &params)
int raspicamcontrol_set_rotation(MMAL_COMPONENT_T &camera, int rotation)
int raspicamcontrol_set_imageFX(MMAL_COMPONENT_T &camera, MMAL_PARAM_IMAGEFX_T imageFX)
int raspicamcontrol_set_metering_mode(MMAL_COMPONENT_T &camera, MMAL_PARAM_EXPOSUREMETERINGMODE_T mode)
int raspicamcontrol_get_saturation(MMAL_COMPONENT_T &camera)
int raspicamcontrol_cycle_test(MMAL_COMPONENT_T &camera)
int raspicamcontrol_set_colourFX(MMAL_COMPONENT_T &camera, const MMAL_PARAM_COLOURFX_T *colourFX)
int raspicamcontrol_set_contrast(MMAL_COMPONENT_T &camera, int contrast)
MMAL_PARAMETER_IMAGEFX_PARAMETERS_T imageEffectsParameters
MMAL_PARAM_IMAGEFX_T raspicamcontrol_get_imageFX(MMAL_COMPONENT_T &camera)
int raspicamcontrol_get_sharpness(MMAL_COMPONENT_T &camera)
int raspicamcontrol_set_saturation(MMAL_COMPONENT_T &camera, int saturation)


raspicam_node
Author(s):
autogenerated on Sun Jul 5 2020 03:45:18