pub(crate) struct Segment {Show 15 fields
pub flags: u8,
pub dir: Direction,
pub pos: i16,
pub delta: i16,
pub min_coord: i16,
pub max_coord: i16,
pub height: i16,
pub score: i32,
pub len: i32,
pub link_ix: Option<u16>,
pub serif_ix: Option<u16>,
pub first_ix: u16,
pub last_ix: u16,
pub edge_ix: Option<u16>,
pub edge_next_ix: Option<u16>,
}
Expand description
Sequence of points with a single dominant direction.
Fields§
§flags: u8
Flags describing the properties of the segment.
dir: Direction
Dominant direction of the segment.
pos: i16
Position of the segment.
delta: i16
Deviation from segment position.
min_coord: i16
Minimum coordinate of the segment.
max_coord: i16
Maximum coordinate of the segment.
height: i16
Hinted segment height.
score: i32
Used during stem matching.
len: i32
Used during stem matching.
link_ix: Option<u16>
Index of best candidate for a stem link.
serif_ix: Option<u16>
Index of best candidate for a serif link.
first_ix: u16
Index of first point in the outline.
last_ix: u16
Index of last point in the outline.
edge_ix: Option<u16>
Index of edge that is associated with the segment.
edge_next_ix: Option<u16>
Index of next segment in edge’s segment list.
Implementations§
Source§impl Segment
impl Segment
pub fn first(&self) -> usize
pub fn first_point<'a>(&self, points: &'a [Point]) -> &'a Point
pub fn last(&self) -> usize
pub fn last_point<'a>(&self, points: &'a [Point]) -> &'a Point
pub fn edge<'a>(&self, edges: &'a [Edge]) -> Option<&'a Edge>
Sourcepub fn next_in_edge<'a>(&self, segments: &'a [Segment]) -> Option<&'a Segment>
pub fn next_in_edge<'a>(&self, segments: &'a [Segment]) -> Option<&'a Segment>
Returns the next segment in this segment’s parent edge.
pub fn link<'a>(&self, segments: &'a [Segment]) -> Option<&'a Segment>
Trait Implementations§
impl Copy for Segment
impl Eq for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnwindSafe for Segment
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