Skip to main content

web_sys/features/
gen_ImageCapture.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    #[wasm_bindgen(
9        extends = "::js_sys::Object",
10        js_name = "ImageCapture",
11        typescript_type = "ImageCapture"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `ImageCapture` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `ImageCapture`*"]
19    #[doc = ""]
20    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
21    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
22    pub type ImageCapture;
23    #[cfg(web_sys_unstable_apis)]
24    #[cfg(feature = "MediaStreamTrack")]
25    #[wasm_bindgen(method, getter, js_class = "ImageCapture", js_name = "track")]
26    #[doc = "Getter for the `track` field of this object."]
27    #[doc = ""]
28    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture/track)"]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `ImageCapture`, `MediaStreamTrack`*"]
31    #[doc = ""]
32    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
33    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
34    pub fn track(this: &ImageCapture) -> MediaStreamTrack;
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "MediaStreamTrack")]
37    #[wasm_bindgen(catch, constructor, js_class = "ImageCapture")]
38    #[doc = "The `new ImageCapture(..)` constructor, creating a new instance of `ImageCapture`."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture/ImageCapture)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `ImageCapture`, `MediaStreamTrack`*"]
43    #[doc = ""]
44    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
46    pub fn new(video_track: &MediaStreamTrack) -> Result<ImageCapture, JsValue>;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "PhotoCapabilities")]
49    #[wasm_bindgen(method, js_class = "ImageCapture", js_name = "getPhotoCapabilities")]
50    #[doc = "The `getPhotoCapabilities()` method."]
51    #[doc = ""]
52    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture/getPhotoCapabilities)"]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `ImageCapture`, `PhotoCapabilities`*"]
55    #[doc = ""]
56    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
57    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
58    pub fn get_photo_capabilities(this: &ImageCapture) -> ::js_sys::Promise<PhotoCapabilities>;
59    #[cfg(web_sys_unstable_apis)]
60    #[cfg(feature = "PhotoSettings")]
61    #[wasm_bindgen(method, js_class = "ImageCapture", js_name = "getPhotoSettings")]
62    #[doc = "The `getPhotoSettings()` method."]
63    #[doc = ""]
64    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture/getPhotoSettings)"]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `ImageCapture`, `PhotoSettings`*"]
67    #[doc = ""]
68    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
69    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
70    pub fn get_photo_settings(this: &ImageCapture) -> ::js_sys::Promise<PhotoSettings>;
71    #[cfg(web_sys_unstable_apis)]
72    #[cfg(feature = "ImageBitmap")]
73    #[wasm_bindgen(method, js_class = "ImageCapture", js_name = "grabFrame")]
74    #[doc = "The `grabFrame()` method."]
75    #[doc = ""]
76    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture/grabFrame)"]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `ImageBitmap`, `ImageCapture`*"]
79    #[doc = ""]
80    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    pub fn grab_frame(this: &ImageCapture) -> ::js_sys::Promise<ImageBitmap>;
83    #[cfg(web_sys_unstable_apis)]
84    #[cfg(feature = "Blob")]
85    #[wasm_bindgen(method, js_class = "ImageCapture", js_name = "takePhoto")]
86    #[doc = "The `takePhoto()` method."]
87    #[doc = ""]
88    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture/takePhoto)"]
89    #[doc = ""]
90    #[doc = "*This API requires the following crate features to be activated: `Blob`, `ImageCapture`*"]
91    #[doc = ""]
92    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
93    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
94    pub fn take_photo(this: &ImageCapture) -> ::js_sys::Promise<Blob>;
95    #[cfg(web_sys_unstable_apis)]
96    #[cfg(all(feature = "Blob", feature = "PhotoSettings",))]
97    #[wasm_bindgen(method, js_class = "ImageCapture", js_name = "takePhoto")]
98    #[doc = "The `takePhoto()` method."]
99    #[doc = ""]
100    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture/takePhoto)"]
101    #[doc = ""]
102    #[doc = "*This API requires the following crate features to be activated: `Blob`, `ImageCapture`, `PhotoSettings`*"]
103    #[doc = ""]
104    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
105    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
106    pub fn take_photo_with_photo_settings(
107        this: &ImageCapture,
108        photo_settings: &PhotoSettings,
109    ) -> ::js_sys::Promise<Blob>;
110}