maxcountryman_web_sys/features/
gen_GpuImageCopyBuffer.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUImageCopyBuffer)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GpuImageCopyBuffer` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"]
12 #[doc = ""]
13 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15 pub type GpuImageCopyBuffer;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuImageCopyBuffer {
19 #[cfg(feature = "GpuBuffer")]
20 #[doc = "Construct a new `GpuImageCopyBuffer`."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"]
23 #[doc = ""]
24 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
26 pub fn new(buffer: &GpuBuffer) -> Self {
27 #[allow(unused_mut)]
28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29 ret.buffer(buffer);
30 ret
31 }
32 #[cfg(web_sys_unstable_apis)]
33 #[doc = "Change the `bytesPerRow` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"]
36 #[doc = ""]
37 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
39 pub fn bytes_per_row(&mut self, val: u32) -> &mut Self {
40 use wasm_bindgen::JsValue;
41 let r = ::js_sys::Reflect::set(
42 self.as_ref(),
43 &JsValue::from("bytesPerRow"),
44 &JsValue::from(val),
45 );
46 debug_assert!(
47 r.is_ok(),
48 "setting properties should never fail on our dictionary objects"
49 );
50 let _ = r;
51 self
52 }
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Change the `offset` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 pub fn offset(&mut self, val: f64) -> &mut Self {
61 use wasm_bindgen::JsValue;
62 let r =
63 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val));
64 debug_assert!(
65 r.is_ok(),
66 "setting properties should never fail on our dictionary objects"
67 );
68 let _ = r;
69 self
70 }
71 #[cfg(web_sys_unstable_apis)]
72 #[doc = "Change the `rowsPerImage` field of this object."]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyBuffer`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
78 pub fn rows_per_image(&mut self, val: u32) -> &mut Self {
79 use wasm_bindgen::JsValue;
80 let r = ::js_sys::Reflect::set(
81 self.as_ref(),
82 &JsValue::from("rowsPerImage"),
83 &JsValue::from(val),
84 );
85 debug_assert!(
86 r.is_ok(),
87 "setting properties should never fail on our dictionary objects"
88 );
89 let _ = r;
90 self
91 }
92 #[cfg(web_sys_unstable_apis)]
93 #[cfg(feature = "GpuBuffer")]
94 #[doc = "Change the `buffer` field of this object."]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuImageCopyBuffer`*"]
97 #[doc = ""]
98 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
99 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
100 pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self {
101 use wasm_bindgen::JsValue;
102 let r =
103 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val));
104 debug_assert!(
105 r.is_ok(),
106 "setting properties should never fail on our dictionary objects"
107 );
108 let _ = r;
109 self
110 }
111}