web_sys/features/
gen_ImageData.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "::js_sys::Object",
9 js_name = "ImageData",
10 typescript_type = "ImageData"
11 )]
12 #[derive(Debug, Clone, PartialEq, Eq)]
13 #[doc = "The `ImageData` class."]
14 #[doc = ""]
15 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData)"]
16 #[doc = ""]
17 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
18 pub type ImageData;
19 #[wasm_bindgen(method, getter, js_class = "ImageData", js_name = "width")]
20 #[doc = "Getter for the `width` field of this object."]
21 #[doc = ""]
22 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/width)"]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
25 pub fn width(this: &ImageData) -> u32;
26 #[wasm_bindgen(method, getter, js_class = "ImageData", js_name = "height")]
27 #[doc = "Getter for the `height` field of this object."]
28 #[doc = ""]
29 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/height)"]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
32 pub fn height(this: &ImageData) -> u32;
33 #[wasm_bindgen(method, getter, js_class = "ImageData", js_name = "data")]
34 #[doc = "Getter for the `data` field of this object."]
35 #[doc = ""]
36 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/data)"]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
39 pub fn data(this: &ImageData) -> ::wasm_bindgen::Clamped<::alloc::vec::Vec<u8>>;
40 #[wasm_bindgen(catch, constructor, js_class = "ImageData")]
41 #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
46 pub fn new_with_sw(sw: u32, sh: u32) -> Result<ImageData, JsValue>;
47 #[wasm_bindgen(catch, constructor, js_class = "ImageData")]
48 #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
53 pub fn new_with_u8_clamped_array(
54 data: ::wasm_bindgen::Clamped<&[u8]>,
55 sw: u32,
56 ) -> Result<ImageData, JsValue>;
57 #[wasm_bindgen(catch, constructor, js_class = "ImageData")]
58 #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."]
59 #[doc = ""]
60 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
63 pub fn new_with_js_u8_clamped_array(
64 data: &::js_sys::Uint8ClampedArray,
65 sw: u32,
66 ) -> Result<ImageData, JsValue>;
67 #[wasm_bindgen(catch, constructor, js_class = "ImageData")]
68 #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."]
69 #[doc = ""]
70 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
73 pub fn new_with_u8_clamped_array_and_sh(
74 data: ::wasm_bindgen::Clamped<&[u8]>,
75 sw: u32,
76 sh: u32,
77 ) -> Result<ImageData, JsValue>;
78 #[wasm_bindgen(catch, constructor, js_class = "ImageData")]
79 #[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."]
80 #[doc = ""]
81 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData)"]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
84 pub fn new_with_js_u8_clamped_array_and_sh(
85 data: &::js_sys::Uint8ClampedArray,
86 sw: u32,
87 sh: u32,
88 ) -> Result<ImageData, JsValue>;
89}