Debian Codegraph @

src/formats/gray_a.rs

raw symbols SCIP
1 #[repr(C)]
2 #[cfg_attr(feature = "serde", derive(serderust-analyzer cargo serde 1.0.225 crate/::Serializerust-analyzer cargo serde_derive 1.0.225 Serialize:, serderust-analyzer cargo serde 1.0.225 crate/::Deserializerust-analyzer cargo serde_derive 1.0.225 Deserialize:))]
3 #[cfg_attr(feature = "defmt-03", derive(defmtrust-analyzer cargo defmt 0.3.100 crate/::Formatrust-analyzer cargo defmt-macros 1.0.1 Format:))]
4 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)]
5 /// A `Value (brightness) + Alpha` pixel (rgb crate v0.9)
6 ///
7 /// This pixel is commonly used for grayscale images.
8 pub struct GrayArust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#<T, A = T> {
9 /// Value - the brightness component. May be luma or luminance.
10 pub vrust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#v.: T,
11 /// Alpha Component
12 pub arust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#a.: A,
13 }
14
15 impl<T: Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy#> GrayArust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#<T> {
16 /// Reads the `.v` field
17 ///
18 /// This function isn't necessary, but it is forwards-compatible with the next major version of the RGB crate.
19 pub fn valuerust-analyzer cargo rgb 0.8.53 formats/gray_a/impl#[`GrayA<T>`]value().(self) -> T {
20 self.vrust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#v.
21 }
22
23 /// Exposes the `.v` field for writing
24 ///
25 /// This function isn't necessary, but it is forwards-compatible with the next major version of the RGB crate.
26 pub fn value_mutrust-analyzer cargo rgb 0.8.53 formats/gray_a/impl#[`GrayA<T>`]value_mut().(&mut self) -> &mut T {
27 &mut self.vrust-analyzer cargo rgb 0.8.53 formats/gray_a/GrayA#v.
28 }
29 }