|
1 /* GStreamer |
|
2 * |
|
3 * Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org> |
|
4 * |
|
5 * photography.h: photography interface for digital imaging |
|
6 * |
|
7 * |
|
8 * This library is free software; you can redistribute it and/or |
|
9 * modify it under the terms of the GNU Library General Public |
|
10 * License as published by the Free Software Foundation; either |
|
11 * version 2 of the License, or (at your option) any later version. |
|
12 * |
|
13 * This library is distributed in the hope that it will be useful, |
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 * Library General Public License for more details. |
|
17 * |
|
18 * You should have received a copy of the GNU Library General Public |
|
19 * License along with this library; if not, write to the |
|
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
21 * Boston, MA 02111-1307, USA. |
|
22 */ |
|
23 |
|
24 #ifndef __GST_PHOTOGRAPHY_H__ |
|
25 #define __GST_PHOTOGRAPHY_H__ |
|
26 |
|
27 #include <gst/gst.h> |
|
28 #include "photography-enumtypes.h" |
|
29 |
|
30 G_BEGIN_DECLS |
|
31 |
|
32 #define GST_TYPE_PHOTOGRAPHY \ |
|
33 (gst_photography_get_type ()) |
|
34 #define GST_PHOTOGRAPHY(obj) \ |
|
35 (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PHOTOGRAPHY, GstPhotography)) |
|
36 #define GST_IS_PHOTOGRAPHY(obj) \ |
|
37 (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PHOTOGRAPHY)) |
|
38 #define GST_PHOTOGRAPHY_GET_IFACE(inst) \ |
|
39 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_PHOTOGRAPHY, GstPhotographyInterface)) |
|
40 |
|
41 |
|
42 /* Custom GstMessage name that will be sent to GstBus when autofocusing |
|
43 is complete */ |
|
44 #define GST_PHOTOGRAPHY_AUTOFOCUS_DONE "autofocus-done" |
|
45 |
|
46 /* Custom GstMessage name that will be sent to GstBus when shake risk changes */ |
|
47 #define GST_PHOTOGRAPHY_SHAKE_RISK "shake-risk" |
|
48 |
|
49 /** |
|
50 * GstPhotography: |
|
51 * |
|
52 * Opaque #GstPhotography data structure. |
|
53 */ |
|
54 typedef struct _GstPhotography GstPhotography; |
|
55 |
|
56 typedef enum |
|
57 { |
|
58 GST_PHOTOGRAPHY_WB_MODE_AUTO = 0, |
|
59 GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT, |
|
60 GST_PHOTOGRAPHY_WB_MODE_CLOUDY, |
|
61 GST_PHOTOGRAPHY_WB_MODE_SUNSET, |
|
62 GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN, |
|
63 GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT |
|
64 } GstWhiteBalanceMode; |
|
65 |
|
66 typedef enum |
|
67 { |
|
68 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NORMAL = 0, |
|
69 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SEPIA, |
|
70 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NEGATIVE, |
|
71 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_GRAYSCALE, |
|
72 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_NATURAL, |
|
73 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_VIVID, |
|
74 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_COLORSWAP, |
|
75 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_SOLARIZE, |
|
76 GST_PHOTOGRAPHY_COLOUR_TONE_MODE_OUT_OF_FOCUS |
|
77 } GstColourToneMode; |
|
78 |
|
79 typedef enum |
|
80 { |
|
81 GST_PHOTOGRAPHY_SCENE_MODE_MANUAL = 0, |
|
82 GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP, |
|
83 GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT, |
|
84 GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE, |
|
85 GST_PHOTOGRAPHY_SCENE_MODE_SPORT, |
|
86 GST_PHOTOGRAPHY_SCENE_MODE_NIGHT, |
|
87 GST_PHOTOGRAPHY_SCENE_MODE_AUTO |
|
88 } GstSceneMode; |
|
89 |
|
90 typedef enum |
|
91 { |
|
92 GST_PHOTOGRAPHY_FLASH_MODE_AUTO = 0, |
|
93 GST_PHOTOGRAPHY_FLASH_MODE_OFF, |
|
94 GST_PHOTOGRAPHY_FLASH_MODE_ON, |
|
95 GST_PHOTOGRAPHY_FLASH_MODE_FILL_IN, |
|
96 GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE |
|
97 } GstFlashMode; |
|
98 |
|
99 typedef enum |
|
100 { |
|
101 GST_PHOTOGRAPHY_FOCUS_STATUS_NONE = 0, |
|
102 GST_PHOTOGRAPHY_FOCUS_STATUS_RUNNING, |
|
103 GST_PHOTOGRAPHY_FOCUS_STATUS_FAIL, |
|
104 GST_PHOTOGRAPHY_FOCUS_STATUS_SUCCESS |
|
105 } GstFocusStatus; |
|
106 |
|
107 typedef enum |
|
108 { |
|
109 GST_PHOTOGRAPHY_CAPS_NONE = (0 << 0), |
|
110 GST_PHOTOGRAPHY_CAPS_EV_COMP = (1 << 0), |
|
111 GST_PHOTOGRAPHY_CAPS_ISO_SPEED = (1 << 1), |
|
112 GST_PHOTOGRAPHY_CAPS_WB_MODE = (1 << 2), |
|
113 GST_PHOTOGRAPHY_CAPS_TONE = (1 << 3), |
|
114 GST_PHOTOGRAPHY_CAPS_SCENE = (1 << 4), |
|
115 GST_PHOTOGRAPHY_CAPS_FLASH = (1 << 5), |
|
116 GST_PHOTOGRAPHY_CAPS_ZOOM = (1 << 6), |
|
117 GST_PHOTOGRAPHY_CAPS_FOCUS = (1 << 7), |
|
118 GST_PHOTOGRAPHY_CAPS_APERTURE = (1 << 8), |
|
119 GST_PHOTOGRAPHY_CAPS_EXPOSURE = (1 << 9), |
|
120 GST_PHOTOGRAPHY_CAPS_SHAKE = (1 << 10) |
|
121 } GstPhotoCaps; |
|
122 |
|
123 typedef enum |
|
124 { |
|
125 GST_PHOTOGRAPHY_SHAKE_RISK_LOW = 0, |
|
126 GST_PHOTOGRAPHY_SHAKE_RISK_MEDIUM, |
|
127 GST_PHOTOGRAPHY_SHAKE_RISK_HIGH, |
|
128 } GstPhotoShakeRisk; |
|
129 |
|
130 typedef struct |
|
131 { |
|
132 GstWhiteBalanceMode wb_mode; |
|
133 GstColourToneMode tone_mode; |
|
134 GstSceneMode scene_mode; |
|
135 GstFlashMode flash_mode; |
|
136 guint32 exposure; |
|
137 guint aperture; |
|
138 gfloat ev_compensation; |
|
139 guint iso_speed; |
|
140 gfloat zoom; |
|
141 } GstPhotoSettings; |
|
142 |
|
143 /** |
|
144 * GstPhotoCapturePrepared: |
|
145 * @data: user data that has been given, when registering the callback |
|
146 * |
|
147 * This callback will be called when the element has finished preparations |
|
148 * for photo capture. |
|
149 */ |
|
150 typedef void (*GstPhotoCapturePrepared) (gpointer data); |
|
151 |
|
152 /** |
|
153 * GstPhotographyInterface: |
|
154 * @parent: parent interface type. |
|
155 * @get_ev_compensation: vmethod to get ev exposure compensation value |
|
156 * @get_iso_speed: vmethod to get iso speed (light sensitivity) value |
|
157 * @get_aperture: vmethod to get aperture value |
|
158 * @get_exposure: vmethod to get exposure time value |
|
159 * @get_white_balance_mode: vmethod to get white balance mode value |
|
160 * @get_colour_tone_mode: vmethod to get colour tone mode value |
|
161 * @get_scene_mode: vmethod to get scene mode value |
|
162 * @get_flash_mode: vmethod to get flash mode value |
|
163 * @get_zoom: vmethod to get zoom factor value |
|
164 * @set_ev_compensation: vmethod to set ev exposure compensation value |
|
165 * @set_iso_speed: vmethod to set iso speed (light sensitivity) value |
|
166 * @set_aperture: vmethod to set aperture value |
|
167 * @set_exposure: vmethod to set exposure time value |
|
168 * @set_white_balance_mode: vmethod to set white balance mode value |
|
169 * @set_colour_tone_mode: vmethod to set colour tone mode value |
|
170 * @set_scene_mode: vmethod to set scene mode value |
|
171 * @set_flash_mode: vmethod to set flash mode value |
|
172 * @set_zoom: vmethod to set zoom factor value |
|
173 * @get_capabilities: vmethod to get supported capabilities of the interface |
|
174 * @prepare_for_capture: vmethod to tell the element to prepare for capturing |
|
175 * @set_autofocus: vmethod to set autofocus on/off |
|
176 * |
|
177 * #GstPhotographyInterface interface. |
|
178 */ |
|
179 typedef struct _GstPhotographyInterface |
|
180 { |
|
181 GTypeInterface parent; |
|
182 |
|
183 /* virtual functions */ |
|
184 gboolean (*get_ev_compensation) (GstPhotography * photo, gfloat * ev_comp); |
|
185 gboolean (*get_iso_speed) (GstPhotography * photo, guint * iso_speed); |
|
186 gboolean (*get_aperture) (GstPhotography * photo, guint * aperture); |
|
187 gboolean (*get_exposure) (GstPhotography * photo, guint32 * exposure); |
|
188 gboolean (*get_white_balance_mode) (GstPhotography * photo, |
|
189 GstWhiteBalanceMode * wb_mode); |
|
190 gboolean (*get_colour_tone_mode) (GstPhotography * photo, |
|
191 GstColourToneMode * tone_mode); |
|
192 gboolean (*get_scene_mode) (GstPhotography * photo, |
|
193 GstSceneMode * scene_mode); |
|
194 gboolean (*get_flash_mode) (GstPhotography * photo, |
|
195 GstFlashMode * flash_mode); |
|
196 gboolean (*get_zoom) (GstPhotography * photo, gfloat * zoom); |
|
197 |
|
198 gboolean (*set_ev_compensation) (GstPhotography * photo, gfloat ev_comp); |
|
199 gboolean (*set_iso_speed) (GstPhotography * photo, guint iso_speed); |
|
200 gboolean (*set_aperture) (GstPhotography * photo, guint aperture); |
|
201 gboolean (*set_exposure) (GstPhotography * photo, guint32 exposure); |
|
202 gboolean (*set_white_balance_mode) (GstPhotography * photo, |
|
203 GstWhiteBalanceMode wb_mode); |
|
204 gboolean (*set_colour_tone_mode) (GstPhotography * photo, |
|
205 GstColourToneMode tone_mode); |
|
206 gboolean (*set_scene_mode) (GstPhotography * photo, |
|
207 GstSceneMode scene_mode); |
|
208 gboolean (*set_flash_mode) (GstPhotography * photo, |
|
209 GstFlashMode flash_mode); |
|
210 gboolean (*set_zoom) (GstPhotography * photo, gfloat zoom); |
|
211 |
|
212 GstPhotoCaps (*get_capabilities) (GstPhotography * photo); |
|
213 void (*prepare_for_capture) (GstPhotography * photo, |
|
214 GstPhotoCapturePrepared func, gpointer user_data); |
|
215 void (*set_autofocus) (GstPhotography * photo, gboolean on); |
|
216 |
|
217 /*< private > */ |
|
218 gpointer _gst_reserved[GST_PADDING]; |
|
219 } GstPhotographyInterface; |
|
220 |
|
221 IMPORT_C GType gst_photography_get_type (void); |
|
222 |
|
223 /* virtual class function wrappers */ |
|
224 IMPORT_C gboolean gst_photography_get_ev_compensation (GstPhotography * photo, |
|
225 gfloat * ev_comp); |
|
226 IMPORT_C gboolean gst_photography_get_iso_speed (GstPhotography * photo, |
|
227 guint * iso_speed); |
|
228 IMPORT_C gboolean gst_photography_get_aperture (GstPhotography * photo, |
|
229 guint * aperture); |
|
230 IMPORT_C gboolean gst_photography_get_exposure (GstPhotography * photo, |
|
231 guint32 * exposure); |
|
232 IMPORT_C gboolean gst_photography_get_white_balance_mode (GstPhotography * photo, |
|
233 GstWhiteBalanceMode * wb_mode); |
|
234 IMPORT_C gboolean gst_photography_get_colour_tone_mode (GstPhotography * photo, |
|
235 GstColourToneMode * tone_mode); |
|
236 IMPORT_C gboolean gst_photography_get_scene_mode (GstPhotography * photo, |
|
237 GstSceneMode * scene_mode); |
|
238 IMPORT_C gboolean gst_photography_get_flash_mode (GstPhotography * photo, |
|
239 GstFlashMode * flash_mode); |
|
240 IMPORT_C gboolean gst_photography_get_zoom (GstPhotography * photo, gfloat * zoom); |
|
241 |
|
242 IMPORT_C gboolean gst_photography_set_ev_compensation (GstPhotography * photo, |
|
243 gfloat ev_comp); |
|
244 IMPORT_C gboolean gst_photography_set_iso_speed (GstPhotography * photo, |
|
245 guint iso_speed); |
|
246 IMPORT_C gboolean gst_photography_set_aperture (GstPhotography * photo, guint aperture); |
|
247 IMPORT_C gboolean gst_photography_set_exposure (GstPhotography * photo, guint exposure); |
|
248 IMPORT_C gboolean gst_photography_set_white_balance_mode (GstPhotography * photo, |
|
249 GstWhiteBalanceMode wb_mode); |
|
250 IMPORT_C gboolean gst_photography_set_colour_tone_mode (GstPhotography * photo, |
|
251 GstColourToneMode tone_mode); |
|
252 IMPORT_C gboolean gst_photography_set_scene_mode (GstPhotography * photo, |
|
253 GstSceneMode scene_mode); |
|
254 IMPORT_C gboolean gst_photography_set_flash_mode (GstPhotography * photo, |
|
255 GstFlashMode flash_mode); |
|
256 IMPORT_C gboolean gst_photography_set_zoom (GstPhotography * photo, gfloat zoom); |
|
257 |
|
258 IMPORT_C GstPhotoCaps gst_photography_get_capabilities (GstPhotography * photo); |
|
259 |
|
260 IMPORT_C void gst_photography_prepare_for_capture (GstPhotography * photo, |
|
261 GstPhotoCapturePrepared func, gpointer user_data); |
|
262 |
|
263 IMPORT_C void gst_photography_set_autofocus (GstPhotography * photo, gboolean on); |
|
264 |
|
265 G_END_DECLS |
|
266 |
|
267 #endif /* __GST_PHOTOGRAPHY_H__ */ |