Skip to main content

RendererOutlineAa

Struct RendererOutlineAa 

Source
pub struct RendererOutlineAa<'a, PF: PixelFormat> { /* private fields */ }
Expand description

Anti-aliased outline renderer.

Port of C++ renderer_outline_aa<BaseRenderer>. Renders anti-aliased lines using a distance interpolation technique with configurable width profile.

Implementations§

Source§

impl<'a, PF: PixelFormat> RendererOutlineAa<'a, PF>
where PF::ColorType: Default + Clone,

Source

pub fn new(ren: &'a mut RendererBase<PF>, profile: &'a LineProfileAa) -> Self

Source

pub fn ren(&self) -> &RendererBase<PF>

Source

pub fn set_color(&mut self, c: PF::ColorType)

Source

pub fn color(&self) -> &PF::ColorType

Source

pub fn subpixel_width(&self) -> i32

Source

pub fn set_clip_box(&mut self, x1: f64, y1: f64, x2: f64, y2: f64)

Source

pub fn reset_clipping(&mut self)

Source

pub fn line0(&mut self, lp: &LineParameters)

Render a simple line (no joins).

Source

pub fn line1(&mut self, lp: &LineParameters, sx: i32, sy: i32)

Render line with start join.

Source

pub fn line2(&mut self, lp: &LineParameters, ex: i32, ey: i32)

Render line with end join.

Source

pub fn line3(&mut self, lp: &LineParameters, sx: i32, sy: i32, ex: i32, ey: i32)

Render line with both joins.

Source

pub fn semidot<F: Fn(i32) -> bool>( &mut self, cmp: F, xc1: i32, yc1: i32, xc2: i32, yc2: i32, )

Render a semi-circular dot (for round caps). Port of C++ semidot.

Source

pub fn pie(&mut self, xc: i32, yc: i32, x1: i32, y1: i32, x2: i32, y2: i32)

Render a pie slice (for round joins between two line segments). Port of C++ pie.

Trait Implementations§

Source§

impl<'a, PF: PixelFormat> OutlineAaRenderer for RendererOutlineAa<'a, PF>
where PF::ColorType: Default + Clone,

Source§

fn accurate_join_only(&self) -> bool

Returns true if this renderer only supports accurate (miter) joins. Image pattern renderers return true; solid AA renderers return false.
Source§

fn line0(&mut self, lp: &LineParameters)

Render a simple line segment (no join information).
Source§

fn line1(&mut self, lp: &LineParameters, sx: i32, sy: i32)

Render a line segment with start join bisectrix.
Source§

fn line2(&mut self, lp: &LineParameters, ex: i32, ey: i32)

Render a line segment with end join bisectrix.
Source§

fn line3(&mut self, lp: &LineParameters, sx: i32, sy: i32, ex: i32, ey: i32)

Render a line segment with both start and end join bisectrices.
Source§

fn semidot( &mut self, cmp: fn(i32) -> bool, xc1: i32, yc1: i32, xc2: i32, yc2: i32, )

Render a semi-circular dot (for round caps).
Source§

fn pie(&mut self, xc: i32, yc: i32, x1: i32, y1: i32, x2: i32, y2: i32)

Render a pie slice (for round joins).

Auto Trait Implementations§

§

impl<'a, PF> Freeze for RendererOutlineAa<'a, PF>
where <PF as PixelFormat>::ColorType: Freeze,

§

impl<'a, PF> RefUnwindSafe for RendererOutlineAa<'a, PF>

§

impl<'a, PF> Send for RendererOutlineAa<'a, PF>
where <PF as PixelFormat>::ColorType: Send, PF: Send,

§

impl<'a, PF> Sync for RendererOutlineAa<'a, PF>
where <PF as PixelFormat>::ColorType: Sync, PF: Sync,

§

impl<'a, PF> Unpin for RendererOutlineAa<'a, PF>
where <PF as PixelFormat>::ColorType: Unpin,

§

impl<'a, PF> !UnwindSafe for RendererOutlineAa<'a, PF>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.