Skip to main content

web_sys/features/
gen_GpuCopyExternalImageSourceInfo.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 (extends = :: js_sys :: Object , js_name = GPUCopyExternalImageSourceInfo)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuCopyExternalImageSourceInfo` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type GpuCopyExternalImageSourceInfo;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `flipY` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "flipY")]
25    pub fn get_flip_y(this: &GpuCopyExternalImageSourceInfo) -> Option<bool>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `flipY` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
30    #[doc = ""]
31    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "flipY")]
34    pub fn set_flip_y(this: &GpuCopyExternalImageSourceInfo, val: bool);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `origin` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
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    #[wasm_bindgen(method, getter = "origin")]
43    pub fn get_origin(this: &GpuCopyExternalImageSourceInfo) -> ::wasm_bindgen::JsValue;
44    #[cfg(web_sys_unstable_apis)]
45    #[doc = "Change the `origin` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
48    #[doc = ""]
49    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
51    #[wasm_bindgen(method, setter = "origin")]
52    pub fn set_origin(this: &GpuCopyExternalImageSourceInfo, val: &[::js_sys::Number]);
53    #[cfg(web_sys_unstable_apis)]
54    #[cfg(feature = "GpuOrigin2dDict")]
55    #[doc = "Change the `origin` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
58    #[doc = ""]
59    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
60    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
61    #[wasm_bindgen(method, setter = "origin")]
62    pub fn set_origin_gpu_origin_2d_dict(
63        this: &GpuCopyExternalImageSourceInfo,
64        val: &GpuOrigin2dDict,
65    );
66    #[cfg(web_sys_unstable_apis)]
67    #[doc = "Get the `source` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, getter = "source")]
74    pub fn get_source(this: &GpuCopyExternalImageSourceInfo) -> ::js_sys::Object;
75    #[cfg(web_sys_unstable_apis)]
76    #[cfg(feature = "ImageBitmap")]
77    #[doc = "Change the `source` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    #[wasm_bindgen(method, setter = "source")]
84    pub fn set_source(this: &GpuCopyExternalImageSourceInfo, val: &ImageBitmap);
85    #[cfg(web_sys_unstable_apis)]
86    #[cfg(feature = "ImageData")]
87    #[doc = "Change the `source` field of this object."]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
90    #[doc = ""]
91    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
92    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
93    #[wasm_bindgen(method, setter = "source")]
94    pub fn set_source_image_data(this: &GpuCopyExternalImageSourceInfo, val: &ImageData);
95    #[cfg(web_sys_unstable_apis)]
96    #[cfg(feature = "HtmlImageElement")]
97    #[doc = "Change the `source` field of this object."]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
100    #[doc = ""]
101    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
102    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
103    #[wasm_bindgen(method, setter = "source")]
104    pub fn set_source_html_image_element(
105        this: &GpuCopyExternalImageSourceInfo,
106        val: &HtmlImageElement,
107    );
108    #[cfg(web_sys_unstable_apis)]
109    #[cfg(feature = "HtmlVideoElement")]
110    #[doc = "Change the `source` field of this object."]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
113    #[doc = ""]
114    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
115    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
116    #[wasm_bindgen(method, setter = "source")]
117    pub fn set_source_html_video_element(
118        this: &GpuCopyExternalImageSourceInfo,
119        val: &HtmlVideoElement,
120    );
121    #[cfg(web_sys_unstable_apis)]
122    #[cfg(feature = "VideoFrame")]
123    #[doc = "Change the `source` field of this object."]
124    #[doc = ""]
125    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
126    #[doc = ""]
127    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
128    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
129    #[wasm_bindgen(method, setter = "source")]
130    pub fn set_source_video_frame(this: &GpuCopyExternalImageSourceInfo, val: &VideoFrame);
131    #[cfg(web_sys_unstable_apis)]
132    #[cfg(feature = "HtmlCanvasElement")]
133    #[doc = "Change the `source` field of this object."]
134    #[doc = ""]
135    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
136    #[doc = ""]
137    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
138    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
139    #[wasm_bindgen(method, setter = "source")]
140    pub fn set_source_html_canvas_element(
141        this: &GpuCopyExternalImageSourceInfo,
142        val: &HtmlCanvasElement,
143    );
144    #[cfg(web_sys_unstable_apis)]
145    #[cfg(feature = "OffscreenCanvas")]
146    #[doc = "Change the `source` field of this object."]
147    #[doc = ""]
148    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`*"]
149    #[doc = ""]
150    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
151    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
152    #[wasm_bindgen(method, setter = "source")]
153    pub fn set_source_offscreen_canvas(
154        this: &GpuCopyExternalImageSourceInfo,
155        val: &OffscreenCanvas,
156    );
157}
158#[cfg(web_sys_unstable_apis)]
159impl GpuCopyExternalImageSourceInfo {
160    #[cfg(feature = "ImageBitmap")]
161    #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."]
162    #[doc = ""]
163    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`, `ImageBitmap`*"]
164    #[doc = ""]
165    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
166    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
167    pub fn new(source: &ImageBitmap) -> Self {
168        #[allow(unused_mut)]
169        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
170        ret.set_source(source);
171        ret
172    }
173    #[cfg(feature = "ImageData")]
174    #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."]
175    #[doc = ""]
176    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`, `ImageData`*"]
177    #[doc = ""]
178    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
179    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
180    pub fn new_with_image_data(source: &ImageData) -> Self {
181        #[allow(unused_mut)]
182        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
183        ret.set_source_image_data(source);
184        ret
185    }
186    #[cfg(feature = "HtmlImageElement")]
187    #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."]
188    #[doc = ""]
189    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`, `HtmlImageElement`*"]
190    #[doc = ""]
191    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
192    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
193    pub fn new_with_html_image_element(source: &HtmlImageElement) -> Self {
194        #[allow(unused_mut)]
195        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
196        ret.set_source_html_image_element(source);
197        ret
198    }
199    #[cfg(feature = "HtmlVideoElement")]
200    #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."]
201    #[doc = ""]
202    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`, `HtmlVideoElement`*"]
203    #[doc = ""]
204    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
205    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
206    pub fn new_with_html_video_element(source: &HtmlVideoElement) -> Self {
207        #[allow(unused_mut)]
208        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
209        ret.set_source_html_video_element(source);
210        ret
211    }
212    #[cfg(feature = "VideoFrame")]
213    #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."]
214    #[doc = ""]
215    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`, `VideoFrame`*"]
216    #[doc = ""]
217    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
218    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
219    pub fn new_with_video_frame(source: &VideoFrame) -> Self {
220        #[allow(unused_mut)]
221        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
222        ret.set_source_video_frame(source);
223        ret
224    }
225    #[cfg(feature = "HtmlCanvasElement")]
226    #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."]
227    #[doc = ""]
228    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`, `HtmlCanvasElement`*"]
229    #[doc = ""]
230    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
231    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
232    pub fn new_with_html_canvas_element(source: &HtmlCanvasElement) -> Self {
233        #[allow(unused_mut)]
234        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
235        ret.set_source_html_canvas_element(source);
236        ret
237    }
238    #[cfg(feature = "OffscreenCanvas")]
239    #[doc = "Construct a new `GpuCopyExternalImageSourceInfo`."]
240    #[doc = ""]
241    #[doc = "*This API requires the following crate features to be activated: `GpuCopyExternalImageSourceInfo`, `OffscreenCanvas`*"]
242    #[doc = ""]
243    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
244    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
245    pub fn new_with_offscreen_canvas(source: &OffscreenCanvas) -> Self {
246        #[allow(unused_mut)]
247        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
248        ret.set_source_offscreen_canvas(source);
249        ret
250    }
251    #[cfg(web_sys_unstable_apis)]
252    #[deprecated = "Use `set_flip_y()` instead."]
253    pub fn flip_y(&mut self, val: bool) -> &mut Self {
254        self.set_flip_y(val);
255        self
256    }
257    #[cfg(web_sys_unstable_apis)]
258    #[deprecated = "Use `set_origin()` instead."]
259    pub fn origin(&mut self, val: &[::js_sys::Number]) -> &mut Self {
260        self.set_origin(val);
261        self
262    }
263    #[cfg(web_sys_unstable_apis)]
264    #[deprecated = "Use `set_source()` instead."]
265    pub fn source(&mut self, val: &ImageBitmap) -> &mut Self {
266        self.set_source(val);
267        self
268    }
269}