| 1 | use craterust-analyzer cargo rgb 0.8.53 crate/::{Abgrrust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#, Argbrust-analyzer cargo rgb 0.8.53 formats/argb/Argb#, Bgrrust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#, Bgrarust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#, Grbrust-analyzer cargo rgb 0.8.53 formats/grb/Grb#, Rgbrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#, Rgbarust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#}; |
| 2 | use craterust-analyzer cargo rgb 0.8.53 crate/::formatsrust-analyzer cargo rgb 0.8.53 formats/::gray_arust-analyzer cargo rgb 0.8.53 formats/gray_a/::GrayArust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#; |
| 3 | use craterust-analyzer cargo rgb 0.8.53 crate/::formatsrust-analyzer cargo rgb 0.8.53 formats/::grayrust-analyzer cargo rgb 0.8.53 formats/gray/::Gray_v08rust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v08#; |
| 4 | #[cfg(feature = "unstable-experimental")] |
| 5 | use craterust-analyzer cargo rgb 0.8.53 crate/::formatsrust-analyzer cargo rgb 0.8.53 formats/::grayrust-analyzer cargo rgb 0.8.53 formats/gray/::Gray_v09rust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v09#; |
| 6 | use craterust-analyzer cargo rgb 0.8.53 crate/::formatsrust-analyzer cargo rgb 0.8.53 formats/::gray_alpharust-analyzer cargo rgb 0.8.53 formats/gray_alpha/::GrayAlpha_v08rust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#; |
| 7 | |
| 8 | macro_rules! inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls! { |
| 9 | ($name:ident, $new_fn:ident, [$($field:tt $var:ident),*]) => { |
| 10 | impl<T: Copy> $name<T> { |
| 11 | #[doc=concat!("Creates a new [`", stringify!($name), "`] pixel type from its components.")] |
| 12 | /// |
| 13 | /// Alternatively, you can use struct literal syntax to |
| 14 | /// create the new pixel type: |
| 15 | ///```not_rust |
| 16 | #[doc=concat!("use rgb::", stringify!($name), ";")] |
| 17 | /// |
| 18 | #[doc=concat!("let pixel = ", stringify!($name), " {", stringify!($($field: $var),*), "};")] |
| 19 | ///``` |
| 20 | #[allow(deprecated)] |
| 21 | pub const fn $new_fn($($var: T),*) -> Self { |
| 22 | Self {$($field: $var),*} |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Rgbrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#, newrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Rgb<T>`]new()., [rrust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#r. red, grust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#g. green, brust-analyzer cargo rgb 0.8.53 formats/rgb/Rgb#b. blue]); |
| 29 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Bgrrust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#, new_bgrrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Bgr<T>`]new_bgr()., [brust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#b. blue, grust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#g. green, rrust-analyzer cargo rgb 0.8.53 formats/bgr/Bgr#r. red]); |
| 30 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Grbrust-analyzer cargo rgb 0.8.53 formats/grb/Grb#, new_grbrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Grb<T>`]new_grb()., [grust-analyzer cargo rgb 0.8.53 formats/grb/Grb#g. green, rrust-analyzer cargo rgb 0.8.53 formats/grb/Grb#r. red, brust-analyzer cargo rgb 0.8.53 formats/grb/Grb#b. blue]); |
| 31 | |
| 32 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Gray_v08rust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v08#, newrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Gray_v08<T>`]new()., [0rust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v08#0. value]); |
| 33 | #[cfg(feature = "unstable-experimental")] |
| 34 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Gray_v09rust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v09#, newrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Gray_v09<T>`]new()., [vrust-analyzer cargo rgb 0.8.53 formats/gray/Gray_v09#v. value]); |
| 35 | |
| 36 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Rgbarust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#, newrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Rgba<T>`]new()., [rrust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#r. red, grust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#g. green, brust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#b. blue, arust-analyzer cargo rgb 0.8.53 formats/rgba/Rgba#a. alpha]); |
| 37 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Argbrust-analyzer cargo rgb 0.8.53 formats/argb/Argb#, new_argbrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Argb<T>`]new_argb()., [arust-analyzer cargo rgb 0.8.53 formats/argb/Argb#a. alpha, rrust-analyzer cargo rgb 0.8.53 formats/argb/Argb#r. red, grust-analyzer cargo rgb 0.8.53 formats/argb/Argb#g. green, brust-analyzer cargo rgb 0.8.53 formats/argb/Argb#b. blue]); |
| 38 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Bgrarust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#, new_bgrarust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Bgra<T>`]new_bgra()., [brust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#b. blue, grust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#g. green, rrust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#r. red, arust-analyzer cargo rgb 0.8.53 formats/bgra/Bgra#a. alpha]); |
| 39 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(Abgrrust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#, new_abgrrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`Abgr<T>`]new_abgr()., [arust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#a. alpha, brust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#b. blue, grust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#g. green, rrust-analyzer cargo rgb 0.8.53 formats/abgr/Abgr#r. red]); |
| 40 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(GrayArust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#, newrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`GrayA<T>`]new()., [vrust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#v. value, arust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#a. alpha]); |
| 41 | |
| 42 | inherent_implsrust-analyzer cargo rgb 0.8.53 inherent_impls/inherent_impls!!(GrayAlpha_v08rust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#, newrust-analyzer cargo rgb 0.8.53 inherent_impls/impl#[`GrayAlpha_v08<T>`]new()., [0rust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#0. value, 1rust-analyzer cargo rgb 0.8.53 formats/gray_alpha/GrayAlpha_v08#1. alpha]); |