web_sys/features/
gen_ImageDecoderInit.rs#![allow(unused_imports)]
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ImageDecoderInit)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `ImageDecoderInit` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type ImageDecoderInit;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "ColorSpaceConversion")]
#[doc = "Get the `colorSpaceConversion` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, getter = "colorSpaceConversion")]
pub fn get_color_space_conversion(this: &ImageDecoderInit) -> Option<ColorSpaceConversion>;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "ColorSpaceConversion")]
#[doc = "Change the `colorSpaceConversion` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ColorSpaceConversion`, `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, setter = "colorSpaceConversion")]
pub fn set_color_space_conversion(this: &ImageDecoderInit, val: ColorSpaceConversion);
#[cfg(web_sys_unstable_apis)]
#[doc = "Get the `data` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, getter = "data")]
pub fn get_data(this: &ImageDecoderInit) -> ::wasm_bindgen::JsValue;
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `data` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, setter = "data")]
pub fn set_data(this: &ImageDecoderInit, val: &::wasm_bindgen::JsValue);
#[cfg(web_sys_unstable_apis)]
#[doc = "Get the `desiredHeight` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, getter = "desiredHeight")]
pub fn get_desired_height(this: &ImageDecoderInit) -> Option<u32>;
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `desiredHeight` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, setter = "desiredHeight")]
pub fn set_desired_height(this: &ImageDecoderInit, val: u32);
#[cfg(web_sys_unstable_apis)]
#[doc = "Get the `desiredWidth` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, getter = "desiredWidth")]
pub fn get_desired_width(this: &ImageDecoderInit) -> Option<u32>;
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `desiredWidth` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, setter = "desiredWidth")]
pub fn set_desired_width(this: &ImageDecoderInit, val: u32);
#[cfg(web_sys_unstable_apis)]
#[doc = "Get the `preferAnimation` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, getter = "preferAnimation")]
pub fn get_prefer_animation(this: &ImageDecoderInit) -> Option<bool>;
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `preferAnimation` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, setter = "preferAnimation")]
pub fn set_prefer_animation(this: &ImageDecoderInit, val: bool);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "PremultiplyAlpha")]
#[doc = "Get the `premultiplyAlpha` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, getter = "premultiplyAlpha")]
pub fn get_premultiply_alpha(this: &ImageDecoderInit) -> Option<PremultiplyAlpha>;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "PremultiplyAlpha")]
#[doc = "Change the `premultiplyAlpha` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`, `PremultiplyAlpha`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, setter = "premultiplyAlpha")]
pub fn set_premultiply_alpha(this: &ImageDecoderInit, val: PremultiplyAlpha);
#[cfg(web_sys_unstable_apis)]
#[doc = "Get the `type` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, getter = "type")]
pub fn get_type(this: &ImageDecoderInit) -> ::alloc::string::String;
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `type` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[wasm_bindgen(method, setter = "type")]
pub fn set_type(this: &ImageDecoderInit, val: &str);
}
#[cfg(web_sys_unstable_apis)]
impl ImageDecoderInit {
#[doc = "Construct a new `ImageDecoderInit`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ImageDecoderInit`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn new(data: &::wasm_bindgen::JsValue, type_: &str) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.set_data(data);
ret.set_type(type_);
ret
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "ColorSpaceConversion")]
#[deprecated = "Use `set_color_space_conversion()` instead."]
pub fn color_space_conversion(&mut self, val: ColorSpaceConversion) -> &mut Self {
self.set_color_space_conversion(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[deprecated = "Use `set_data()` instead."]
pub fn data(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
self.set_data(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[deprecated = "Use `set_desired_height()` instead."]
pub fn desired_height(&mut self, val: u32) -> &mut Self {
self.set_desired_height(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[deprecated = "Use `set_desired_width()` instead."]
pub fn desired_width(&mut self, val: u32) -> &mut Self {
self.set_desired_width(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[deprecated = "Use `set_prefer_animation()` instead."]
pub fn prefer_animation(&mut self, val: bool) -> &mut Self {
self.set_prefer_animation(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "PremultiplyAlpha")]
#[deprecated = "Use `set_premultiply_alpha()` instead."]
pub fn premultiply_alpha(&mut self, val: PremultiplyAlpha) -> &mut Self {
self.set_premultiply_alpha(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[deprecated = "Use `set_type()` instead."]
pub fn type_(&mut self, val: &str) -> &mut Self {
self.set_type(val);
self
}
}