1 /* GStreamer
2  *
3  * Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org>
4  *
5  * photography.h: photography interface for digital imaging
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef __GST_PHOTOGRAPHY_H__
24 #define __GST_PHOTOGRAPHY_H__
25 
26 #ifndef GST_USE_UNSTABLE_API
27 #warning "The GstPhotography interface is unstable API and may change in future."
28 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
29 #endif
30 
31 #include <gst/gst.h>
32 #include <gst/interfaces/photography-prelude.h>
33 #include <gst/interfaces/photography-enumtypes.h>
34 
35 G_BEGIN_DECLS
36 
37 #define GST_TYPE_PHOTOGRAPHY \
38   (gst_photography_get_type ())
39 #define GST_PHOTOGRAPHY(obj) \
40   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PHOTOGRAPHY, GstPhotography))
41 #define GST_IS_PHOTOGRAPHY(obj) \
42   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PHOTOGRAPHY))
43 #define GST_PHOTOGRAPHY_GET_INTERFACE(inst) \
44   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_PHOTOGRAPHY, GstPhotographyInterface))
45 
46 
47 /**
48  * GST_PHOTOGRAPHY_AUTOFOCUS_DONE:
49  *
50  * Name of custom GstMessage that will be posted to #GstBus when autofocusing
51  * is complete.
52  * This message contains following fields:
53  * <itemizedlist>
54  * <listitem>
55  *   <para>
56  *   #GstPhotographyFocusStatus
57  *   <classname>&quot;status&quot;</classname>:
58  *   Tells if focusing succeeded or failed.
59  *   </para>
60  * </listitem>
61  * <listitem>
62  *   <para>
63  *   #G_TYPE_INT
64  *   <classname>&quot;focus-window-rows&quot;</classname>:
65  *   Tells number of focus matrix rows.
66  *   </para>
67  * </listitem>
68  * <listitem>
69  *   <para>
70  *   #G_TYPE_INT
71  *   <classname>&quot;focus-window-columns&quot;</classname>:
72  *   Tells number of focus matrix columns.
73  *   </para>
74  * </listitem>
75  * <listitem>
76  *   <para>
77  *   #G_TYPE_INT
78  *   <classname>&quot;focus-window-mask&quot;</classname>:
79  *   Bitmask containing rows x columns bits which mark the focus points in the
80  *   focus matrix. Lowest bit (LSB) always represents the top-left corner of the
81  *   focus matrix. This field is only valid when focusing status is SUCCESS.
82  *   </para>
83  * </listitem>
84  * </itemizedlist>
85  */
86 #define GST_PHOTOGRAPHY_AUTOFOCUS_DONE "autofocus-done"
87 
88 /**
89  * GST_PHOTOGRAPHY_SHAKE_RISK:
90  *
91  * Name of custom GstMessage that is posted to #GstBus during autofocusing
92  * process. It is posted if there is change in the risk of captured image
93  * becoming "shaken" due to camera movement and too long exposure time.
94  *
95  * This message contains following fields:
96  * <itemizedlist>
97  * <listitem>
98  *   <para>
99  *   #GstPhotographyShakeRisk
100  *   <classname>&quot;status&quot;</classname>:
101  *   Tells risk level of capturing shaken image.
102  *   </para>
103  * </listitem>
104  * </itemizedlist>
105  */
106 #define GST_PHOTOGRAPHY_SHAKE_RISK "shake-risk"
107 
108 /* Maximum white point values used in #GstPhotographySettings */
109 #define MAX_WHITE_POINT_VALUES 4
110 
111 /* Interface property names */
112 #define GST_PHOTOGRAPHY_PROP_WB_MODE            "white-balance-mode"
113 #define GST_PHOTOGRAPHY_PROP_COLOR_TONE         "color-tone-mode"
114 #define GST_PHOTOGRAPHY_PROP_SCENE_MODE         "scene-mode"
115 #define GST_PHOTOGRAPHY_PROP_FLASH_MODE         "flash-mode"
116 #define GST_PHOTOGRAPHY_PROP_NOISE_REDUCTION    "noise-reduction"
117 #define GST_PHOTOGRAPHY_PROP_FOCUS_STATUS       "focus-status"
118 #define GST_PHOTOGRAPHY_PROP_CAPABILITIES       "capabilities"
119 #define GST_PHOTOGRAPHY_PROP_SHAKE_RISK         "shake-risk"
120 #define GST_PHOTOGRAPHY_PROP_EV_COMP            "ev-compensation"
121 #define GST_PHOTOGRAPHY_PROP_ISO_SPEED          "iso-speed"
122 #define GST_PHOTOGRAPHY_PROP_APERTURE           "aperture"
123 #define GST_PHOTOGRAPHY_PROP_EXPOSURE_TIME      "exposure-time"
124 #define GST_PHOTOGRAPHY_PROP_IMAGE_CAPTURE_SUPPORTED_CAPS \
125                                                 "image-capture-supported-caps"
126 #define GST_PHOTOGRAPHY_PROP_IMAGE_PREVIEW_SUPPORTED_CAPS \
127                                                 "image-preview-supported-caps"
128 #define GST_PHOTOGRAPHY_PROP_FLICKER_MODE       "flicker-mode"
129 #define GST_PHOTOGRAPHY_PROP_FOCUS_MODE         "focus-mode"
130 #define GST_PHOTOGRAPHY_PROP_ZOOM               "zoom"
131 #define GST_PHOTOGRAPHY_PROP_COLOR_TEMPERATURE  "color-temperature"
132 #define GST_PHOTOGRAPHY_PROP_WHITE_POINT        "white-point"
133 #define GST_PHOTOGRAPHY_PROP_ANALOG_GAIN        "analog-gain"
134 #define GST_PHOTOGRAPHY_PROP_EXPOSURE_MODE      "exposure-mode"
135 #define GST_PHOTOGRAPHY_PROP_LENS_FOCUS         "lens-focus"
136 #define GST_PHOTOGRAPHY_PROP_MIN_EXPOSURE_TIME  "min-exposure-time"
137 #define GST_PHOTOGRAPHY_PROP_MAX_EXPOSURE_TIME  "max-exposure-time"
138 
139 /**
140  * GstPhotography:
141  *
142  * Opaque #GstPhotography data structure.
143  */
144 typedef struct _GstPhotography GstPhotography;
145 
146 /**
147  * GstPhotographyNoiseReduction:
148  * @GST_PHOTOGRAPHY_NOISE_REDUCTION_BAYER: Adaptive noise reduction on Bayer
149  * format
150  * @GST_PHOTOGRAPHY_NOISE_REDUCTION_YCC: reduces the noise on Y and 2-chroma
151  * images.
152  * @GST_PHOTOGRAPHY_NOISE_REDUCTION_TEMPORAL: Multi-frame adaptive NR,
153  * provided for the video mode
154  * @GST_PHOTOGRAPHY_NOISE_REDUCTION_FIXED: Fixed Pattern Noise refers to noise
155  * that does not change between frames. The noise is removed from the sensor
156  * image, by subtracting a previously-captured black image in memory.
157  * @GST_PHOTOGRAPHY_NOISE_REDUCTION_EXTRA: Extra Noise Reduction. In the case
158  * of high-ISO capturing, some noise remains after YCC NR. XNR reduces this
159  * remaining noise.
160  *
161  * Noise Reduction features of a photography capture or filter element.
162  */
163 typedef enum
164 {
165   GST_PHOTOGRAPHY_NOISE_REDUCTION_BAYER    = (1 << 0),
166   GST_PHOTOGRAPHY_NOISE_REDUCTION_YCC      = (1 << 1),
167   GST_PHOTOGRAPHY_NOISE_REDUCTION_TEMPORAL = (1 << 2),
168   GST_PHOTOGRAPHY_NOISE_REDUCTION_FIXED    = (1 << 3),
169   GST_PHOTOGRAPHY_NOISE_REDUCTION_EXTRA    = (1 << 4)
170 } GstPhotographyNoiseReduction;
171 
172 /**
173  * GstPhotographyWhiteBalanceMode:
174  * @GST_PHOTOGRAPHY_WB_MODE_AUTO: Choose white balance mode automatically
175  * @GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT: Mode for daylight conditions
176  * @GST_PHOTOGRAPHY_WB_MODE_CLOUDY: Mode for cloudy conditions
177  * @GST_PHOTOGRAPHY_WB_MODE_SUNSET: Mode for sunset conditions
178  * @GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN: Mode for tungsten lighting
179  * @GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT: Mode for fluorescent lighting
180  * @GST_PHOTOGRAPHY_WB_MODE_MANUAL: Disable automatic white balance adjustment
181  * and keep current values.
182  * @GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT: Mode for warm fluorescent lighting (Since: 1.2)
183  * @GST_PHOTOGRAPHY_WB_MODE_SHADE: Mode for shade lighting (Since: 1.2)
184  *
185  * Modes for white balance control.
186  */
187 typedef enum
188 {
189   GST_PHOTOGRAPHY_WB_MODE_AUTO = 0,
190   GST_PHOTOGRAPHY_WB_MODE_DAYLIGHT,
191   GST_PHOTOGRAPHY_WB_MODE_CLOUDY,
192   GST_PHOTOGRAPHY_WB_MODE_SUNSET,
193   GST_PHOTOGRAPHY_WB_MODE_TUNGSTEN,
194   GST_PHOTOGRAPHY_WB_MODE_FLUORESCENT,
195   GST_PHOTOGRAPHY_WB_MODE_MANUAL,
196   GST_PHOTOGRAPHY_WB_MODE_WARM_FLUORESCENT,
197   GST_PHOTOGRAPHY_WB_MODE_SHADE
198 } GstPhotographyWhiteBalanceMode;
199 
200 /**
201  * GstPhotographyColorToneMode:
202  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL: No effects
203  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_SEPIA: Sepia
204  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEGATIVE: Negative
205  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRAYSCALE: Grayscale
206  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_NATURAL: Natural
207  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_VIVID: Vivid
208  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_COLORSWAP: Colorswap
209  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_SOLARIZE: Solarize
210  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_OUT_OF_FOCUS: Out of focus
211  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKY_BLUE: Sky blue
212  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRASS_GREEN: Grass green
213  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKIN_WHITEN: Skin whiten
214  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_POSTERIZE: Posterize (Since: 1.2)
215  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_WHITEBOARD: Whiteboard (Since: 1.2)
216  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_BLACKBOARD: Blackboard (Since: 1.2)
217  * @GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA: Aqua (Since: 1.2)
218  *
219  * Modes for special color effects.
220  */
221 typedef enum
222 {
223   GST_PHOTOGRAPHY_COLOR_TONE_MODE_NORMAL = 0,
224   GST_PHOTOGRAPHY_COLOR_TONE_MODE_SEPIA,
225   GST_PHOTOGRAPHY_COLOR_TONE_MODE_NEGATIVE,
226   GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRAYSCALE,
227   GST_PHOTOGRAPHY_COLOR_TONE_MODE_NATURAL,
228   GST_PHOTOGRAPHY_COLOR_TONE_MODE_VIVID,
229   GST_PHOTOGRAPHY_COLOR_TONE_MODE_COLORSWAP,
230   GST_PHOTOGRAPHY_COLOR_TONE_MODE_SOLARIZE,
231   GST_PHOTOGRAPHY_COLOR_TONE_MODE_OUT_OF_FOCUS,
232   GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKY_BLUE,
233   GST_PHOTOGRAPHY_COLOR_TONE_MODE_GRASS_GREEN,
234   GST_PHOTOGRAPHY_COLOR_TONE_MODE_SKIN_WHITEN,
235   GST_PHOTOGRAPHY_COLOR_TONE_MODE_POSTERIZE,
236   GST_PHOTOGRAPHY_COLOR_TONE_MODE_WHITEBOARD,
237   GST_PHOTOGRAPHY_COLOR_TONE_MODE_BLACKBOARD,
238   GST_PHOTOGRAPHY_COLOR_TONE_MODE_AQUA
239 } GstPhotographyColorToneMode;
240 
241 /**
242  * GstPhotographySceneMode:
243  * @GST_PHOTOGRAPHY_SCENE_MODE_MANUAL: Set individual options manually
244  * @GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP: Mode for close objects
245  * @GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT: Mode for portraits
246  * @GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE: Mode for landscapes
247  * @GST_PHOTOGRAPHY_SCENE_MODE_SPORT: Mode for scene with fast motion
248  * @GST_PHOTOGRAPHY_SCENE_MODE_NIGHT: Mode for night conditions
249  * @GST_PHOTOGRAPHY_SCENE_MODE_AUTO: Choose scene mode automatically
250  * @GST_PHOTOGRAPHY_SCENE_MODE_ACTION: Take photos of fast moving
251  *     objects (Since: 1.2)
252  * @GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT: Take people pictures
253  *     at night (Since: 1.2)
254  * @GST_PHOTOGRAPHY_SCENE_MODE_THEATRE: Take photos in a theater (Since: 1.2)
255  * @GST_PHOTOGRAPHY_SCENE_MODE_BEACH: Take pictures on the beach (Since: 1.2)
256  * @GST_PHOTOGRAPHY_SCENE_MODE_SNOW: Take pictures on the snow (Since: 1.2)
257  * @GST_PHOTOGRAPHY_SCENE_MODE_SUNSET: Take sunset photos (Since: 1.2)
258  * @GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO: Avoid blurry pictures
259  *     (for example, due to hand shake) (Since: 1.2)
260  * @GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS: For shooting firework
261  *     displays (Since: 1.2)
262  * @GST_PHOTOGRAPHY_SCENE_MODE_PARTY: Take indoor low-light shot (Since: 1.2)
263  * @GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT: Capture the naturally warm color
264  *     of scenes lit by candles (Since: 1.2)
265  * @GST_PHOTOGRAPHY_SCENE_MODE_BARCODE: Applications are looking for
266  *     a barcode (Since: 1.2)
267  *
268  * Each mode contains preset #GstPhotography options in order to produce
269  * good capturing result in certain scene.
270  */
271 typedef enum
272 {
273   GST_PHOTOGRAPHY_SCENE_MODE_MANUAL = 0,
274   GST_PHOTOGRAPHY_SCENE_MODE_CLOSEUP,
275   GST_PHOTOGRAPHY_SCENE_MODE_PORTRAIT,
276   GST_PHOTOGRAPHY_SCENE_MODE_LANDSCAPE,
277   GST_PHOTOGRAPHY_SCENE_MODE_SPORT,
278   GST_PHOTOGRAPHY_SCENE_MODE_NIGHT,
279   GST_PHOTOGRAPHY_SCENE_MODE_AUTO,
280   GST_PHOTOGRAPHY_SCENE_MODE_ACTION,
281   GST_PHOTOGRAPHY_SCENE_MODE_NIGHT_PORTRAIT,
282   GST_PHOTOGRAPHY_SCENE_MODE_THEATRE,
283   GST_PHOTOGRAPHY_SCENE_MODE_BEACH,
284   GST_PHOTOGRAPHY_SCENE_MODE_SNOW,
285   GST_PHOTOGRAPHY_SCENE_MODE_SUNSET,
286   GST_PHOTOGRAPHY_SCENE_MODE_STEADY_PHOTO,
287   GST_PHOTOGRAPHY_SCENE_MODE_FIREWORKS,
288   GST_PHOTOGRAPHY_SCENE_MODE_PARTY,
289   GST_PHOTOGRAPHY_SCENE_MODE_CANDLELIGHT,
290   GST_PHOTOGRAPHY_SCENE_MODE_BARCODE
291 } GstPhotographySceneMode;
292 
293 /**
294  * GstPhotographyFlashMode:
295  * @GST_PHOTOGRAPHY_FLASH_MODE_AUTO: Fire flash automatically according to
296  * lighting conditions.
297  * @GST_PHOTOGRAPHY_FLASH_MODE_OFF: Never fire flash
298  * @GST_PHOTOGRAPHY_FLASH_MODE_ON: Always fire flash
299  * @GST_PHOTOGRAPHY_FLASH_MODE_FILL_IN: Fill in flash
300  * @GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE: Flash mode for reducing chance of
301  * capturing red eyes
302  *
303  * Modes for flash control.
304  */
305 typedef enum
306 {
307   GST_PHOTOGRAPHY_FLASH_MODE_AUTO = 0,
308   GST_PHOTOGRAPHY_FLASH_MODE_OFF,
309   GST_PHOTOGRAPHY_FLASH_MODE_ON,
310   GST_PHOTOGRAPHY_FLASH_MODE_FILL_IN,
311   GST_PHOTOGRAPHY_FLASH_MODE_RED_EYE
312 } GstPhotographyFlashMode;
313 
314 /**
315  * GstPhotographyFocusStatus:
316  * @GST_PHOTOGRAPHY_FOCUS_STATUS_NONE: No status available
317  * @GST_PHOTOGRAPHY_FOCUS_STATUS_RUNNING: Focusing is ongoing
318  * @GST_PHOTOGRAPHY_FOCUS_STATUS_FAIL: Focusing failed
319  * @GST_PHOTOGRAPHY_FOCUS_STATUS_SUCCESS: Focusing succeeded
320  *
321  * Status of the focusing operation, used in #GST_PHOTOGRAPHY_AUTOFOCUS_DONE
322  * message.
323  */
324 typedef enum
325 {
326   GST_PHOTOGRAPHY_FOCUS_STATUS_NONE = 0,
327   GST_PHOTOGRAPHY_FOCUS_STATUS_RUNNING,
328   GST_PHOTOGRAPHY_FOCUS_STATUS_FAIL,
329   GST_PHOTOGRAPHY_FOCUS_STATUS_SUCCESS
330 } GstPhotographyFocusStatus;
331 
332 /**
333  * GstPhotographyCaps:
334  *
335  * Bitmask that indicates which #GstPhotography interface features an instance
336  * supports.
337  */
338 typedef enum
339 {
340   GST_PHOTOGRAPHY_CAPS_NONE              = (0 << 0),
341   GST_PHOTOGRAPHY_CAPS_EV_COMP           = (1 << 0),
342   GST_PHOTOGRAPHY_CAPS_ISO_SPEED         = (1 << 1),
343   GST_PHOTOGRAPHY_CAPS_WB_MODE           = (1 << 2),
344   GST_PHOTOGRAPHY_CAPS_TONE              = (1 << 3),
345   GST_PHOTOGRAPHY_CAPS_SCENE             = (1 << 4),
346   GST_PHOTOGRAPHY_CAPS_FLASH             = (1 << 5),
347   GST_PHOTOGRAPHY_CAPS_ZOOM              = (1 << 6),
348   GST_PHOTOGRAPHY_CAPS_FOCUS             = (1 << 7),
349   GST_PHOTOGRAPHY_CAPS_APERTURE          = (1 << 8),
350   GST_PHOTOGRAPHY_CAPS_EXPOSURE          = (1 << 9),
351   GST_PHOTOGRAPHY_CAPS_SHAKE             = (1 << 10),
352   GST_PHOTOGRAPHY_CAPS_WHITE_BALANCE     = (1 << 11),
353   GST_PHOTOGRAPHY_CAPS_NOISE_REDUCTION   = (1 << 12),
354   GST_PHOTOGRAPHY_CAPS_FLICKER_REDUCTION = (1 << 13),
355   GST_PHOTOGRAPHY_CAPS_ALL               = (~0)
356 } GstPhotographyCaps;
357 
358 /**
359  * GstPhotographyShakeRisk:
360  * @GST_PHOTOGRAPHY_SHAKE_RISK_LOW: Low risk
361  * @GST_PHOTOGRAPHY_SHAKE_RISK_MEDIUM: Medium risk
362  * @GST_PHOTOGRAPHY_SHAKE_RISK_HIGH: High risk
363  *
364  * Risk level of captured image becoming "shaken" due to camera movement and
365  * too long exposure time. Used in #GST_PHOTOGRAPHY_SHAKE_RISK #GstMessage.
366  */
367 typedef enum
368 {
369   GST_PHOTOGRAPHY_SHAKE_RISK_LOW = 0,
370   GST_PHOTOGRAPHY_SHAKE_RISK_MEDIUM,
371   GST_PHOTOGRAPHY_SHAKE_RISK_HIGH,
372 } GstPhotographyShakeRisk;
373 
374 /**
375  * GstPhotographyFlickerReductionMode:
376  * @GST_PHOTOGRAPHY_FLICKER_REDUCTION_OFF: Disable flicker reduction
377  * @GST_PHOTOGRAPHY_FLICKER_REDUCTION_50HZ: 50Hz flicker reduction
378  * @GST_PHOTOGRAPHY_FLICKER_REDUCTION_60HZ: 60Hz flicker reduction
379  * @GST_PHOTOGRAPHY_FLICKER_REDUCTION_AUTO: Choose mode automatically
380  *
381  * Reduce flicker in video caused by light source fluctuation.
382  */
383 typedef enum
384 {
385   GST_PHOTOGRAPHY_FLICKER_REDUCTION_OFF = 0,
386   GST_PHOTOGRAPHY_FLICKER_REDUCTION_50HZ,
387   GST_PHOTOGRAPHY_FLICKER_REDUCTION_60HZ,
388   GST_PHOTOGRAPHY_FLICKER_REDUCTION_AUTO,
389 } GstPhotographyFlickerReductionMode;
390 
391 /**
392  * GstPhotographyFocusMode:
393  * @GST_PHOTOGRAPHY_FOCUS_MODE_AUTO: Choose focus mode automatically
394  * @GST_PHOTOGRAPHY_FOCUS_MODE_MACRO: Mode for focusing objects close to lens
395  * @GST_PHOTOGRAPHY_FOCUS_MODE_PORTRAIT: Mode for portraits
396  * @GST_PHOTOGRAPHY_FOCUS_MODE_INFINITY: Mode for landscapes and far away objects
397  * @GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL: Mode for maximum depth of field, keeping
398  * focus acceptable both in infinify and as close objects as possible
399  * @GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED: Extended focus mode
400  * @GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL: Continuous autofocus mode
401  * @GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED: Extended continuous
402  * autofocus mode
403  * @GST_PHOTOGRAPHY_FOCUS_MODE_MANUAL: Disable automatic focusing
404  * and keep current value. #GstPhotography:lens-focus property can
405  * be used to change focus manually.
406  *
407  * Choose mode for focusing algorithm.
408  */
409 typedef enum {
410     GST_PHOTOGRAPHY_FOCUS_MODE_AUTO = 0,
411     GST_PHOTOGRAPHY_FOCUS_MODE_MACRO,
412     GST_PHOTOGRAPHY_FOCUS_MODE_PORTRAIT,
413     GST_PHOTOGRAPHY_FOCUS_MODE_INFINITY,
414     GST_PHOTOGRAPHY_FOCUS_MODE_HYPERFOCAL,
415     GST_PHOTOGRAPHY_FOCUS_MODE_EXTENDED,
416     GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_NORMAL,
417     GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED,
418     GST_PHOTOGRAPHY_FOCUS_MODE_MANUAL
419 } GstPhotographyFocusMode;
420 
421 /**
422  * GstPhotographyExposureMode:
423  * @GST_PHOTOGRAPHY_EXPOSURE_MODE_AUTO: Adjust exposure automatically
424  * @GST_PHOTOGRAPHY_EXPOSURE_MODE_MANUAL: Disable automatic exposure adjustment
425  * and keep current values.
426  *
427  */
428 typedef enum {
429     GST_PHOTOGRAPHY_EXPOSURE_MODE_AUTO = 0,
430     GST_PHOTOGRAPHY_EXPOSURE_MODE_MANUAL
431 } GstPhotographyExposureMode;
432 
433 /**
434  * GstPhotographySettings:
435  *
436  * Structure containing all #GstPhotography settings, used to set all
437  * settings in one call with @gst_photography_set_config().
438  */
439 typedef struct
440 {
441   GstPhotographyWhiteBalanceMode wb_mode;
442   GstPhotographyColorToneMode tone_mode;
443   GstPhotographySceneMode scene_mode;
444   GstPhotographyFlashMode flash_mode;
445   guint32 exposure_time;
446   guint aperture;
447   gfloat ev_compensation;
448   guint iso_speed;
449   gfloat zoom;
450   GstPhotographyFlickerReductionMode flicker_mode;
451   GstPhotographyFocusMode focus_mode;
452   GstPhotographyNoiseReduction noise_reduction;
453   GstPhotographyExposureMode exposure_mode;
454   guint color_temperature;
455   guint white_point[MAX_WHITE_POINT_VALUES];
456   gfloat analog_gain;
457   gfloat lens_focus;
458   guint min_exposure_time;
459   guint max_exposure_time;
460   /* FIXME: add padding? */
461 } GstPhotographySettings;
462 
463 /**
464  * GstPhotographyCapturePrepared:
465  * @data: user data that has been given, when registering the callback
466  * @configured_caps: #GstCaps defining the configured capture format.
467  *     Ownership of these caps stays in the element.
468  *
469  * This callback will be called when the element has finished preparations
470  * and is ready for image capture. The next buffer that element produces
471  * will be of @configured_caps format, so this callback allows the application
472  * to e.g. reconfigure capsfilters in pipeline if any.
473  */
474 typedef void (*GstPhotographyCapturePrepared) (gpointer data, const GstCaps *configured_caps);
475 
476 /**
477  * GstPhotographyInterface:
478  * @parent: parent interface type.
479  * @get_ev_compensation: vmethod to get ev exposure compensation value
480  * @get_iso_speed: vmethod to get iso speed (light sensitivity) value
481  * @get_aperture: vmethod to get aperture value
482  * @get_exposure: vmethod to get exposure time value
483  * @get_white_balance_mode: vmethod to get white balance mode value
484  * @get_color_tone_mode: vmethod to get color tone mode value
485  * @get_scene_mode: vmethod to get scene mode value
486  * @get_flash_mode: vmethod to get flash mode value
487  * @get_noise_reduction: vmethod to get noise reduction mode value
488  * @get_zoom: vmethod to get zoom factor value
489  * @set_ev_compensation: vmethod to set ev exposure compensation value
490  * @set_iso_speed: vmethod to set iso speed (light sensitivity) value
491  * @set_aperture: vmethod to set aperture value
492  * @set_exposure: vmethod to set exposure time value
493  * @set_white_balance_mode: vmethod to set white balance mode value
494  * @set_color_tone_mode: vmethod to set color tone mode value
495  * @set_scene_mode: vmethod to set scene mode value
496  * @set_flash_mode: vmethod to set flash mode value
497  * @set_noise_reduction: vmethod to set noise reduction mode value
498  * @set_zoom: vmethod to set zoom factor value
499  * @get_capabilities: vmethod to get supported capabilities of the interface
500  * @prepare_for_capture: vmethod to tell the element to prepare for capturing
501  * @set_autofocus: vmethod to set autofocus on/off
502  * @set_config: vmethod to set all configuration parameters at once
503  * @get_config: vmethod to get all configuration parameters at once
504  * @get_image_capture_supported_caps: vmethod to get caps describing supported image capture formats
505  *
506  * #GstPhotographyInterface interface.
507  */
508 typedef struct _GstPhotographyInterface
509 {
510   GTypeInterface parent;
511 
512   /* virtual functions */
513   gboolean (*get_ev_compensation)    (GstPhotography * photo, gfloat * ev_comp);
514   gboolean (*get_iso_speed)          (GstPhotography * photo, guint * iso_speed);
515   gboolean (*get_aperture)           (GstPhotography * photo, guint * aperture);
516   gboolean (*get_exposure)           (GstPhotography * photo, guint32 * exposure);
517   gboolean (*get_white_balance_mode) (GstPhotography * photo, GstPhotographyWhiteBalanceMode * wb_mode);
518   gboolean (*get_color_tone_mode)    (GstPhotography * photo, GstPhotographyColorToneMode * tone_mode);
519   gboolean (*get_scene_mode)         (GstPhotography * photo, GstPhotographySceneMode * scene_mode);
520   gboolean (*get_flash_mode)         (GstPhotography * photo, GstPhotographyFlashMode * flash_mode);
521   gboolean (*get_zoom)               (GstPhotography * photo, gfloat * zoom);
522   gboolean (*get_flicker_mode)       (GstPhotography * photo, GstPhotographyFlickerReductionMode * flicker_mode);
523   gboolean (*get_focus_mode)         (GstPhotography * photo, GstPhotographyFocusMode * focus_mode);
524 
525   gboolean (*set_ev_compensation)    (GstPhotography * photo, gfloat ev_comp);
526   gboolean (*set_iso_speed)          (GstPhotography * photo, guint iso_speed);
527   gboolean (*set_aperture)           (GstPhotography * photo, guint aperture);
528   gboolean (*set_exposure)           (GstPhotography * photo, guint32 exposure);
529   gboolean (*set_white_balance_mode) (GstPhotography * photo, GstPhotographyWhiteBalanceMode wb_mode);
530   gboolean (*set_color_tone_mode)    (GstPhotography * photo, GstPhotographyColorToneMode tone_mode);
531   gboolean (*set_scene_mode)         (GstPhotography * photo, GstPhotographySceneMode scene_mode);
532   gboolean (*set_flash_mode)         (GstPhotography * photo, GstPhotographyFlashMode flash_mode);
533   gboolean (*set_zoom)               (GstPhotography * photo, gfloat zoom);
534   gboolean (*set_flicker_mode)       (GstPhotography * photo, GstPhotographyFlickerReductionMode flicker_mode);
535   gboolean (*set_focus_mode)         (GstPhotography * photo, GstPhotographyFocusMode focus_mode);
536 
537   GstPhotographyCaps (*get_capabilities) (GstPhotography * photo);
538 
539   gboolean (*prepare_for_capture)    (GstPhotography * photo, GstPhotographyCapturePrepared func, GstCaps *capture_caps, gpointer user_data);
540 
541   void     (*set_autofocus)          (GstPhotography * photo, gboolean on);
542 
543   gboolean (*set_config)             (GstPhotography * photo, GstPhotographySettings * config);
544   gboolean (*get_config)             (GstPhotography * photo, GstPhotographySettings * config);
545 
546   gboolean (*get_noise_reduction)    (GstPhotography * photo, GstPhotographyNoiseReduction * noise_reduction);
547   gboolean (*set_noise_reduction)    (GstPhotography * photo, GstPhotographyNoiseReduction noise_reduction);
548 
549   /* FIXME: remove padding, not needed for interfaces */
550   /*< private > */
551   gpointer _gst_reserved[GST_PADDING];
552 } GstPhotographyInterface;
553 
554 GST_PHOTOGRAPHY_API
555 GType gst_photography_get_type (void);
556 
557 /* virtual class function wrappers */
558 
559 GST_PHOTOGRAPHY_API
560 gboolean gst_photography_get_ev_compensation (GstPhotography * photo,
561                                               gfloat * ev_comp);
562 
563 GST_PHOTOGRAPHY_API
564 gboolean gst_photography_get_iso_speed       (GstPhotography * photo,
565                                               guint * iso_speed);
566 
567 GST_PHOTOGRAPHY_API
568 gboolean gst_photography_get_aperture        (GstPhotography * photo,
569                                               guint * aperture);
570 
571 GST_PHOTOGRAPHY_API
572 gboolean gst_photography_get_exposure        (GstPhotography * photo,
573                                               guint32 * exposure);
574 
575 GST_PHOTOGRAPHY_API
576 gboolean gst_photography_get_white_balance_mode (GstPhotography * photo,
577                                                  GstPhotographyWhiteBalanceMode * wb_mode);
578 
579 GST_PHOTOGRAPHY_API
580 gboolean gst_photography_get_color_tone_mode (GstPhotography * photo,
581                                               GstPhotographyColorToneMode * tone_mode);
582 
583 GST_PHOTOGRAPHY_API
584 gboolean gst_photography_get_scene_mode      (GstPhotography * photo,
585                                               GstPhotographySceneMode * scene_mode);
586 
587 GST_PHOTOGRAPHY_API
588 gboolean gst_photography_get_flash_mode      (GstPhotography * photo,
589                                               GstPhotographyFlashMode * flash_mode);
590 
591 GST_PHOTOGRAPHY_API
592 gboolean gst_photography_get_noise_reduction (GstPhotography * photo,
593                                               GstPhotographyNoiseReduction * noise_reduction);
594 
595 GST_PHOTOGRAPHY_API
596 gboolean gst_photography_get_zoom            (GstPhotography * photo, gfloat * zoom);
597 
598 GST_PHOTOGRAPHY_API
599 gboolean gst_photography_get_flicker_mode    (GstPhotography * photo,
600                                               GstPhotographyFlickerReductionMode * mode);
601 
602 GST_PHOTOGRAPHY_API
603 gboolean gst_photography_get_focus_mode      (GstPhotography * photo,
604                                               GstPhotographyFocusMode * mode);
605 
606 GST_PHOTOGRAPHY_API
607 gboolean gst_photography_set_ev_compensation (GstPhotography * photo,
608                                               gfloat ev_comp);
609 
610 GST_PHOTOGRAPHY_API
611 gboolean gst_photography_set_iso_speed       (GstPhotography * photo,
612                                               guint iso_speed);
613 
614 GST_PHOTOGRAPHY_API
615 gboolean gst_photography_set_aperture        (GstPhotography * photo, guint aperture);
616 
617 GST_PHOTOGRAPHY_API
618 gboolean gst_photography_set_exposure        (GstPhotography * photo, guint exposure);
619 
620 GST_PHOTOGRAPHY_API
621 gboolean gst_photography_set_white_balance_mode (GstPhotography * photo,
622                                                  GstPhotographyWhiteBalanceMode wb_mode);
623 
624 GST_PHOTOGRAPHY_API
625 gboolean gst_photography_set_color_tone_mode (GstPhotography * photo,
626                                               GstPhotographyColorToneMode tone_mode);
627 
628 GST_PHOTOGRAPHY_API
629 gboolean gst_photography_set_scene_mode      (GstPhotography * photo,
630                                               GstPhotographySceneMode scene_mode);
631 
632 GST_PHOTOGRAPHY_API
633 gboolean gst_photography_set_flash_mode      (GstPhotography * photo,
634                                               GstPhotographyFlashMode flash_mode);
635 
636 GST_PHOTOGRAPHY_API
637 gboolean gst_photography_set_noise_reduction (GstPhotography * photo,
638                                               GstPhotographyNoiseReduction noise_reduction);
639 
640 GST_PHOTOGRAPHY_API
641 gboolean gst_photography_set_zoom            (GstPhotography * photo, gfloat zoom);
642 
643 GST_PHOTOGRAPHY_API
644 gboolean gst_photography_set_flicker_mode    (GstPhotography * photo,
645                                               GstPhotographyFlickerReductionMode mode);
646 
647 GST_PHOTOGRAPHY_API
648 gboolean gst_photography_set_focus_mode      (GstPhotography * photo,
649                                               GstPhotographyFocusMode mode);
650 
651 GST_PHOTOGRAPHY_API
652 GstPhotographyCaps gst_photography_get_capabilities (GstPhotography * photo);
653 
654 GST_PHOTOGRAPHY_API
655 gboolean gst_photography_prepare_for_capture (GstPhotography * photo,
656                                               GstPhotographyCapturePrepared func,
657                                               GstCaps *capture_caps,
658                                               gpointer user_data);
659 
660 GST_PHOTOGRAPHY_API
661 gboolean gst_photography_set_config    (GstPhotography         * photo,
662                                         GstPhotographySettings * config);
663 
664 GST_PHOTOGRAPHY_API
665 gboolean gst_photography_get_config    (GstPhotography         * photo,
666                                         GstPhotographySettings * config);
667 
668 GST_PHOTOGRAPHY_API
669 void     gst_photography_set_autofocus (GstPhotography * photo, gboolean on);
670 
671 G_END_DECLS
672 
673 #endif /* __GST_PHOTOGRAPHY_H__ */
674