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

source code of include/gstreamer-1.0/gst/interfaces/photography.h