Skip to main content

Path

Struct Path 

Source
pub struct Path { /* private fields */ }

Implementations§

Source§

impl Path

Source

pub fn set_tolerance(&mut self, tolerance: f32) -> f32

Set curve flattening tolerance in target pixels and return the old value. Invalid values preserve the setting; 0.2 is the legacy default.

Source

pub fn begin(&mut self, dc: &Dc)

path_begin: an empty path; ox, oy = the draw origin used by the integer API

Source

pub fn reset(&mut self)

an empty path, origin kept (path_begin for the float API)

Source

pub fn set_origin(&mut self, ox: i32, oy: i32)

Source

pub fn is_empty(&self) -> bool

Source

pub fn pts_mut(&mut self) -> &mut [(f32, f32)]

the flattened points of every subpath (target pixels), e.g. to shear them before a fill (the asm’s g_pts / g_npts) // paint-tools: Kritzel’s italic text

Source

pub fn add_pt(&mut self, p: (f32, f32))

path_add_pt: append to the open subpath (a new one starts at the current point if none is open); a duplicate of the previous point is skipped

Source

pub fn move_fx(&mut self, x: i32, y: i32)

Source

pub fn move_f(&mut self, x: f32, y: f32)

Source

pub fn line_fx(&mut self, x: i32, y: i32)

Source

pub fn line_f(&mut self, x: f32, y: f32)

Source

pub fn close(&mut self)

Source

pub fn quad_fx(&mut self, cx: i32, cy: i32, x: i32, y: i32)

path_quad (24.8 fixed, origin-relative)

Source

pub fn quad_f(&mut self, cx: f32, cy: f32, x: f32, y: f32)

path_quad_f: quadratic Bezier from the current point (float pixels)

Source

pub fn cubic_fx( &mut self, c1x: i32, c1y: i32, c2x: i32, c2y: i32, x: i32, y: i32, )

path_cubic (24.8 fixed, origin-relative)

Source

pub fn cubic_f(&mut self, p1: (f32, f32), p2: (f32, f32), p3: (f32, f32))

a cubic Bezier from the current point in float pixels (the flattening of path_cubic)

Source

pub fn rect_fx(&mut self, x: i32, y: i32, w: i32, h: i32)

Source

pub fn rrect_fx(&mut self, x: i32, y: i32, w: i32, h: i32, r: i32)

path_rrect: closed rounded rectangle, r clamped to min(w, h) / 2

Source

pub fn ellipse_fx(&mut self, cx: i32, cy: i32, rx: i32, ry: i32)

path_ellipse: closed ellipse from four cubic arcs

Source

pub fn fill_lines(&self, ras: &mut Raster)

the line list of path_fill: every subpath of 2+ points closed implicitly

Source

pub fn fill(&self, ras: &mut Raster, dc: &Dc, sf: &mut Surface, rule: u32)

path_fill: every subpath closed implicitly; rule 0 non-zero, 1 even-odd

Source§

impl Path

Source

pub fn stroke_lines(&self, ras: &mut Raster, width: i32, style: u32)

the outline lines of path_stroke (ras.lines_begin + the contours); the caller fills them with the non-zero rule

Source

pub fn stroke( &self, ras: &mut Raster, dc: &Dc, sf: &mut Surface, width: i32, style: u32, )

path_stroke: the outline filled (non-zero) with the current colour

Trait Implementations§

Source§

impl Default for Path

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Path

§

impl Freeze for Path

§

impl RefUnwindSafe for Path

§

impl Send for Path

§

impl Sync for Path

§

impl Unpin for Path

§

impl UnsafeUnpin for Path

§

impl UnwindSafe for Path

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.