Skip to main content

KeypointStyle

Struct KeypointStyle 

Source
pub struct KeypointStyle { /* private fields */ }
Expand description

Keypoint-specific style configuration.

Implementations§

Source§

impl KeypointStyle

Source

pub fn with_visible(self, x: bool) -> Self

Sets the visible field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_visible(value);

Generated by aksr - Builder pattern macro

Source

pub fn visible(&self) -> bool

Returns the value of the visible field.

§Example
let obj = KeypointStyle::default();
let value = obj.visible();

Generated by aksr - Builder pattern macro

Source

pub fn with_text_visible(self, x: bool) -> Self

Sets the text_visible field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_text_visible(value);

Generated by aksr - Builder pattern macro

Source

pub fn text_visible(&self) -> bool

Returns the value of the text_visible field.

§Example
let obj = KeypointStyle::default();
let value = obj.text_visible();

Generated by aksr - Builder pattern macro

Source

pub fn with_draw_fill(self, x: bool) -> Self

Sets the draw_fill field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_draw_fill(value);

Generated by aksr - Builder pattern macro

Source

pub fn draw_fill(&self) -> bool

Returns the value of the draw_fill field.

§Example
let obj = KeypointStyle::default();
let value = obj.draw_fill();

Generated by aksr - Builder pattern macro

Source

pub fn with_draw_outline(self, x: bool) -> Self

Sets the draw_outline field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_draw_outline(value);

Generated by aksr - Builder pattern macro

Source

pub fn draw_outline(&self) -> bool

Returns the value of the draw_outline field.

§Example
let obj = KeypointStyle::default();
let value = obj.draw_outline();

Generated by aksr - Builder pattern macro

Source

pub fn with_fill_color(self, x: ColorSource) -> Self

Sets the fill_color field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_fill_color(value);

Generated by aksr - Builder pattern macro

Source

pub fn fill_color(&self) -> &ColorSource

Returns a reference to the fill_color field.

§Example
let obj = KeypointStyle::default();
let value = obj.fill_color();

Generated by aksr - Builder pattern macro

Source

pub fn into_fill_color(self) -> ColorSource

Consumes self and returns the fill_color field.

This method moves the owned value out of the struct without cloning.

§Returns

Returns the owned value of type ColorSource.

§Example
let obj = KeypointStyle::default().with_fill_color(value);
let value = obj.into_fill_color();
// obj is now consumed and cannot be used

Generated by aksr - Builder pattern macro

Source

pub fn with_outline_color(self, x: ColorSource) -> Self

Sets the outline_color field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_outline_color(value);

Generated by aksr - Builder pattern macro

Source

pub fn outline_color(&self) -> &ColorSource

Returns a reference to the outline_color field.

§Example
let obj = KeypointStyle::default();
let value = obj.outline_color();

Generated by aksr - Builder pattern macro

Source

pub fn into_outline_color(self) -> ColorSource

Consumes self and returns the outline_color field.

This method moves the owned value out of the struct without cloning.

§Returns

Returns the owned value of type ColorSource.

§Example
let obj = KeypointStyle::default().with_outline_color(value);
let value = obj.into_outline_color();
// obj is now consumed and cannot be used

Generated by aksr - Builder pattern macro

Source

pub fn with_mode(self, x: KeypointStyleMode) -> Self

Sets the mode field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_mode(value);

Generated by aksr - Builder pattern macro

Source

pub fn mode(&self) -> &KeypointStyleMode

Returns a reference to the mode field.

§Example
let obj = KeypointStyle::default();
let value = obj.mode();

Generated by aksr - Builder pattern macro

Source

pub fn into_mode(self) -> KeypointStyleMode

Consumes self and returns the mode field.

This method moves the owned value out of the struct without cloning.

§Returns

Returns the owned value of type KeypointStyleMode.

§Example
let obj = KeypointStyle::default().with_mode(value);
let value = obj.into_mode();
// obj is now consumed and cannot be used

Generated by aksr - Builder pattern macro

Source

pub fn with_radius(self, x: usize) -> Self

Sets the radius field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_radius(value);

Generated by aksr - Builder pattern macro

Source

pub fn radius(&self) -> usize

Returns the value of the radius field.

§Example
let obj = KeypointStyle::default();
let value = obj.radius();

Generated by aksr - Builder pattern macro

Source

pub fn with_thickness(self, x: usize) -> Self

Sets the thickness field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_thickness(value);

Generated by aksr - Builder pattern macro

Source

pub fn thickness(&self) -> usize

Returns the value of the thickness field.

§Example
let obj = KeypointStyle::default();
let value = obj.thickness();

Generated by aksr - Builder pattern macro

Source

pub fn with_skeleton(self, x: Skeleton) -> Self

Sets the optional skeleton field.

§Arguments
  • x - The value that will be automatically wrapped in Some
§Returns

Returns Self for method chaining.

§Note

The value is automatically wrapped in Some, so you don’t need to pass Some(value).

