Trait InstanceAnnotate

Source
pub trait InstanceAnnotate:
    Clone
    + Default
    + Debug
    + PartialEq
    + Serialize
    + DeserializeOwned {
    // Required methods
    fn is_contained_in_image(&self, shape: ShapeI) -> bool;
    fn contains<P>(&self, point: P) -> bool
       where P: Into<PtF>;
    fn dist_to_boundary(&self, p: PtF) -> TPtF;
    fn rot90_with_image_ntimes(self, shape: ShapeI, n: u8) -> RvResult<Self>;
    fn enclosing_bb(&self) -> BbF;
    fn to_cocoseg(
        &self,
        shape_im: ShapeI,
        is_export_absolute: bool,
    ) -> RvResult<Option<CocoSegmentation>>;
}

Required Methods§

Source

fn is_contained_in_image(&self, shape: ShapeI) -> bool

Source

fn contains<P>(&self, point: P) -> bool
where P: Into<PtF>,

Source

fn dist_to_boundary(&self, p: PtF) -> TPtF

Source

fn rot90_with_image_ntimes(self, shape: ShapeI, n: u8) -> RvResult<Self>

§Errors

Can fail if a bounding box ends up with negative coordinates after rotation

Source

fn enclosing_bb(&self) -> BbF

Source

fn to_cocoseg( &self, shape_im: ShapeI, is_export_absolute: bool, ) -> RvResult<Option<CocoSegmentation>>

§Errors

Can fail if a bounding box is not on the image.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl InstanceAnnotate for Canvas

Source§

fn dist_to_boundary(&self, p: PtF) -> TPtF

Returns the distance to the boundary of the mask

Arguments: p: in image coordinates

Source§

fn is_contained_in_image(&self, shape: ShapeI) -> bool

Source§

fn contains<P>(&self, point: P) -> bool
where P: Into<PtF>,

Source§

fn enclosing_bb(&self) -> BbF

Source§

fn rot90_with_image_ntimes(self, shape: ShapeI, n: u8) -> RvResult<Self>

Source§

fn to_cocoseg( &self, shape_im: ShapeI, _is_export_absolute: bool, ) -> RvResult<Option<CocoSegmentation>>

Implementors§