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§
fn is_contained_in_image(&self, shape: ShapeI) -> bool
fn contains<P>(&self, point: P) -> bool
fn dist_to_boundary(&self, p: PtF) -> TPtF
Sourcefn rot90_with_image_ntimes(self, shape: ShapeI, n: u8) -> RvResult<Self>
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
fn enclosing_bb(&self) -> BbF
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
impl InstanceAnnotate for Canvas
Source§fn dist_to_boundary(&self, p: PtF) -> TPtF
fn dist_to_boundary(&self, p: PtF) -> TPtF
Returns the distance to the boundary of the mask
Arguments: p: in image coordinates