1 | #![allow (unused_imports)] |
2 | #![allow (clippy::all)] |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; |
5 | #[wasm_bindgen ] |
6 | extern "C" { |
7 | # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CanvasRenderingContext2D , typescript_type = "CanvasRenderingContext2D" )] |
8 | #[derive (Debug, Clone, PartialEq, Eq)] |
9 | #[doc = "The `CanvasRenderingContext2d` class." ] |
10 | #[doc = "" ] |
11 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D)" ] |
12 | #[doc = "" ] |
13 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
14 | pub type CanvasRenderingContext2d; |
15 | #[cfg (feature = "HtmlCanvasElement" )] |
16 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = canvas)] |
17 | #[doc = "Getter for the `canvas` field of this object." ] |
18 | #[doc = "" ] |
19 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/canvas)" ] |
20 | #[doc = "" ] |
21 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlCanvasElement`*" ] |
22 | pub fn canvas(this: &CanvasRenderingContext2d) -> Option<HtmlCanvasElement>; |
23 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = globalAlpha)] |
24 | #[doc = "Getter for the `globalAlpha` field of this object." ] |
25 | #[doc = "" ] |
26 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalAlpha)" ] |
27 | #[doc = "" ] |
28 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
29 | pub fn global_alpha(this: &CanvasRenderingContext2d) -> f64; |
30 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = globalAlpha)] |
31 | #[doc = "Setter for the `globalAlpha` field of this object." ] |
32 | #[doc = "" ] |
33 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalAlpha)" ] |
34 | #[doc = "" ] |
35 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
36 | pub fn set_global_alpha(this: &CanvasRenderingContext2d, value: f64); |
37 | # [wasm_bindgen (structural , catch , method , getter , js_class = "CanvasRenderingContext2D" , js_name = globalCompositeOperation)] |
38 | #[doc = "Getter for the `globalCompositeOperation` field of this object." ] |
39 | #[doc = "" ] |
40 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation)" ] |
41 | #[doc = "" ] |
42 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
43 | pub fn global_composite_operation(this: &CanvasRenderingContext2d) -> Result<String, JsValue>; |
44 | # [wasm_bindgen (structural , catch , method , setter , js_class = "CanvasRenderingContext2D" , js_name = globalCompositeOperation)] |
45 | #[doc = "Setter for the `globalCompositeOperation` field of this object." ] |
46 | #[doc = "" ] |
47 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation)" ] |
48 | #[doc = "" ] |
49 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
50 | pub fn set_global_composite_operation( |
51 | this: &CanvasRenderingContext2d, |
52 | value: &str, |
53 | ) -> Result<(), JsValue>; |
54 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)] |
55 | #[doc = "Getter for the `strokeStyle` field of this object." ] |
56 | #[doc = "" ] |
57 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)" ] |
58 | #[doc = "" ] |
59 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
60 | pub fn stroke_style(this: &CanvasRenderingContext2d) -> ::wasm_bindgen::JsValue; |
61 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = strokeStyle)] |
62 | #[doc = "Setter for the `strokeStyle` field of this object." ] |
63 | #[doc = "" ] |
64 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeStyle)" ] |
65 | #[doc = "" ] |
66 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
67 | pub fn set_stroke_style(this: &CanvasRenderingContext2d, value: &::wasm_bindgen::JsValue); |
68 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)] |
69 | #[doc = "Getter for the `fillStyle` field of this object." ] |
70 | #[doc = "" ] |
71 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)" ] |
72 | #[doc = "" ] |
73 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
74 | pub fn fill_style(this: &CanvasRenderingContext2d) -> ::wasm_bindgen::JsValue; |
75 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = fillStyle)] |
76 | #[doc = "Setter for the `fillStyle` field of this object." ] |
77 | #[doc = "" ] |
78 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle)" ] |
79 | #[doc = "" ] |
80 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
81 | pub fn set_fill_style(this: &CanvasRenderingContext2d, value: &::wasm_bindgen::JsValue); |
82 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = filter)] |
83 | #[doc = "Getter for the `filter` field of this object." ] |
84 | #[doc = "" ] |
85 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter)" ] |
86 | #[doc = "" ] |
87 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
88 | pub fn filter(this: &CanvasRenderingContext2d) -> String; |
89 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = filter)] |
90 | #[doc = "Setter for the `filter` field of this object." ] |
91 | #[doc = "" ] |
92 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter)" ] |
93 | #[doc = "" ] |
94 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
95 | pub fn set_filter(this: &CanvasRenderingContext2d, value: &str); |
96 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = imageSmoothingEnabled)] |
97 | #[doc = "Getter for the `imageSmoothingEnabled` field of this object." ] |
98 | #[doc = "" ] |
99 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled)" ] |
100 | #[doc = "" ] |
101 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
102 | pub fn image_smoothing_enabled(this: &CanvasRenderingContext2d) -> bool; |
103 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = imageSmoothingEnabled)] |
104 | #[doc = "Setter for the `imageSmoothingEnabled` field of this object." ] |
105 | #[doc = "" ] |
106 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled)" ] |
107 | #[doc = "" ] |
108 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
109 | pub fn set_image_smoothing_enabled(this: &CanvasRenderingContext2d, value: bool); |
110 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = lineWidth)] |
111 | #[doc = "Getter for the `lineWidth` field of this object." ] |
112 | #[doc = "" ] |
113 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineWidth)" ] |
114 | #[doc = "" ] |
115 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
116 | pub fn line_width(this: &CanvasRenderingContext2d) -> f64; |
117 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineWidth)] |
118 | #[doc = "Setter for the `lineWidth` field of this object." ] |
119 | #[doc = "" ] |
120 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineWidth)" ] |
121 | #[doc = "" ] |
122 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
123 | pub fn set_line_width(this: &CanvasRenderingContext2d, value: f64); |
124 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = lineCap)] |
125 | #[doc = "Getter for the `lineCap` field of this object." ] |
126 | #[doc = "" ] |
127 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap)" ] |
128 | #[doc = "" ] |
129 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
130 | pub fn line_cap(this: &CanvasRenderingContext2d) -> String; |
131 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineCap)] |
132 | #[doc = "Setter for the `lineCap` field of this object." ] |
133 | #[doc = "" ] |
134 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap)" ] |
135 | #[doc = "" ] |
136 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
137 | pub fn set_line_cap(this: &CanvasRenderingContext2d, value: &str); |
138 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = lineJoin)] |
139 | #[doc = "Getter for the `lineJoin` field of this object." ] |
140 | #[doc = "" ] |
141 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin)" ] |
142 | #[doc = "" ] |
143 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
144 | pub fn line_join(this: &CanvasRenderingContext2d) -> String; |
145 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineJoin)] |
146 | #[doc = "Setter for the `lineJoin` field of this object." ] |
147 | #[doc = "" ] |
148 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin)" ] |
149 | #[doc = "" ] |
150 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
151 | pub fn set_line_join(this: &CanvasRenderingContext2d, value: &str); |
152 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = miterLimit)] |
153 | #[doc = "Getter for the `miterLimit` field of this object." ] |
154 | #[doc = "" ] |
155 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit)" ] |
156 | #[doc = "" ] |
157 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
158 | pub fn miter_limit(this: &CanvasRenderingContext2d) -> f64; |
159 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = miterLimit)] |
160 | #[doc = "Setter for the `miterLimit` field of this object." ] |
161 | #[doc = "" ] |
162 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit)" ] |
163 | #[doc = "" ] |
164 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
165 | pub fn set_miter_limit(this: &CanvasRenderingContext2d, value: f64); |
166 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = lineDashOffset)] |
167 | #[doc = "Getter for the `lineDashOffset` field of this object." ] |
168 | #[doc = "" ] |
169 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset)" ] |
170 | #[doc = "" ] |
171 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
172 | pub fn line_dash_offset(this: &CanvasRenderingContext2d) -> f64; |
173 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = lineDashOffset)] |
174 | #[doc = "Setter for the `lineDashOffset` field of this object." ] |
175 | #[doc = "" ] |
176 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset)" ] |
177 | #[doc = "" ] |
178 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
179 | pub fn set_line_dash_offset(this: &CanvasRenderingContext2d, value: f64); |
180 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = shadowOffsetX)] |
181 | #[doc = "Getter for the `shadowOffsetX` field of this object." ] |
182 | #[doc = "" ] |
183 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX)" ] |
184 | #[doc = "" ] |
185 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
186 | pub fn shadow_offset_x(this: &CanvasRenderingContext2d) -> f64; |
187 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = shadowOffsetX)] |
188 | #[doc = "Setter for the `shadowOffsetX` field of this object." ] |
189 | #[doc = "" ] |
190 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetX)" ] |
191 | #[doc = "" ] |
192 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
193 | pub fn set_shadow_offset_x(this: &CanvasRenderingContext2d, value: f64); |
194 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = shadowOffsetY)] |
195 | #[doc = "Getter for the `shadowOffsetY` field of this object." ] |
196 | #[doc = "" ] |
197 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY)" ] |
198 | #[doc = "" ] |
199 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
200 | pub fn shadow_offset_y(this: &CanvasRenderingContext2d) -> f64; |
201 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = shadowOffsetY)] |
202 | #[doc = "Setter for the `shadowOffsetY` field of this object." ] |
203 | #[doc = "" ] |
204 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowOffsetY)" ] |
205 | #[doc = "" ] |
206 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
207 | pub fn set_shadow_offset_y(this: &CanvasRenderingContext2d, value: f64); |
208 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = shadowBlur)] |
209 | #[doc = "Getter for the `shadowBlur` field of this object." ] |
210 | #[doc = "" ] |
211 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur)" ] |
212 | #[doc = "" ] |
213 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
214 | pub fn shadow_blur(this: &CanvasRenderingContext2d) -> f64; |
215 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = shadowBlur)] |
216 | #[doc = "Setter for the `shadowBlur` field of this object." ] |
217 | #[doc = "" ] |
218 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur)" ] |
219 | #[doc = "" ] |
220 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
221 | pub fn set_shadow_blur(this: &CanvasRenderingContext2d, value: f64); |
222 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = shadowColor)] |
223 | #[doc = "Getter for the `shadowColor` field of this object." ] |
224 | #[doc = "" ] |
225 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowColor)" ] |
226 | #[doc = "" ] |
227 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
228 | pub fn shadow_color(this: &CanvasRenderingContext2d) -> String; |
229 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = shadowColor)] |
230 | #[doc = "Setter for the `shadowColor` field of this object." ] |
231 | #[doc = "" ] |
232 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowColor)" ] |
233 | #[doc = "" ] |
234 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
235 | pub fn set_shadow_color(this: &CanvasRenderingContext2d, value: &str); |
236 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = font)] |
237 | #[doc = "Getter for the `font` field of this object." ] |
238 | #[doc = "" ] |
239 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font)" ] |
240 | #[doc = "" ] |
241 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
242 | pub fn font(this: &CanvasRenderingContext2d) -> String; |
243 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = font)] |
244 | #[doc = "Setter for the `font` field of this object." ] |
245 | #[doc = "" ] |
246 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font)" ] |
247 | #[doc = "" ] |
248 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
249 | pub fn set_font(this: &CanvasRenderingContext2d, value: &str); |
250 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = textAlign)] |
251 | #[doc = "Getter for the `textAlign` field of this object." ] |
252 | #[doc = "" ] |
253 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign)" ] |
254 | #[doc = "" ] |
255 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
256 | pub fn text_align(this: &CanvasRenderingContext2d) -> String; |
257 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = textAlign)] |
258 | #[doc = "Setter for the `textAlign` field of this object." ] |
259 | #[doc = "" ] |
260 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign)" ] |
261 | #[doc = "" ] |
262 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
263 | pub fn set_text_align(this: &CanvasRenderingContext2d, value: &str); |
264 | # [wasm_bindgen (structural , method , getter , js_class = "CanvasRenderingContext2D" , js_name = textBaseline)] |
265 | #[doc = "Getter for the `textBaseline` field of this object." ] |
266 | #[doc = "" ] |
267 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline)" ] |
268 | #[doc = "" ] |
269 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
270 | pub fn text_baseline(this: &CanvasRenderingContext2d) -> String; |
271 | # [wasm_bindgen (structural , method , setter , js_class = "CanvasRenderingContext2D" , js_name = textBaseline)] |
272 | #[doc = "Setter for the `textBaseline` field of this object." ] |
273 | #[doc = "" ] |
274 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline)" ] |
275 | #[doc = "" ] |
276 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
277 | pub fn set_text_baseline(this: &CanvasRenderingContext2d, value: &str); |
278 | #[cfg (feature = "Window" )] |
279 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawWindow)] |
280 | #[doc = "The `drawWindow()` method." ] |
281 | #[doc = "" ] |
282 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow)" ] |
283 | #[doc = "" ] |
284 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Window`*" ] |
285 | pub fn draw_window( |
286 | this: &CanvasRenderingContext2d, |
287 | window: &Window, |
288 | x: f64, |
289 | y: f64, |
290 | w: f64, |
291 | h: f64, |
292 | bg_color: &str, |
293 | ) -> Result<(), JsValue>; |
294 | #[cfg (feature = "Window" )] |
295 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawWindow)] |
296 | #[doc = "The `drawWindow()` method." ] |
297 | #[doc = "" ] |
298 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow)" ] |
299 | #[doc = "" ] |
300 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Window`*" ] |
301 | pub fn draw_window_with_flags( |
302 | this: &CanvasRenderingContext2d, |
303 | window: &Window, |
304 | x: f64, |
305 | y: f64, |
306 | w: f64, |
307 | h: f64, |
308 | bg_color: &str, |
309 | flags: u32, |
310 | ) -> Result<(), JsValue>; |
311 | #[cfg (feature = "HtmlImageElement" )] |
312 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
313 | #[doc = "The `drawImage()` method." ] |
314 | #[doc = "" ] |
315 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
316 | #[doc = "" ] |
317 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlImageElement`*" ] |
318 | pub fn draw_image_with_html_image_element( |
319 | this: &CanvasRenderingContext2d, |
320 | image: &HtmlImageElement, |
321 | dx: f64, |
322 | dy: f64, |
323 | ) -> Result<(), JsValue>; |
324 | #[cfg (feature = "SvgImageElement" )] |
325 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
326 | #[doc = "The `drawImage()` method." ] |
327 | #[doc = "" ] |
328 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
329 | #[doc = "" ] |
330 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `SvgImageElement`*" ] |
331 | pub fn draw_image_with_svg_image_element( |
332 | this: &CanvasRenderingContext2d, |
333 | image: &SvgImageElement, |
334 | dx: f64, |
335 | dy: f64, |
336 | ) -> Result<(), JsValue>; |
337 | #[cfg (feature = "HtmlCanvasElement" )] |
338 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
339 | #[doc = "The `drawImage()` method." ] |
340 | #[doc = "" ] |
341 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
342 | #[doc = "" ] |
343 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlCanvasElement`*" ] |
344 | pub fn draw_image_with_html_canvas_element( |
345 | this: &CanvasRenderingContext2d, |
346 | image: &HtmlCanvasElement, |
347 | dx: f64, |
348 | dy: f64, |
349 | ) -> Result<(), JsValue>; |
350 | #[cfg (feature = "HtmlVideoElement" )] |
351 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
352 | #[doc = "The `drawImage()` method." ] |
353 | #[doc = "" ] |
354 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
355 | #[doc = "" ] |
356 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlVideoElement`*" ] |
357 | pub fn draw_image_with_html_video_element( |
358 | this: &CanvasRenderingContext2d, |
359 | image: &HtmlVideoElement, |
360 | dx: f64, |
361 | dy: f64, |
362 | ) -> Result<(), JsValue>; |
363 | #[cfg (feature = "ImageBitmap" )] |
364 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
365 | #[doc = "The `drawImage()` method." ] |
366 | #[doc = "" ] |
367 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
368 | #[doc = "" ] |
369 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageBitmap`*" ] |
370 | pub fn draw_image_with_image_bitmap( |
371 | this: &CanvasRenderingContext2d, |
372 | image: &ImageBitmap, |
373 | dx: f64, |
374 | dy: f64, |
375 | ) -> Result<(), JsValue>; |
376 | #[cfg (feature = "OffscreenCanvas" )] |
377 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
378 | #[doc = "The `drawImage()` method." ] |
379 | #[doc = "" ] |
380 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
381 | #[doc = "" ] |
382 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `OffscreenCanvas`*" ] |
383 | pub fn draw_image_with_offscreen_canvas( |
384 | this: &CanvasRenderingContext2d, |
385 | image: &OffscreenCanvas, |
386 | dx: f64, |
387 | dy: f64, |
388 | ) -> Result<(), JsValue>; |
389 | #[cfg (web_sys_unstable_apis)] |
390 | #[cfg (feature = "VideoFrame" )] |
391 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
392 | #[doc = "The `drawImage()` method." ] |
393 | #[doc = "" ] |
394 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
395 | #[doc = "" ] |
396 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `VideoFrame`*" ] |
397 | #[doc = "" ] |
398 | #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as" ] |
399 | #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*" ] |
400 | pub fn draw_image_with_video_frame( |
401 | this: &CanvasRenderingContext2d, |
402 | image: &VideoFrame, |
403 | dx: f64, |
404 | dy: f64, |
405 | ) -> Result<(), JsValue>; |
406 | #[cfg (feature = "HtmlImageElement" )] |
407 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
408 | #[doc = "The `drawImage()` method." ] |
409 | #[doc = "" ] |
410 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
411 | #[doc = "" ] |
412 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlImageElement`*" ] |
413 | pub fn draw_image_with_html_image_element_and_dw_and_dh( |
414 | this: &CanvasRenderingContext2d, |
415 | image: &HtmlImageElement, |
416 | dx: f64, |
417 | dy: f64, |
418 | dw: f64, |
419 | dh: f64, |
420 | ) -> Result<(), JsValue>; |
421 | #[cfg (feature = "SvgImageElement" )] |
422 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
423 | #[doc = "The `drawImage()` method." ] |
424 | #[doc = "" ] |
425 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
426 | #[doc = "" ] |
427 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `SvgImageElement`*" ] |
428 | pub fn draw_image_with_svg_image_element_and_dw_and_dh( |
429 | this: &CanvasRenderingContext2d, |
430 | image: &SvgImageElement, |
431 | dx: f64, |
432 | dy: f64, |
433 | dw: f64, |
434 | dh: f64, |
435 | ) -> Result<(), JsValue>; |
436 | #[cfg (feature = "HtmlCanvasElement" )] |
437 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
438 | #[doc = "The `drawImage()` method." ] |
439 | #[doc = "" ] |
440 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
441 | #[doc = "" ] |
442 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlCanvasElement`*" ] |
443 | pub fn draw_image_with_html_canvas_element_and_dw_and_dh( |
444 | this: &CanvasRenderingContext2d, |
445 | image: &HtmlCanvasElement, |
446 | dx: f64, |
447 | dy: f64, |
448 | dw: f64, |
449 | dh: f64, |
450 | ) -> Result<(), JsValue>; |
451 | #[cfg (feature = "HtmlVideoElement" )] |
452 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
453 | #[doc = "The `drawImage()` method." ] |
454 | #[doc = "" ] |
455 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
456 | #[doc = "" ] |
457 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlVideoElement`*" ] |
458 | pub fn draw_image_with_html_video_element_and_dw_and_dh( |
459 | this: &CanvasRenderingContext2d, |
460 | image: &HtmlVideoElement, |
461 | dx: f64, |
462 | dy: f64, |
463 | dw: f64, |
464 | dh: f64, |
465 | ) -> Result<(), JsValue>; |
466 | #[cfg (feature = "ImageBitmap" )] |
467 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
468 | #[doc = "The `drawImage()` method." ] |
469 | #[doc = "" ] |
470 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
471 | #[doc = "" ] |
472 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageBitmap`*" ] |
473 | pub fn draw_image_with_image_bitmap_and_dw_and_dh( |
474 | this: &CanvasRenderingContext2d, |
475 | image: &ImageBitmap, |
476 | dx: f64, |
477 | dy: f64, |
478 | dw: f64, |
479 | dh: f64, |
480 | ) -> Result<(), JsValue>; |
481 | #[cfg (feature = "OffscreenCanvas" )] |
482 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
483 | #[doc = "The `drawImage()` method." ] |
484 | #[doc = "" ] |
485 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
486 | #[doc = "" ] |
487 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `OffscreenCanvas`*" ] |
488 | pub fn draw_image_with_offscreen_canvas_and_dw_and_dh( |
489 | this: &CanvasRenderingContext2d, |
490 | image: &OffscreenCanvas, |
491 | dx: f64, |
492 | dy: f64, |
493 | dw: f64, |
494 | dh: f64, |
495 | ) -> Result<(), JsValue>; |
496 | #[cfg (web_sys_unstable_apis)] |
497 | #[cfg (feature = "VideoFrame" )] |
498 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
499 | #[doc = "The `drawImage()` method." ] |
500 | #[doc = "" ] |
501 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
502 | #[doc = "" ] |
503 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `VideoFrame`*" ] |
504 | #[doc = "" ] |
505 | #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as" ] |
506 | #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*" ] |
507 | pub fn draw_image_with_video_frame_and_dw_and_dh( |
508 | this: &CanvasRenderingContext2d, |
509 | image: &VideoFrame, |
510 | dx: f64, |
511 | dy: f64, |
512 | dw: f64, |
513 | dh: f64, |
514 | ) -> Result<(), JsValue>; |
515 | #[cfg (feature = "HtmlImageElement" )] |
516 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
517 | #[doc = "The `drawImage()` method." ] |
518 | #[doc = "" ] |
519 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
520 | #[doc = "" ] |
521 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlImageElement`*" ] |
522 | pub fn draw_image_with_html_image_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( |
523 | this: &CanvasRenderingContext2d, |
524 | image: &HtmlImageElement, |
525 | sx: f64, |
526 | sy: f64, |
527 | sw: f64, |
528 | sh: f64, |
529 | dx: f64, |
530 | dy: f64, |
531 | dw: f64, |
532 | dh: f64, |
533 | ) -> Result<(), JsValue>; |
534 | #[cfg (feature = "SvgImageElement" )] |
535 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
536 | #[doc = "The `drawImage()` method." ] |
537 | #[doc = "" ] |
538 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
539 | #[doc = "" ] |
540 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `SvgImageElement`*" ] |
541 | pub fn draw_image_with_svg_image_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( |
542 | this: &CanvasRenderingContext2d, |
543 | image: &SvgImageElement, |
544 | sx: f64, |
545 | sy: f64, |
546 | sw: f64, |
547 | sh: f64, |
548 | dx: f64, |
549 | dy: f64, |
550 | dw: f64, |
551 | dh: f64, |
552 | ) -> Result<(), JsValue>; |
553 | #[cfg (feature = "HtmlCanvasElement" )] |
554 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
555 | #[doc = "The `drawImage()` method." ] |
556 | #[doc = "" ] |
557 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
558 | #[doc = "" ] |
559 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlCanvasElement`*" ] |
560 | pub fn draw_image_with_html_canvas_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( |
561 | this: &CanvasRenderingContext2d, |
562 | image: &HtmlCanvasElement, |
563 | sx: f64, |
564 | sy: f64, |
565 | sw: f64, |
566 | sh: f64, |
567 | dx: f64, |
568 | dy: f64, |
569 | dw: f64, |
570 | dh: f64, |
571 | ) -> Result<(), JsValue>; |
572 | #[cfg (feature = "HtmlVideoElement" )] |
573 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
574 | #[doc = "The `drawImage()` method." ] |
575 | #[doc = "" ] |
576 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
577 | #[doc = "" ] |
578 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HtmlVideoElement`*" ] |
579 | pub fn draw_image_with_html_video_element_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( |
580 | this: &CanvasRenderingContext2d, |
581 | image: &HtmlVideoElement, |
582 | sx: f64, |
583 | sy: f64, |
584 | sw: f64, |
585 | sh: f64, |
586 | dx: f64, |
587 | dy: f64, |
588 | dw: f64, |
589 | dh: f64, |
590 | ) -> Result<(), JsValue>; |
591 | #[cfg (feature = "ImageBitmap" )] |
592 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
593 | #[doc = "The `drawImage()` method." ] |
594 | #[doc = "" ] |
595 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
596 | #[doc = "" ] |
597 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageBitmap`*" ] |
598 | pub fn draw_image_with_image_bitmap_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( |
599 | this: &CanvasRenderingContext2d, |
600 | image: &ImageBitmap, |
601 | sx: f64, |
602 | sy: f64, |
603 | sw: f64, |
604 | sh: f64, |
605 | dx: f64, |
606 | dy: f64, |
607 | dw: f64, |
608 | dh: f64, |
609 | ) -> Result<(), JsValue>; |
610 | #[cfg (feature = "OffscreenCanvas" )] |
611 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
612 | #[doc = "The `drawImage()` method." ] |
613 | #[doc = "" ] |
614 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
615 | #[doc = "" ] |
616 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `OffscreenCanvas`*" ] |
617 | pub fn draw_image_with_offscreen_canvas_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( |
618 | this: &CanvasRenderingContext2d, |
619 | image: &OffscreenCanvas, |
620 | sx: f64, |
621 | sy: f64, |
622 | sw: f64, |
623 | sh: f64, |
624 | dx: f64, |
625 | dy: f64, |
626 | dw: f64, |
627 | dh: f64, |
628 | ) -> Result<(), JsValue>; |
629 | #[cfg (web_sys_unstable_apis)] |
630 | #[cfg (feature = "VideoFrame" )] |
631 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawImage)] |
632 | #[doc = "The `drawImage()` method." ] |
633 | #[doc = "" ] |
634 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)" ] |
635 | #[doc = "" ] |
636 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `VideoFrame`*" ] |
637 | #[doc = "" ] |
638 | #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as" ] |
639 | #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*" ] |
640 | pub fn draw_image_with_video_frame_and_sw_and_sh_and_dx_and_dy_and_dw_and_dh( |
641 | this: &CanvasRenderingContext2d, |
642 | image: &VideoFrame, |
643 | sx: f64, |
644 | sy: f64, |
645 | sw: f64, |
646 | sh: f64, |
647 | dx: f64, |
648 | dy: f64, |
649 | dw: f64, |
650 | dh: f64, |
651 | ) -> Result<(), JsValue>; |
652 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = beginPath)] |
653 | #[doc = "The `beginPath()` method." ] |
654 | #[doc = "" ] |
655 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/beginPath)" ] |
656 | #[doc = "" ] |
657 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
658 | pub fn begin_path(this: &CanvasRenderingContext2d); |
659 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = clip)] |
660 | #[doc = "The `clip()` method." ] |
661 | #[doc = "" ] |
662 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clip)" ] |
663 | #[doc = "" ] |
664 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
665 | pub fn clip(this: &CanvasRenderingContext2d); |
666 | #[cfg (feature = "CanvasWindingRule" )] |
667 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = clip)] |
668 | #[doc = "The `clip()` method." ] |
669 | #[doc = "" ] |
670 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clip)" ] |
671 | #[doc = "" ] |
672 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `CanvasWindingRule`*" ] |
673 | pub fn clip_with_canvas_winding_rule( |
674 | this: &CanvasRenderingContext2d, |
675 | winding: CanvasWindingRule, |
676 | ); |
677 | #[cfg (feature = "Path2d" )] |
678 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = clip)] |
679 | #[doc = "The `clip()` method." ] |
680 | #[doc = "" ] |
681 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clip)" ] |
682 | #[doc = "" ] |
683 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Path2d`*" ] |
684 | pub fn clip_with_path_2d(this: &CanvasRenderingContext2d, path: &Path2d); |
685 | #[cfg (all(feature = "CanvasWindingRule" , feature = "Path2d" ,))] |
686 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = clip)] |
687 | #[doc = "The `clip()` method." ] |
688 | #[doc = "" ] |
689 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clip)" ] |
690 | #[doc = "" ] |
691 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `CanvasWindingRule`, `Path2d`*" ] |
692 | pub fn clip_with_path_2d_and_winding( |
693 | this: &CanvasRenderingContext2d, |
694 | path: &Path2d, |
695 | winding: CanvasWindingRule, |
696 | ); |
697 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = fill)] |
698 | #[doc = "The `fill()` method." ] |
699 | #[doc = "" ] |
700 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill)" ] |
701 | #[doc = "" ] |
702 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
703 | pub fn fill(this: &CanvasRenderingContext2d); |
704 | #[cfg (feature = "CanvasWindingRule" )] |
705 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = fill)] |
706 | #[doc = "The `fill()` method." ] |
707 | #[doc = "" ] |
708 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill)" ] |
709 | #[doc = "" ] |
710 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `CanvasWindingRule`*" ] |
711 | pub fn fill_with_canvas_winding_rule( |
712 | this: &CanvasRenderingContext2d, |
713 | winding: CanvasWindingRule, |
714 | ); |
715 | #[cfg (feature = "Path2d" )] |
716 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = fill)] |
717 | #[doc = "The `fill()` method." ] |
718 | #[doc = "" ] |
719 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill)" ] |
720 | #[doc = "" ] |
721 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Path2d`*" ] |
722 | pub fn fill_with_path_2d(this: &CanvasRenderingContext2d, path: &Path2d); |
723 | #[cfg (all(feature = "CanvasWindingRule" , feature = "Path2d" ,))] |
724 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = fill)] |
725 | #[doc = "The `fill()` method." ] |
726 | #[doc = "" ] |
727 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill)" ] |
728 | #[doc = "" ] |
729 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `CanvasWindingRule`, `Path2d`*" ] |
730 | pub fn fill_with_path_2d_and_winding( |
731 | this: &CanvasRenderingContext2d, |
732 | path: &Path2d, |
733 | winding: CanvasWindingRule, |
734 | ); |
735 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = isPointInPath)] |
736 | #[doc = "The `isPointInPath()` method." ] |
737 | #[doc = "" ] |
738 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath)" ] |
739 | #[doc = "" ] |
740 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
741 | pub fn is_point_in_path_with_f64(this: &CanvasRenderingContext2d, x: f64, y: f64) -> bool; |
742 | #[cfg (feature = "CanvasWindingRule" )] |
743 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = isPointInPath)] |
744 | #[doc = "The `isPointInPath()` method." ] |
745 | #[doc = "" ] |
746 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath)" ] |
747 | #[doc = "" ] |
748 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `CanvasWindingRule`*" ] |
749 | pub fn is_point_in_path_with_f64_and_canvas_winding_rule( |
750 | this: &CanvasRenderingContext2d, |
751 | x: f64, |
752 | y: f64, |
753 | winding: CanvasWindingRule, |
754 | ) -> bool; |
755 | #[cfg (feature = "Path2d" )] |
756 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = isPointInPath)] |
757 | #[doc = "The `isPointInPath()` method." ] |
758 | #[doc = "" ] |
759 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath)" ] |
760 | #[doc = "" ] |
761 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Path2d`*" ] |
762 | pub fn is_point_in_path_with_path_2d_and_f64( |
763 | this: &CanvasRenderingContext2d, |
764 | path: &Path2d, |
765 | x: f64, |
766 | y: f64, |
767 | ) -> bool; |
768 | #[cfg (all(feature = "CanvasWindingRule" , feature = "Path2d" ,))] |
769 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = isPointInPath)] |
770 | #[doc = "The `isPointInPath()` method." ] |
771 | #[doc = "" ] |
772 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInPath)" ] |
773 | #[doc = "" ] |
774 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `CanvasWindingRule`, `Path2d`*" ] |
775 | pub fn is_point_in_path_with_path_2d_and_f64_and_winding( |
776 | this: &CanvasRenderingContext2d, |
777 | path: &Path2d, |
778 | x: f64, |
779 | y: f64, |
780 | winding: CanvasWindingRule, |
781 | ) -> bool; |
782 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = isPointInStroke)] |
783 | #[doc = "The `isPointInStroke()` method." ] |
784 | #[doc = "" ] |
785 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke)" ] |
786 | #[doc = "" ] |
787 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
788 | pub fn is_point_in_stroke_with_x_and_y(this: &CanvasRenderingContext2d, x: f64, y: f64) |
789 | -> bool; |
790 | #[cfg (feature = "Path2d" )] |
791 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = isPointInStroke)] |
792 | #[doc = "The `isPointInStroke()` method." ] |
793 | #[doc = "" ] |
794 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/isPointInStroke)" ] |
795 | #[doc = "" ] |
796 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Path2d`*" ] |
797 | pub fn is_point_in_stroke_with_path_and_x_and_y( |
798 | this: &CanvasRenderingContext2d, |
799 | path: &Path2d, |
800 | x: f64, |
801 | y: f64, |
802 | ) -> bool; |
803 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = stroke)] |
804 | #[doc = "The `stroke()` method." ] |
805 | #[doc = "" ] |
806 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/stroke)" ] |
807 | #[doc = "" ] |
808 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
809 | pub fn stroke(this: &CanvasRenderingContext2d); |
810 | #[cfg (feature = "Path2d" )] |
811 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = stroke)] |
812 | #[doc = "The `stroke()` method." ] |
813 | #[doc = "" ] |
814 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/stroke)" ] |
815 | #[doc = "" ] |
816 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Path2d`*" ] |
817 | pub fn stroke_with_path(this: &CanvasRenderingContext2d, path: &Path2d); |
818 | #[cfg (feature = "CanvasGradient" )] |
819 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = createLinearGradient)] |
820 | #[doc = "The `createLinearGradient()` method." ] |
821 | #[doc = "" ] |
822 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createLinearGradient)" ] |
823 | #[doc = "" ] |
824 | #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `CanvasRenderingContext2d`*" ] |
825 | pub fn create_linear_gradient( |
826 | this: &CanvasRenderingContext2d, |
827 | x0: f64, |
828 | y0: f64, |
829 | x1: f64, |
830 | y1: f64, |
831 | ) -> CanvasGradient; |
832 | #[cfg (all(feature = "CanvasPattern" , feature = "HtmlImageElement" ,))] |
833 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] |
834 | #[doc = "The `createPattern()` method." ] |
835 | #[doc = "" ] |
836 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)" ] |
837 | #[doc = "" ] |
838 | #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `HtmlImageElement`*" ] |
839 | pub fn create_pattern_with_html_image_element( |
840 | this: &CanvasRenderingContext2d, |
841 | image: &HtmlImageElement, |
842 | repetition: &str, |
843 | ) -> Result<Option<CanvasPattern>, JsValue>; |
844 | #[cfg (all(feature = "CanvasPattern" , feature = "SvgImageElement" ,))] |
845 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] |
846 | #[doc = "The `createPattern()` method." ] |
847 | #[doc = "" ] |
848 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)" ] |
849 | #[doc = "" ] |
850 | #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `SvgImageElement`*" ] |
851 | pub fn create_pattern_with_svg_image_element( |
852 | this: &CanvasRenderingContext2d, |
853 | image: &SvgImageElement, |
854 | repetition: &str, |
855 | ) -> Result<Option<CanvasPattern>, JsValue>; |
856 | #[cfg (all(feature = "CanvasPattern" , feature = "HtmlCanvasElement" ,))] |
857 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] |
858 | #[doc = "The `createPattern()` method." ] |
859 | #[doc = "" ] |
860 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)" ] |
861 | #[doc = "" ] |
862 | #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `HtmlCanvasElement`*" ] |
863 | pub fn create_pattern_with_html_canvas_element( |
864 | this: &CanvasRenderingContext2d, |
865 | image: &HtmlCanvasElement, |
866 | repetition: &str, |
867 | ) -> Result<Option<CanvasPattern>, JsValue>; |
868 | #[cfg (all(feature = "CanvasPattern" , feature = "HtmlVideoElement" ,))] |
869 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] |
870 | #[doc = "The `createPattern()` method." ] |
871 | #[doc = "" ] |
872 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)" ] |
873 | #[doc = "" ] |
874 | #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `HtmlVideoElement`*" ] |
875 | pub fn create_pattern_with_html_video_element( |
876 | this: &CanvasRenderingContext2d, |
877 | image: &HtmlVideoElement, |
878 | repetition: &str, |
879 | ) -> Result<Option<CanvasPattern>, JsValue>; |
880 | #[cfg (all(feature = "CanvasPattern" , feature = "ImageBitmap" ,))] |
881 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] |
882 | #[doc = "The `createPattern()` method." ] |
883 | #[doc = "" ] |
884 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)" ] |
885 | #[doc = "" ] |
886 | #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `ImageBitmap`*" ] |
887 | pub fn create_pattern_with_image_bitmap( |
888 | this: &CanvasRenderingContext2d, |
889 | image: &ImageBitmap, |
890 | repetition: &str, |
891 | ) -> Result<Option<CanvasPattern>, JsValue>; |
892 | #[cfg (all(feature = "CanvasPattern" , feature = "OffscreenCanvas" ,))] |
893 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] |
894 | #[doc = "The `createPattern()` method." ] |
895 | #[doc = "" ] |
896 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)" ] |
897 | #[doc = "" ] |
898 | #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `OffscreenCanvas`*" ] |
899 | pub fn create_pattern_with_offscreen_canvas( |
900 | this: &CanvasRenderingContext2d, |
901 | image: &OffscreenCanvas, |
902 | repetition: &str, |
903 | ) -> Result<Option<CanvasPattern>, JsValue>; |
904 | #[cfg (web_sys_unstable_apis)] |
905 | #[cfg (all(feature = "CanvasPattern" , feature = "VideoFrame" ,))] |
906 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createPattern)] |
907 | #[doc = "The `createPattern()` method." ] |
908 | #[doc = "" ] |
909 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createPattern)" ] |
910 | #[doc = "" ] |
911 | #[doc = "*This API requires the following crate features to be activated: `CanvasPattern`, `CanvasRenderingContext2d`, `VideoFrame`*" ] |
912 | #[doc = "" ] |
913 | #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as" ] |
914 | #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*" ] |
915 | pub fn create_pattern_with_video_frame( |
916 | this: &CanvasRenderingContext2d, |
917 | image: &VideoFrame, |
918 | repetition: &str, |
919 | ) -> Result<Option<CanvasPattern>, JsValue>; |
920 | #[cfg (feature = "CanvasGradient" )] |
921 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createRadialGradient)] |
922 | #[doc = "The `createRadialGradient()` method." ] |
923 | #[doc = "" ] |
924 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createRadialGradient)" ] |
925 | #[doc = "" ] |
926 | #[doc = "*This API requires the following crate features to be activated: `CanvasGradient`, `CanvasRenderingContext2d`*" ] |
927 | pub fn create_radial_gradient( |
928 | this: &CanvasRenderingContext2d, |
929 | x0: f64, |
930 | y0: f64, |
931 | r0: f64, |
932 | x1: f64, |
933 | y1: f64, |
934 | r1: f64, |
935 | ) -> Result<CanvasGradient, JsValue>; |
936 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = addHitRegion)] |
937 | #[doc = "The `addHitRegion()` method." ] |
938 | #[doc = "" ] |
939 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/addHitRegion)" ] |
940 | #[doc = "" ] |
941 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
942 | pub fn add_hit_region(this: &CanvasRenderingContext2d) -> Result<(), JsValue>; |
943 | #[cfg (feature = "HitRegionOptions" )] |
944 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = addHitRegion)] |
945 | #[doc = "The `addHitRegion()` method." ] |
946 | #[doc = "" ] |
947 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/addHitRegion)" ] |
948 | #[doc = "" ] |
949 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `HitRegionOptions`*" ] |
950 | pub fn add_hit_region_with_options( |
951 | this: &CanvasRenderingContext2d, |
952 | options: &HitRegionOptions, |
953 | ) -> Result<(), JsValue>; |
954 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = clearHitRegions)] |
955 | #[doc = "The `clearHitRegions()` method." ] |
956 | #[doc = "" ] |
957 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearHitRegions)" ] |
958 | #[doc = "" ] |
959 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
960 | pub fn clear_hit_regions(this: &CanvasRenderingContext2d); |
961 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = removeHitRegion)] |
962 | #[doc = "The `removeHitRegion()` method." ] |
963 | #[doc = "" ] |
964 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/removeHitRegion)" ] |
965 | #[doc = "" ] |
966 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
967 | pub fn remove_hit_region(this: &CanvasRenderingContext2d, id: &str); |
968 | #[cfg (feature = "ImageData" )] |
969 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createImageData)] |
970 | #[doc = "The `createImageData()` method." ] |
971 | #[doc = "" ] |
972 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData)" ] |
973 | #[doc = "" ] |
974 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageData`*" ] |
975 | pub fn create_image_data_with_sw_and_sh( |
976 | this: &CanvasRenderingContext2d, |
977 | sw: f64, |
978 | sh: f64, |
979 | ) -> Result<ImageData, JsValue>; |
980 | #[cfg (feature = "ImageData" )] |
981 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = createImageData)] |
982 | #[doc = "The `createImageData()` method." ] |
983 | #[doc = "" ] |
984 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createImageData)" ] |
985 | #[doc = "" ] |
986 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageData`*" ] |
987 | pub fn create_image_data_with_imagedata( |
988 | this: &CanvasRenderingContext2d, |
989 | imagedata: &ImageData, |
990 | ) -> Result<ImageData, JsValue>; |
991 | #[cfg (feature = "ImageData" )] |
992 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = getImageData)] |
993 | #[doc = "The `getImageData()` method." ] |
994 | #[doc = "" ] |
995 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getImageData)" ] |
996 | #[doc = "" ] |
997 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageData`*" ] |
998 | pub fn get_image_data( |
999 | this: &CanvasRenderingContext2d, |
1000 | sx: f64, |
1001 | sy: f64, |
1002 | sw: f64, |
1003 | sh: f64, |
1004 | ) -> Result<ImageData, JsValue>; |
1005 | #[cfg (feature = "ImageData" )] |
1006 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = putImageData)] |
1007 | #[doc = "The `putImageData()` method." ] |
1008 | #[doc = "" ] |
1009 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/putImageData)" ] |
1010 | #[doc = "" ] |
1011 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageData`*" ] |
1012 | pub fn put_image_data( |
1013 | this: &CanvasRenderingContext2d, |
1014 | imagedata: &ImageData, |
1015 | dx: f64, |
1016 | dy: f64, |
1017 | ) -> Result<(), JsValue>; |
1018 | #[cfg (feature = "ImageData" )] |
1019 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = putImageData)] |
1020 | #[doc = "The `putImageData()` method." ] |
1021 | #[doc = "" ] |
1022 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/putImageData)" ] |
1023 | #[doc = "" ] |
1024 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `ImageData`*" ] |
1025 | pub fn put_image_data_with_dirty_x_and_dirty_y_and_dirty_width_and_dirty_height( |
1026 | this: &CanvasRenderingContext2d, |
1027 | imagedata: &ImageData, |
1028 | dx: f64, |
1029 | dy: f64, |
1030 | dirty_x: f64, |
1031 | dirty_y: f64, |
1032 | dirty_width: f64, |
1033 | dirty_height: f64, |
1034 | ) -> Result<(), JsValue>; |
1035 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = arc)] |
1036 | #[doc = "The `arc()` method." ] |
1037 | #[doc = "" ] |
1038 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arc)" ] |
1039 | #[doc = "" ] |
1040 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1041 | pub fn arc( |
1042 | this: &CanvasRenderingContext2d, |
1043 | x: f64, |
1044 | y: f64, |
1045 | radius: f64, |
1046 | start_angle: f64, |
1047 | end_angle: f64, |
1048 | ) -> Result<(), JsValue>; |
1049 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = arc)] |
1050 | #[doc = "The `arc()` method." ] |
1051 | #[doc = "" ] |
1052 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arc)" ] |
1053 | #[doc = "" ] |
1054 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1055 | pub fn arc_with_anticlockwise( |
1056 | this: &CanvasRenderingContext2d, |
1057 | x: f64, |
1058 | y: f64, |
1059 | radius: f64, |
1060 | start_angle: f64, |
1061 | end_angle: f64, |
1062 | anticlockwise: bool, |
1063 | ) -> Result<(), JsValue>; |
1064 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = arcTo)] |
1065 | #[doc = "The `arcTo()` method." ] |
1066 | #[doc = "" ] |
1067 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/arcTo)" ] |
1068 | #[doc = "" ] |
1069 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1070 | pub fn arc_to( |
1071 | this: &CanvasRenderingContext2d, |
1072 | x1: f64, |
1073 | y1: f64, |
1074 | x2: f64, |
1075 | y2: f64, |
1076 | radius: f64, |
1077 | ) -> Result<(), JsValue>; |
1078 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = bezierCurveTo)] |
1079 | #[doc = "The `bezierCurveTo()` method." ] |
1080 | #[doc = "" ] |
1081 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo)" ] |
1082 | #[doc = "" ] |
1083 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1084 | pub fn bezier_curve_to( |
1085 | this: &CanvasRenderingContext2d, |
1086 | cp1x: f64, |
1087 | cp1y: f64, |
1088 | cp2x: f64, |
1089 | cp2y: f64, |
1090 | x: f64, |
1091 | y: f64, |
1092 | ); |
1093 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = closePath)] |
1094 | #[doc = "The `closePath()` method." ] |
1095 | #[doc = "" ] |
1096 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/closePath)" ] |
1097 | #[doc = "" ] |
1098 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1099 | pub fn close_path(this: &CanvasRenderingContext2d); |
1100 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = ellipse)] |
1101 | #[doc = "The `ellipse()` method." ] |
1102 | #[doc = "" ] |
1103 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/ellipse)" ] |
1104 | #[doc = "" ] |
1105 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1106 | pub fn ellipse( |
1107 | this: &CanvasRenderingContext2d, |
1108 | x: f64, |
1109 | y: f64, |
1110 | radius_x: f64, |
1111 | radius_y: f64, |
1112 | rotation: f64, |
1113 | start_angle: f64, |
1114 | end_angle: f64, |
1115 | ) -> Result<(), JsValue>; |
1116 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = ellipse)] |
1117 | #[doc = "The `ellipse()` method." ] |
1118 | #[doc = "" ] |
1119 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/ellipse)" ] |
1120 | #[doc = "" ] |
1121 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1122 | pub fn ellipse_with_anticlockwise( |
1123 | this: &CanvasRenderingContext2d, |
1124 | x: f64, |
1125 | y: f64, |
1126 | radius_x: f64, |
1127 | radius_y: f64, |
1128 | rotation: f64, |
1129 | start_angle: f64, |
1130 | end_angle: f64, |
1131 | anticlockwise: bool, |
1132 | ) -> Result<(), JsValue>; |
1133 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = lineTo)] |
1134 | #[doc = "The `lineTo()` method." ] |
1135 | #[doc = "" ] |
1136 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineTo)" ] |
1137 | #[doc = "" ] |
1138 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1139 | pub fn line_to(this: &CanvasRenderingContext2d, x: f64, y: f64); |
1140 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = moveTo)] |
1141 | #[doc = "The `moveTo()` method." ] |
1142 | #[doc = "" ] |
1143 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/moveTo)" ] |
1144 | #[doc = "" ] |
1145 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1146 | pub fn move_to(this: &CanvasRenderingContext2d, x: f64, y: f64); |
1147 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = quadraticCurveTo)] |
1148 | #[doc = "The `quadraticCurveTo()` method." ] |
1149 | #[doc = "" ] |
1150 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo)" ] |
1151 | #[doc = "" ] |
1152 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1153 | pub fn quadratic_curve_to(this: &CanvasRenderingContext2d, cpx: f64, cpy: f64, x: f64, y: f64); |
1154 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = rect)] |
1155 | #[doc = "The `rect()` method." ] |
1156 | #[doc = "" ] |
1157 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/rect)" ] |
1158 | #[doc = "" ] |
1159 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1160 | pub fn rect(this: &CanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); |
1161 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] |
1162 | #[doc = "The `roundRect()` method." ] |
1163 | #[doc = "" ] |
1164 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)" ] |
1165 | #[doc = "" ] |
1166 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1167 | pub fn round_rect( |
1168 | this: &CanvasRenderingContext2d, |
1169 | x: f64, |
1170 | y: f64, |
1171 | w: f64, |
1172 | h: f64, |
1173 | ) -> Result<(), JsValue>; |
1174 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] |
1175 | #[doc = "The `roundRect()` method." ] |
1176 | #[doc = "" ] |
1177 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)" ] |
1178 | #[doc = "" ] |
1179 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1180 | pub fn round_rect_with_f64( |
1181 | this: &CanvasRenderingContext2d, |
1182 | x: f64, |
1183 | y: f64, |
1184 | w: f64, |
1185 | h: f64, |
1186 | radii: f64, |
1187 | ) -> Result<(), JsValue>; |
1188 | #[cfg (feature = "DomPointInit" )] |
1189 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] |
1190 | #[doc = "The `roundRect()` method." ] |
1191 | #[doc = "" ] |
1192 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)" ] |
1193 | #[doc = "" ] |
1194 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `DomPointInit`*" ] |
1195 | pub fn round_rect_with_dom_point_init( |
1196 | this: &CanvasRenderingContext2d, |
1197 | x: f64, |
1198 | y: f64, |
1199 | w: f64, |
1200 | h: f64, |
1201 | radii: &DomPointInit, |
1202 | ) -> Result<(), JsValue>; |
1203 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] |
1204 | #[doc = "The `roundRect()` method." ] |
1205 | #[doc = "" ] |
1206 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)" ] |
1207 | #[doc = "" ] |
1208 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1209 | pub fn round_rect_with_f64_sequence( |
1210 | this: &CanvasRenderingContext2d, |
1211 | x: f64, |
1212 | y: f64, |
1213 | w: f64, |
1214 | h: f64, |
1215 | radii: &::wasm_bindgen::JsValue, |
1216 | ) -> Result<(), JsValue>; |
1217 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = roundRect)] |
1218 | #[doc = "The `roundRect()` method." ] |
1219 | #[doc = "" ] |
1220 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect)" ] |
1221 | #[doc = "" ] |
1222 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1223 | pub fn round_rect_with_dom_point_init_sequence( |
1224 | this: &CanvasRenderingContext2d, |
1225 | x: f64, |
1226 | y: f64, |
1227 | w: f64, |
1228 | h: f64, |
1229 | radii: &::wasm_bindgen::JsValue, |
1230 | ) -> Result<(), JsValue>; |
1231 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = getLineDash)] |
1232 | #[doc = "The `getLineDash()` method." ] |
1233 | #[doc = "" ] |
1234 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getLineDash)" ] |
1235 | #[doc = "" ] |
1236 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1237 | pub fn get_line_dash(this: &CanvasRenderingContext2d) -> ::js_sys::Array; |
1238 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setLineDash)] |
1239 | #[doc = "The `setLineDash()` method." ] |
1240 | #[doc = "" ] |
1241 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash)" ] |
1242 | #[doc = "" ] |
1243 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1244 | pub fn set_line_dash( |
1245 | this: &CanvasRenderingContext2d, |
1246 | segments: &::wasm_bindgen::JsValue, |
1247 | ) -> Result<(), JsValue>; |
1248 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = clearRect)] |
1249 | #[doc = "The `clearRect()` method." ] |
1250 | #[doc = "" ] |
1251 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect)" ] |
1252 | #[doc = "" ] |
1253 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1254 | pub fn clear_rect(this: &CanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); |
1255 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = fillRect)] |
1256 | #[doc = "The `fillRect()` method." ] |
1257 | #[doc = "" ] |
1258 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillRect)" ] |
1259 | #[doc = "" ] |
1260 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1261 | pub fn fill_rect(this: &CanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); |
1262 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = strokeRect)] |
1263 | #[doc = "The `strokeRect()` method." ] |
1264 | #[doc = "" ] |
1265 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeRect)" ] |
1266 | #[doc = "" ] |
1267 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1268 | pub fn stroke_rect(this: &CanvasRenderingContext2d, x: f64, y: f64, w: f64, h: f64); |
1269 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = reset)] |
1270 | #[doc = "The `reset()` method." ] |
1271 | #[doc = "" ] |
1272 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/reset)" ] |
1273 | #[doc = "" ] |
1274 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1275 | pub fn reset(this: &CanvasRenderingContext2d); |
1276 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = restore)] |
1277 | #[doc = "The `restore()` method." ] |
1278 | #[doc = "" ] |
1279 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/restore)" ] |
1280 | #[doc = "" ] |
1281 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1282 | pub fn restore(this: &CanvasRenderingContext2d); |
1283 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = save)] |
1284 | #[doc = "The `save()` method." ] |
1285 | #[doc = "" ] |
1286 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/save)" ] |
1287 | #[doc = "" ] |
1288 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1289 | pub fn save(this: &CanvasRenderingContext2d); |
1290 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = fillText)] |
1291 | #[doc = "The `fillText()` method." ] |
1292 | #[doc = "" ] |
1293 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillText)" ] |
1294 | #[doc = "" ] |
1295 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1296 | pub fn fill_text( |
1297 | this: &CanvasRenderingContext2d, |
1298 | text: &str, |
1299 | x: f64, |
1300 | y: f64, |
1301 | ) -> Result<(), JsValue>; |
1302 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = fillText)] |
1303 | #[doc = "The `fillText()` method." ] |
1304 | #[doc = "" ] |
1305 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillText)" ] |
1306 | #[doc = "" ] |
1307 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1308 | pub fn fill_text_with_max_width( |
1309 | this: &CanvasRenderingContext2d, |
1310 | text: &str, |
1311 | x: f64, |
1312 | y: f64, |
1313 | max_width: f64, |
1314 | ) -> Result<(), JsValue>; |
1315 | #[cfg (feature = "TextMetrics" )] |
1316 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = measureText)] |
1317 | #[doc = "The `measureText()` method." ] |
1318 | #[doc = "" ] |
1319 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/measureText)" ] |
1320 | #[doc = "" ] |
1321 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `TextMetrics`*" ] |
1322 | pub fn measure_text( |
1323 | this: &CanvasRenderingContext2d, |
1324 | text: &str, |
1325 | ) -> Result<TextMetrics, JsValue>; |
1326 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = strokeText)] |
1327 | #[doc = "The `strokeText()` method." ] |
1328 | #[doc = "" ] |
1329 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeText)" ] |
1330 | #[doc = "" ] |
1331 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1332 | pub fn stroke_text( |
1333 | this: &CanvasRenderingContext2d, |
1334 | text: &str, |
1335 | x: f64, |
1336 | y: f64, |
1337 | ) -> Result<(), JsValue>; |
1338 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = strokeText)] |
1339 | #[doc = "The `strokeText()` method." ] |
1340 | #[doc = "" ] |
1341 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeText)" ] |
1342 | #[doc = "" ] |
1343 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1344 | pub fn stroke_text_with_max_width( |
1345 | this: &CanvasRenderingContext2d, |
1346 | text: &str, |
1347 | x: f64, |
1348 | y: f64, |
1349 | max_width: f64, |
1350 | ) -> Result<(), JsValue>; |
1351 | #[cfg (feature = "DomMatrix" )] |
1352 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = getTransform)] |
1353 | #[doc = "The `getTransform()` method." ] |
1354 | #[doc = "" ] |
1355 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/getTransform)" ] |
1356 | #[doc = "" ] |
1357 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `DomMatrix`*" ] |
1358 | pub fn get_transform(this: &CanvasRenderingContext2d) -> Result<DomMatrix, JsValue>; |
1359 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = resetTransform)] |
1360 | #[doc = "The `resetTransform()` method." ] |
1361 | #[doc = "" ] |
1362 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/resetTransform)" ] |
1363 | #[doc = "" ] |
1364 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1365 | pub fn reset_transform(this: &CanvasRenderingContext2d) -> Result<(), JsValue>; |
1366 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = rotate)] |
1367 | #[doc = "The `rotate()` method." ] |
1368 | #[doc = "" ] |
1369 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/rotate)" ] |
1370 | #[doc = "" ] |
1371 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1372 | pub fn rotate(this: &CanvasRenderingContext2d, angle: f64) -> Result<(), JsValue>; |
1373 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = scale)] |
1374 | #[doc = "The `scale()` method." ] |
1375 | #[doc = "" ] |
1376 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/scale)" ] |
1377 | #[doc = "" ] |
1378 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1379 | pub fn scale(this: &CanvasRenderingContext2d, x: f64, y: f64) -> Result<(), JsValue>; |
1380 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setTransform)] |
1381 | #[doc = "The `setTransform()` method." ] |
1382 | #[doc = "" ] |
1383 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform)" ] |
1384 | #[doc = "" ] |
1385 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1386 | pub fn set_transform( |
1387 | this: &CanvasRenderingContext2d, |
1388 | a: f64, |
1389 | b: f64, |
1390 | c: f64, |
1391 | d: f64, |
1392 | e: f64, |
1393 | f: f64, |
1394 | ) -> Result<(), JsValue>; |
1395 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setTransform)] |
1396 | #[doc = "The `setTransform()` method." ] |
1397 | #[doc = "" ] |
1398 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform)" ] |
1399 | #[doc = "" ] |
1400 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1401 | pub fn set_transform_with_default_dom_matrix_2d_init( |
1402 | this: &CanvasRenderingContext2d, |
1403 | ) -> Result<(), JsValue>; |
1404 | #[cfg (feature = "DomMatrix2dInit" )] |
1405 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = setTransform)] |
1406 | #[doc = "The `setTransform()` method." ] |
1407 | #[doc = "" ] |
1408 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform)" ] |
1409 | #[doc = "" ] |
1410 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `DomMatrix2dInit`*" ] |
1411 | pub fn set_transform_with_dom_matrix_2d_init( |
1412 | this: &CanvasRenderingContext2d, |
1413 | transform: &DomMatrix2dInit, |
1414 | ) -> Result<(), JsValue>; |
1415 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = transform)] |
1416 | #[doc = "The `transform()` method." ] |
1417 | #[doc = "" ] |
1418 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/transform)" ] |
1419 | #[doc = "" ] |
1420 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1421 | pub fn transform( |
1422 | this: &CanvasRenderingContext2d, |
1423 | a: f64, |
1424 | b: f64, |
1425 | c: f64, |
1426 | d: f64, |
1427 | e: f64, |
1428 | f: f64, |
1429 | ) -> Result<(), JsValue>; |
1430 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = translate)] |
1431 | #[doc = "The `translate()` method." ] |
1432 | #[doc = "" ] |
1433 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/translate)" ] |
1434 | #[doc = "" ] |
1435 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1436 | pub fn translate(this: &CanvasRenderingContext2d, x: f64, y: f64) -> Result<(), JsValue>; |
1437 | #[cfg (feature = "Element" )] |
1438 | # [wasm_bindgen (method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawCustomFocusRing)] |
1439 | #[doc = "The `drawCustomFocusRing()` method." ] |
1440 | #[doc = "" ] |
1441 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawCustomFocusRing)" ] |
1442 | #[doc = "" ] |
1443 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Element`*" ] |
1444 | pub fn draw_custom_focus_ring(this: &CanvasRenderingContext2d, element: &Element) -> bool; |
1445 | #[cfg (feature = "Element" )] |
1446 | # [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = drawFocusIfNeeded)] |
1447 | #[doc = "The `drawFocusIfNeeded()` method." ] |
1448 | #[doc = "" ] |
1449 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawFocusIfNeeded)" ] |
1450 | #[doc = "" ] |
1451 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`, `Element`*" ] |
1452 | pub fn draw_focus_if_needed( |
1453 | this: &CanvasRenderingContext2d, |
1454 | element: &Element, |
1455 | ) -> Result<(), JsValue>; |
1456 | } |
1457 | impl CanvasRenderingContext2d { |
1458 | #[doc = "The `CanvasRenderingContext2D.DRAWWINDOW_DRAW_CARET` const." ] |
1459 | #[doc = "" ] |
1460 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1461 | pub const DRAWWINDOW_DRAW_CARET: u32 = 1u64 as u32; |
1462 | #[doc = "The `CanvasRenderingContext2D.DRAWWINDOW_DO_NOT_FLUSH` const." ] |
1463 | #[doc = "" ] |
1464 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1465 | pub const DRAWWINDOW_DO_NOT_FLUSH: u32 = 2u64 as u32; |
1466 | #[doc = "The `CanvasRenderingContext2D.DRAWWINDOW_DRAW_VIEW` const." ] |
1467 | #[doc = "" ] |
1468 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1469 | pub const DRAWWINDOW_DRAW_VIEW: u32 = 4u64 as u32; |
1470 | #[doc = "The `CanvasRenderingContext2D.DRAWWINDOW_USE_WIDGET_LAYERS` const." ] |
1471 | #[doc = "" ] |
1472 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1473 | pub const DRAWWINDOW_USE_WIDGET_LAYERS: u32 = 8u64 as u32; |
1474 | #[doc = "The `CanvasRenderingContext2D.DRAWWINDOW_ASYNC_DECODE_IMAGES` const." ] |
1475 | #[doc = "" ] |
1476 | #[doc = "*This API requires the following crate features to be activated: `CanvasRenderingContext2d`*" ] |
1477 | pub const DRAWWINDOW_ASYNC_DECODE_IMAGES: u32 = 16u64 as u32; |
1478 | } |
1479 | |