Struct AiVisionColorCode

Source
pub struct AiVisionColorCode(/* private fields */);
Expand description

A color code used by an AI Vision Sensor to detect groups of color blobs.

The color code can have up to 7 color signatures. When the colors in a color code are detected next to eachother, the sensor will detect the color code.

Implementations§

Source§

impl AiVisionColorCode

Source

pub const fn new<const N: usize>(code: [Option<u8>; 7]) -> Self

Creates a new color code with the given color signature ids.

Source

pub fn colors(&self) -> Vec<u8>

Returns the color signature ids in the color code.

Trait Implementations§

Source§

impl From<[Option<u8>; 1]> for AiVisionColorCode

Source§

fn from(value: [Option<u8>; 1]) -> Self

Converts to this type from the input type.
Source§

impl From<[Option<u8>; 2]> for AiVisionColorCode

Source§

fn from(value: [Option<u8>; 2]) -> Self

Converts to this type from the input type.
Source§

impl From<[Option<u8>; 3]> for AiVisionColorCode

Source§

fn from(value: [Option<u8>; 3]) -> Self

Converts to this type from the input type.
Source§

impl From<[Option<u8>; 4]> for AiVisionColorCode

Source§

fn from(value: [Option<u8>; 4]) -> Self

Converts to this type from the input type.
Source§

impl From<[Option<u8>; 5]> for AiVisionColorCode

Source§

fn from(value: [Option<u8>; 5]) -> Self

Converts to this type from the input type.
Source§

impl From<[Option<u8>; 6]> for AiVisionColorCode

Source§

fn from(value: [Option<u8>; 6]) -> Self

Converts to this type from the input type.
Source§

impl From<[Option<u8>; 7]> for AiVisionColorCode

Source§

fn from(value: [Option<u8>; 7]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 1]> for AiVisionColorCode

Source§

fn from(value: [u8; 1]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 2]> for AiVisionColorCode

Source§

fn from(value: [u8; 2]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 3]> for AiVisionColorCode

Source§

fn from(value: [u8; 3]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 4]> for AiVisionColorCode

Source§

fn from(value: [u8; 4]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 5]> for AiVisionColorCode

Source§

fn from(value: [u8; 5]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 6]> for AiVisionColorCode

Source§

fn from(value: [u8; 6]) -> Self

Converts to this type from the input type.
Source§

impl From<[u8; 7]> for AiVisionColorCode

Source§

fn from(value: [u8; 7]) -> Self

Converts to this type from the input type.
Source§

impl From<(u8,)> for AiVisionColorCode

Source§

fn from(value: (u8,)) -> Self

Converts to this type from the input type.
Source§

impl From<(u8, u8)> for AiVisionColorCode

Source§

fn from(value: (u8, u8)) -> Self

Converts to this type from the input type.
Source§

impl From<(u8, u8, u8)> for AiVisionColorCode

Source§

fn from(value: (u8, u8, u8)) -> Self

Converts to this type from the input type.
Source§

impl From<(u8, u8, u8, u8)> for AiVisionColorCode

Source§

fn from(value: (u8, u8, u8, u8)) -> Self

Converts to this type from the input type.
Source§

impl From<(u8, u8, u8, u8, u8)> for AiVisionColorCode

Source§

fn from(value: (u8, u8, u8, u8, u8)) -> Self

Converts to this type from the input type.
Source§

impl From<(u8, u8, u8, u8, u8, u8)> for AiVisionColorCode

Source§

fn from(value: (u8, u8, u8, u8, u8, u8)) -> Self

Converts to this type from the input type.
Source§

impl From<(u8, u8, u8, u8, u8, u8, u8)> for AiVisionColorCode

Source§

fn from(value: (u8, u8, u8, u8, u8, u8, u8)) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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.