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