pub struct Mask { /* private fields */ }Expand description
Mask: Gray Image.
Implementations§
Source§impl Mask
impl Mask
Sourcepub fn into_mask(self) -> GrayImage
pub fn into_mask(self) -> GrayImage
Consumes self and returns the mask field.
This method moves the owned value out of the struct without cloning.
§Returns
Returns the owned value of type GrayImage.
§Example
let obj = Mask::default().with_mask(value);
let value = obj.into_mask();
// obj is now consumed and cannot be usedGenerated by aksr - Builder pattern macro
Sourcepub fn with_meta(self, x: InstanceMeta) -> Self
pub fn with_meta(self, x: InstanceMeta) -> Self
Sourcepub fn meta(&self) -> &InstanceMeta
pub fn meta(&self) -> &InstanceMeta
Sourcepub fn into_meta(self) -> InstanceMeta
pub fn into_meta(self) -> InstanceMeta
Consumes self and returns the meta field.
This method moves the owned value out of the struct without cloning.
§Returns
Returns the owned value of type InstanceMeta.
§Example
let obj = Mask::default().with_meta(value);
let value = obj.into_meta();
// obj is now consumed and cannot be usedGenerated by aksr - Builder pattern macro
Sourcepub fn with_style(self, x: MaskStyle) -> Self
pub fn with_style(self, x: MaskStyle) -> Self
Sets the optional style field.
§Arguments
x- The value that will be automatically wrapped inSome
§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 = Mask::default().with_style(value);Generated by aksr - Builder pattern macro
Sourcepub fn into_style(self) -> Option<MaskStyle>
pub fn into_style(self) -> Option<MaskStyle>
Consumes self and returns the style field.
This method moves the owned value out of the struct without cloning.
§Returns
Returns Option
§Example
let obj = Mask::default().with_style(value);
let value = obj.into_style();Generated by aksr - Builder pattern macro
Sourcepub fn take_style(&mut self) -> Option<MaskStyle>
pub fn take_style(&mut self) -> Option<MaskStyle>
Takes the style 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
§Note
This does not require the inner type to implement Default.
§Example
let mut obj = Mask::default().with_style(value);
let value = obj.take_style();
// obj.style is now NoneGenerated by aksr - Builder pattern macro
Source§impl Mask
impl Mask
pub fn with_track_id(self, track_id: usize) -> Self
pub fn track_id(&self) -> Option<usize>
pub fn with_uid(self, uid: usize) -> Self
pub fn with_id(self, id: usize) -> Self
pub fn with_name(self, name: &str) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
pub fn uid(&self) -> usize
pub fn name(&self) -> Option<&str>
pub fn confidence(&self) -> Option<f32>
pub fn id(&self) -> Option<usize>
pub fn new(u8s: &[u8], width: u32, height: u32) -> Result<Self>
pub fn to_vec(&self) -> Vec<u8> ⓘ
pub fn height(&self) -> u32
pub fn width(&self) -> u32
pub fn dimensions(&self) -> (u32, u32)
pub fn polygon(&self) -> Option<Polygon>
pub fn polygons(&self) -> Vec<Polygon>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mask
impl RefUnwindSafe for Mask
impl Send for Mask
impl Sync for Mask
impl Unpin for Mask
impl UnwindSafe for Mask
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.