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