§Example
let obj = KeypointStyle::default().with_skeleton(value);

Generated by aksr - Builder pattern macro

Source

pub fn skeleton(&self) -> Option<&Skeleton>

Returns an optional reference to the skeleton field.

§Example
let obj = KeypointStyle::default();
let value = obj.skeleton();

Generated by aksr - Builder pattern macro

Source

pub fn into_skeleton(self) -> Option<Skeleton>

Consumes self and returns the skeleton field.

This method moves the owned value out of the struct without cloning.

§Returns

Returns Option containing the field value, or None if the field was None.

§Example
let obj = KeypointStyle::default().with_skeleton(value);
let value = obj.into_skeleton();

Generated by aksr - Builder pattern macro

Source

pub fn take_skeleton(&mut self) -> Option<Skeleton>

Takes the skeleton field, leaving None in its place.

This method moves the value out and replaces it with None, allowing you to continue using the struct.

§Returns

Returns Option containing the field value, or None if the field was None.

§Note

This does not require the inner type to implement Default.

§Example
let mut obj = KeypointStyle::default().with_skeleton(value);
let value = obj.take_skeleton();
// obj.skeleton is now None

Generated by aksr - Builder pattern macro

Source

pub fn with_skeleton_thickness(self, x: usize) -> Self

Sets the skeleton_thickness field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_skeleton_thickness(value);

Generated by aksr - Builder pattern macro

Source

pub fn skeleton_thickness(&self) -> usize

Returns the value of the skeleton_thickness field.

§Example
let obj = KeypointStyle::default();
let value = obj.skeleton_thickness();

Generated by aksr - Builder pattern macro

Source

pub fn with_text_style(self, x: TextStyle) -> Self

Sets the text_style field.

§Arguments
  • x - The new value to be assigned
§Returns

Returns Self for method chaining.

§Example
let obj = KeypointStyle::default().with_text_style(value);

Generated by aksr - Builder pattern macro

Source

pub fn text_style(&self) -> &TextStyle

Returns a reference to the text_style field.

§Example
let obj = KeypointStyle::default();
let value = obj.text_style();

Generated by aksr - Builder pattern macro

Source

pub fn into_text_style(self) -> TextStyle

Consumes self and returns the text_style field.

This method moves the owned value out of the struct without cloning.

§Returns

Returns the owned value of type TextStyle.

§Example
let obj = KeypointStyle::default().with_text_style(value);
let value = obj.into_text_style();
// obj is now consumed and cannot be used

Generated by aksr - Builder pattern macro

Source

pub fn with_palette(self, x: &[Color]) -> Self

Sets the palette field from a slice.

§Arguments
  • x - A slice of elements to be converted into a vector
§Returns

Returns Self for method chaining.

§Note

If the slice is empty, the field remains unchanged.

§Example
let obj = KeypointStyle::default().with_palette(&[item1, item2]);

Generated by aksr - Builder pattern macro

Source

pub fn palette(&self) -> &[Color]

Returns a slice view of the palette field.

§Example
let obj = KeypointStyle::default();
let items = obj.palette();

Generated by aksr - Builder pattern macro

Source

pub fn into_palette(self) -> Vec<Color>

Consumes self and returns the palette field.

This method moves the owned value out of the struct without cloning.

§Returns

Returns the owned value of type Vec < Color >.

§Example
let obj = KeypointStyle::default().with_palette(value);
let value = obj.into_palette();
// obj is now consumed and cannot be used

Generated by aksr - Builder pattern macro

Source

pub fn take_palette(&mut self) -> Vec<Color>
where Vec<Color>: Default,

Takes the palette field and replaces it with Default::default().

This method moves the value out and replaces it with the default value, allowing you to continue using the struct.

§Returns

Returns the owned value of type Vec < Color >.

§Note

Requires the field type Vec < Color > to implement Default. Prefer this when you want to keep using the instance.

§Example
let mut obj = KeypointStyle::default().with_palette(value);
let value = obj.take_palette();
// obj.palette is now set to Default::default()

Generated by aksr - Builder pattern macro

Source§

impl KeypointStyle

Source

pub fn star() -> Self

Keypoint with star shape

Source

pub fn glow() -> Self

Keypoint with glow effect

Source

pub fn show_confidence(self, show: bool) -> Self

Set show_confidence in text_style

Source

pub fn show_id(self, show: bool) -> Self

Set show_id in text_style

Source

pub fn show_name(self, show: bool) -> Self

Set show_name in text_style

Trait Implementations§

Source§

impl Clone for KeypointStyle

Source§

fn clone(&self) -> KeypointStyle

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for KeypointStyle

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for KeypointStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Palette for KeypointStyle

Source§

fn palette(&self) -> &[Color]

Get the palette colors.
Source§

fn color_from_palette(&self, i: usize) -> Color

Get color from palette by index (wraps around if index > palette length).
Source§

impl PartialEq for KeypointStyle

Source§

fn eq(&self, other: &KeypointStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for KeypointStyle

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more