web_sys/features/
gen_ImageDecoderInit.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 = ImageDecoderInit)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `ImageDecoderInit` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type ImageDecoderInit;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "ColorSpaceConversion")]
19 #[doc = "Get the `colorSpaceConversion` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageDecoderInit`*"]
22 #[doc = ""]
23 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25 #[wasm_bindgen(method, getter = "colorSpaceConversion")]
26 pub fn get_color_space_conversion(this: &ImageDecoderInit) -> Option<ColorSpaceConversion>;
27 #[cfg(web_sys_unstable_apis)]
28 #[cfg(feature = "ColorSpaceConversion")]
29 #[doc = "Change the `colorSpaceConversion` field of this object."]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageDecoderInit`*"]
32 #[doc = ""]
33 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35 #[wasm_bindgen(method, setter = "colorSpaceConversion")]
36 pub fn set_color_space_conversion(this: &ImageDecoderInit, val: ColorSpaceConversion);
37 #[cfg(web_sys_unstable_apis)]
38 #[doc = "Get the `data` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
41 #[doc = ""]
42 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44 #[wasm_bindgen(method, getter = "data")]
45 pub fn get_data(this: &ImageDecoderInit) -> ::wasm_bindgen::JsValue;
46 #[cfg(web_sys_unstable_apis)]
47 #[doc = "Change the `data` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
50 #[doc = ""]
51 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "data")]
54 pub fn set_data(this: &ImageDecoderInit, val: &::wasm_bindgen::JsValue);
55 #[cfg(web_sys_unstable_apis)]
56 #[doc = "Get the `desiredHeight` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
59 #[doc = ""]
60 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "desiredHeight")]
63 pub fn get_desired_height(this: &ImageDecoderInit) -> Option<u32>;
64 #[cfg(web_sys_unstable_apis)]
65 #[doc = "Change the `desiredHeight` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
68 #[doc = ""]
69 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71 #[wasm_bindgen(method, setter = "desiredHeight")]
72 pub fn set_desired_height(this: &ImageDecoderInit, val: u32);
73 #[cfg(web_sys_unstable_apis)]
74 #[doc = "Get the `desiredWidth` field of this object."]
75 #[doc = ""]
76 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
77 #[doc = ""]
78 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80 #[wasm_bindgen(method, getter = "desiredWidth")]
81 pub fn get_desired_width(this: &ImageDecoderInit) -> Option<u32>;
82 #[cfg(web_sys_unstable_apis)]
83 #[doc = "Change the `desiredWidth` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
86 #[doc = ""]
87 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
89 #[wasm_bindgen(method, setter = "desiredWidth")]
90 pub fn set_desired_width(this: &ImageDecoderInit, val: u32);
91 #[cfg(web_sys_unstable_apis)]
92 #[doc = "Get the `preferAnimation` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
95 #[doc = ""]
96 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 #[wasm_bindgen(method, getter = "preferAnimation")]
99 pub fn get_prefer_animation(this: &ImageDecoderInit) -> Option<bool>;
100 #[cfg(web_sys_unstable_apis)]
101 #[doc = "Change the `preferAnimation` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
107 #[wasm_bindgen(method, setter = "preferAnimation")]
108 pub fn set_prefer_animation(this: &ImageDecoderInit, val: bool);
109 #[cfg(web_sys_unstable_apis)]
110 #[cfg(feature = "PremultiplyAlpha")]
111 #[doc = "Get the `premultiplyAlpha` field of this object."]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
117 #[wasm_bindgen(method, getter = "premultiplyAlpha")]
118 pub fn get_premultiply_alpha(this: &ImageDecoderInit) -> Option<PremultiplyAlpha>;
119 #[cfg(web_sys_unstable_apis)]
120 #[cfg(feature = "PremultiplyAlpha")]
121 #[doc = "Change the `premultiplyAlpha` field of this object."]
122 #[doc = ""]
123 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"]
124 #[doc = ""]
125 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
126 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
127 #[wasm_bindgen(method, setter = "premultiplyAlpha")]
128 pub fn set_premultiply_alpha(this: &ImageDecoderInit, val: PremultiplyAlpha);
129 #[cfg(web_sys_unstable_apis)]
130 #[doc = "Get the `type` field of this object."]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
133 #[doc = ""]
134 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
135 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
136 #[wasm_bindgen(method, getter = "type")]
137 pub fn get_type(this: &ImageDecoderInit) -> ::alloc::string::String;
138 #[cfg(web_sys_unstable_apis)]
139 #[doc = "Change the `type` field of this object."]
140 #[doc = ""]
141 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
142 #[doc = ""]
143 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
144 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
145 #[wasm_bindgen(method, setter = "type")]
146 pub fn set_type(this: &ImageDecoderInit, val: &str);
147}
148#[cfg(web_sys_unstable_apis)]
149impl ImageDecoderInit {
150 #[doc = "Construct a new `ImageDecoderInit`."]
151 #[doc = ""]
152 #[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
156 pub fn new(data: &::wasm_bindgen::JsValue, type_: &str) -> Self {
157 #[allow(unused_mut)]
158 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
159 ret.set_data(data);
160 ret.set_type(type_);
161 ret
162 }
163 #[cfg(web_sys_unstable_apis)]
164 #[cfg(feature = "ColorSpaceConversion")]
165 #[deprecated = "Use `set_color_space_conversion()` instead."]
166 pub fn color_space_conversion(&mut self, val: ColorSpaceConversion) -> &mut Self {
167 self.set_color_space_conversion(val);
168 self
169 }
170 #[cfg(web_sys_unstable_apis)]
171 #[deprecated = "Use `set_data()` instead."]
172 pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
173 self.set_data(val);
174 self
175 }
176 #[cfg(web_sys_unstable_apis)]
177 #[deprecated = "Use `set_desired_height()` instead."]
178 pub fn desired_height(&mut self, val: u32) -> &mut Self {
179 self.set_desired_height(val);
180 self
181 }
182 #[cfg(web_sys_unstable_apis)]
183 #[deprecated = "Use `set_desired_width()` instead."]
184 pub fn desired_width(&mut self, val: u32) -> &mut Self {
185 self.set_desired_width(val);
186 self
187 }
188 #[cfg(web_sys_unstable_apis)]
189 #[deprecated = "Use `set_prefer_animation()` instead."]
190 pub fn prefer_animation(&mut self, val: bool) -> &mut Self {
191 self.set_prefer_animation(val);
192 self
193 }
194 #[cfg(web_sys_unstable_apis)]
195 #[cfg(feature = "PremultiplyAlpha")]
196 #[deprecated = "Use `set_premultiply_alpha()` instead."]
197 pub fn premultiply_alpha(&mut self, val: PremultiplyAlpha) -> &mut Self {
198 self.set_premultiply_alpha(val);
199 self
200 }
201 #[cfg(web_sys_unstable_apis)]
202 #[deprecated = "Use `set_type()` instead."]
203 pub fn type_(&mut self, val: &str) -> &mut Self {
204 self.set_type(val);
205 self
206 }
207}