Struct adder_codec_core::Coord
source · #[repr(packed)]pub struct Coord {
pub x: PixelAddress,
pub y: PixelAddress,
pub c: Option<u8>,
}
Expand description
Pixel channel address in the ADΔER model
Fields§
§x: PixelAddress
Pixel x-coordinate
y: PixelAddress
Pixel y-coordinate
c: Option<u8>
Pixel channel, if present
Implementations§
source§impl Coord
impl Coord
sourcepub fn new(x: PixelAddress, y: PixelAddress, c: Option<u8>) -> Self
pub fn new(x: PixelAddress, y: PixelAddress, c: Option<u8>) -> Self
Creates a new coordinate with the given x, y, and channel
sourcepub fn new_2d(x: PixelAddress, y: PixelAddress) -> Self
pub fn new_2d(x: PixelAddress, y: PixelAddress) -> Self
Creates a new 2D coordinate
sourcepub fn new_3d(x: PixelAddress, y: PixelAddress, c: u8) -> Self
pub fn new_3d(x: PixelAddress, y: PixelAddress, c: u8) -> Self
Creates a new 3D coordinate with the given channel
sourcepub fn x(&self) -> PixelAddress
pub fn x(&self) -> PixelAddress
Returns the x coordinate as a PixelAddress
sourcepub fn y(&self) -> PixelAddress
pub fn y(&self) -> PixelAddress
Returns the y coordinate as a PixelAddress
Trait Implementations§
source§impl<'de> Deserialize<'de> for Coord
impl<'de> Deserialize<'de> for Coord
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more