#[non_exhaustive]#[repr(u32)]pub enum PixelFormat {
Show 21 variants
Mono8 = 17_301_505,
Mono10 = 17_825_795,
Mono12 = 17_825_797,
Mono14 = 17_825_829,
Mono16 = 17_825_799,
Confidence8 = 17_301_702,
Coord3DC32f = 18_874_559,
Coord3DAC16 = 35_651_771,
Coord3DAC32f = 37_748_930,
Coord3DABC32f = 39_846_080,
BayerRG8 = 17_301_513,
BayerGB8 = 17_301_514,
BayerBG8 = 17_301_515,
BayerGR8 = 17_301_512,
BayerGR16 = 17_825_806,
BayerRG16 = 17_825_807,
BayerGB16 = 17_825_808,
BayerBG16 = 17_825_809,
RGB8Packed = 35_127_316,
BGR8Packed = 35_127_317,
Unknown(u32),
}Expand description
Enumeration of the pixel formats supported by the helper routines.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Mono8 = 17_301_505
Mono10 = 17_825_795
Mono12 = 17_825_797
Mono14 = 17_825_829
Mono16 = 17_825_799
Confidence8 = 17_301_702
Coord3DC32f = 18_874_559
Coord3DAC16 = 35_651_771
Coord3DAC32f = 37_748_930
Coord3DABC32f = 39_846_080
BayerRG8 = 17_301_513
BayerGB8 = 17_301_514
BayerBG8 = 17_301_515
BayerGR8 = 17_301_512
BayerGR16 = 17_825_806
BayerRG16 = 17_825_807
BayerGB16 = 17_825_808
BayerBG16 = 17_825_809
RGB8Packed = 35_127_316
BGR8Packed = 35_127_317
Unknown(u32)
Unknown PFNC code reported by the device.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub const fn from_code(code: u32) -> PixelFormat
pub const fn from_code(code: u32) -> PixelFormat
Convert a raw PFNC code into a PixelFormat enumeration.
Sourcepub const fn bytes_per_pixel(self) -> Option<usize>
pub const fn bytes_per_pixel(self) -> Option<usize>
Number of bytes used to encode a single pixel.
For a format this enumeration does not name, the answer is derived from
bits 23-16 of the PFNC code, which carry the pixel’s bit depth. None
means the pixel genuinely has no whole-byte size — a packed format — not
that we failed to look it up.
Sourcepub fn from_name(name: &str) -> PixelFormat
pub fn from_name(name: &str) -> PixelFormat
Convert a PFNC name string to a PixelFormat.
Returns PixelFormat::Unknown(0) for unrecognised names.
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PixelFormat
impl Debug for PixelFormat
Source§impl<'de> Deserialize<'de> for PixelFormat
impl<'de> Deserialize<'de> for PixelFormat
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
Source§impl Display for PixelFormat
impl Display for PixelFormat
Source§impl Hash for PixelFormat
impl Hash for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
Source§fn eq(&self, other: &PixelFormat) -> bool
fn eq(&self, other: &PixelFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PixelFormat
impl Serialize for PixelFormat
impl Copy for PixelFormat
impl Eq for PixelFormat
impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl Freeze for PixelFormat
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnsafeUnpin for PixelFormat
impl UnwindSafe for PixelFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more