Enum PixelKind

Source
pub enum PixelKind<'a> {
Show 13 variants Yuyv { y: &'a u8, u: &'a u8, v: &'a u8, }, Uyvy { y: &'a u8, u: &'a u8, v: &'a u8, }, Bgr8 { b: &'a u8, g: &'a u8, r: &'a u8, }, Bgra8 { b: &'a u8, g: &'a u8, r: &'a u8, a: &'a u8, }, Rgb8 { r: &'a u8, g: &'a u8, b: &'a u8, }, Rgba8 { r: &'a u8, g: &'a u8, b: &'a u8, a: &'a u8, }, Raw8 { val: &'a u8, }, Y8 { y: &'a u8, }, Y16 { y: &'a u16, }, Z16 { depth: &'a u16, }, Distance { distance: &'a f32, }, Disparity32 { disparity: &'a f32, }, Xyz32f { x: &'a f32, y: &'a f32, z: &'a f32, },
}
Expand description

Type for representing the various pixel formats.

Variants§

§

Yuyv

32-bit y0, u, y1, v data for every two pixels. Similar to YUV422 but packed in a different order - see this link.

Fields

§y: &'a u8

The Y / luma value for a given pixel

§u: &'a u8

The U-chroma value for a given pixel

§v: &'a u8

The V-chroma value for a given pixel

§

Uyvy

Similar to the standard YUYV pixel format, but packed in a different order.

Fields

§y: &'a u8

The Y / luma value for a given pixel

§u: &'a u8

The U-chroma value for a given pixel

§v: &'a u8

The V-chroma value for a given pixel

§

Bgr8

8-bit blue, green, and red channels – suitable for OpenCV.

Fields

§b: &'a u8

The blue component of the BGR pixel

§g: &'a u8

The green component of the BGR pixel

§r: &'a u8

The red component of the BGR pixel

§

Bgra8

8-bit blue, green, and red channels + constant alpha channel equal to FF.

Fields

§b: &'a u8

The blue component of the BGRA pixel

§g: &'a u8

The green component of the BGRA pixel

§r: &'a u8

The red component of the BGRA pixel

§a: &'a u8

The alpha component of the BGRA pixel

§

Rgb8

8-bit red, green and blue channels.

Fields

§r: &'a u8

The red component of the RGB pixel

§g: &'a u8

The green component of the RGB pixel

§b: &'a u8

The blue component of the RGB pixel

§

Rgba8

8-bit red, green and blue channels + constant alpha channel equal to FF.

Fields

§r: &'a u8

The red component of the RGBA pixel

§g: &'a u8

The green component of the RGBA pixel

§b: &'a u8

The blue component of the RGBA pixel

§a: &'a u8

The alpha component of the RGBA pixel

§

Raw8

8-bit raw image.

Fields

§val: &'a u8

The single luma value for a RAW8 image

§

Y8

8-bit per-pixel grayscale image.

Fields

§y: &'a u8

The single luma value for a Y-channel only image

§

Y16

16-bit per-pixel grayscale image.

Fields

§y: &'a u16

The single luma value for a Y-channel only image

§

Z16

16-bit linear depth values. The depth is meters is equal to depth scale * pixel value.

Fields

§depth: &'a u16

Depth value in millimetres

§

Distance

32-bit float-point depth distance value.

Fields

§distance: &'a f32

Distance from camera origin in metres

§

Disparity32

32-bit float-point disparity values. Depth->Disparity conversion : Disparity = Baseline*FocalLength/Depth.

Fields

§disparity: &'a f32

The disparity relative to the opposite eye in a depth camera.

§

Xyz32f

32-bit floating point 3D coordinates.

Fields

§x: &'a f32

The X-coordinate

§y: &'a f32

The Y-coordinate

§z: &'a f32

The Z-coordinate

Trait Implementations§

Source§

impl<'a> Debug for PixelKind<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for PixelKind<'a>

§

impl<'a> RefUnwindSafe for PixelKind<'a>

§

impl<'a> Send for PixelKind<'a>

§

impl<'a> Sync for PixelKind<'a>

§

impl<'a> Unpin for PixelKind<'a>

§

impl<'a> UnwindSafe for PixelKind<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.