photography.h 25 KB

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