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