pub struct Annotation {
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
pub color: [u8; 4],
pub kind: AnnotationKind,
pub label: Option<String>,
}Expand description
Annotation to draw on screenshots
Fields§
§x: u32X coordinate of the annotation
y: u32Y coordinate of the annotation
width: u32Width of the annotation (for rectangles)
height: u32Height of the annotation (for rectangles)
color: [u8; 4]Color of the annotation (RGBA)
kind: AnnotationKindType of annotation
label: Option<String>Optional label text
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn rectangle(x: u32, y: u32, width: u32, height: u32) -> Self
pub fn rectangle(x: u32, y: u32, width: u32, height: u32) -> Self
Create a rectangle annotation
Sourcepub fn highlight(x: u32, y: u32, width: u32, height: u32) -> Self
pub fn highlight(x: u32, y: u32, width: u32, height: u32) -> Self
Create a highlight annotation
Sourcepub fn filled_rectangle(x: u32, y: u32, width: u32, height: u32) -> Self
pub fn filled_rectangle(x: u32, y: u32, width: u32, height: u32) -> Self
Create a filled rectangle annotation
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set the annotation label
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Annotation
impl Debug for Annotation
Source§impl<'de> Deserialize<'de> for Annotation
impl<'de> Deserialize<'de> for Annotation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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