[][src]Struct nvg::Context

pub struct Context<R: Renderer> { /* fields omitted */ }

Implementations

impl<R: Renderer> Context<R>[src]

pub fn create(renderer: R) -> Result<Context<R>>[src]

pub fn begin_frame<E: Into<Extent>>(
    &mut self,
    window_extent: E,
    device_pixel_ratio: f32
) -> Result<()>
[src]

pub fn cancel_frame(&mut self) -> Result<()>[src]

pub fn end_frame(&mut self) -> Result<()>[src]

pub fn save(&mut self)[src]

pub fn restore(&mut self)[src]

pub fn reset(&mut self)[src]

pub fn shape_antialias(&mut self, enabled: bool)[src]

pub fn stroke_width(&mut self, width: f32)[src]

pub fn miter_limit(&mut self, limit: f32)[src]

pub fn line_cap(&mut self, cap: LineCap)[src]

pub fn line_join(&mut self, join: LineJoin)[src]

pub fn global_alpha(&mut self, alpha: f32)[src]

pub fn transform(&mut self, xform: Transform)[src]

pub fn reset_transform(&mut self)[src]

pub fn translate(&mut self, tx: f32, ty: f32)[src]

pub fn rotate(&mut self, angle: f32)[src]

pub fn skew_x(&mut self, angle: f32)[src]

pub fn skew_y(&mut self, angle: f32)[src]

pub fn scale(&mut self, sx: f32, sy: f32)[src]

pub fn current_transform(&mut self) -> Transform[src]

pub fn stroke_paint<T: Into<Paint>>(&mut self, paint: T)[src]

pub fn fill_paint<T: Into<Paint>>(&mut self, paint: T)[src]

pub fn create_image<D: AsRef<[u8]>>(
    &mut self,
    flags: ImageFlags,
    data: D
) -> Result<ImageId>
[src]

pub fn create_image_from_file<P: AsRef<Path>>(
    &mut self,
    flags: ImageFlags,
    path: P
) -> Result<ImageId>
[src]

pub fn update_image(&mut self, img: ImageId, data: &[u8]) -> Result<()>[src]

pub fn image_size(&self, img: ImageId) -> Result<(usize, usize)>[src]

pub fn delete_image(&mut self, img: ImageId) -> Result<()>[src]

pub fn scissor<T: Into<Rect>>(&mut self, rect: T)[src]

pub fn intersect_scissor<T: Into<Rect>>(&mut self, rect: T)[src]

pub fn reset_scissor(&mut self)[src]

pub fn global_composite_operation(&mut self, op: CompositeOperation)[src]

pub fn begin_path(&mut self)[src]

pub fn move_to<P: Into<Point>>(&mut self, pt: P)[src]

pub fn line_to<P: Into<Point>>(&mut self, pt: P)[src]

pub fn bezier_to<P: Into<Point>>(&mut self, cp1: P, cp2: P, pt: P)[src]

pub fn quad_to<P: Into<Point>>(&mut self, cp: P, pt: P)[src]

pub fn arc_to<P: Into<Point>>(&mut self, pt1: P, pt2: P, radius: f32)[src]

pub fn close_path(&mut self)[src]

pub fn path_solidity(&mut self, dir: Solidity)[src]

pub fn arc<P: Into<Point>>(
    &mut self,
    cp: P,
    radius: f32,
    a0: f32,
    a1: f32,
    dir: Solidity
)
[src]

pub fn rect<T: Into<Rect>>(&mut self, rect: T)[src]

pub fn rounded_rect<T: Into<Rect>>(&mut self, rect: T, radius: f32)[src]

pub fn rounded_rect_varying<T: Into<Rect>>(
    &mut self,
    rect: T,
    lt: f32,
    rt: f32,
    rb: f32,
    lb: f32
)
[src]

pub fn ellipse<P: Into<Point>>(
    &mut self,
    center: P,
    radius_x: f32,
    radius_y: f32
)
[src]

pub fn circle<P: Into<Point>>(&mut self, center: P, radius: f32)[src]

pub fn fill(&mut self) -> Result<()>[src]

pub fn stroke(&mut self) -> Result<()>[src]

pub fn create_font_from_file<N: Into<String>, P: AsRef<Path>>(
    &mut self,
    name: N,
    path: P
) -> Result<FontId>
[src]

pub fn create_font<N: Into<String>, D: Into<Vec<u8>>>(
    &mut self,
    name: N,
    data: D
) -> Result<FontId>
[src]

pub fn find_font<N: AsRef<str>>(&self, name: N) -> Option<FontId>[src]

pub fn add_fallback_fontid(&mut self, base: FontId, fallback: FontId)[src]

pub fn add_fallback_font<N1: AsRef<str>, N2: AsRef<str>>(
    &mut self,
    base: N1,
    fallback: N2
)
[src]

pub fn font_size(&mut self, size: f32)[src]

pub fn text_letter_spacing(&mut self, spacing: f32)[src]

pub fn text_line_height(&mut self, line_height: f32)[src]

pub fn text_align(&mut self, align: Align)[src]

pub fn fontid(&mut self, id: FontId)[src]

pub fn font<N: AsRef<str>>(&mut self, name: N)[src]

pub fn text<S: AsRef<str>, P: Into<Point>>(
    &mut self,
    pt: P,
    text: S
) -> Result<()>
[src]

pub fn text_metrics(&self) -> TextMetrics[src]

pub fn text_size<S: AsRef<str>>(&self, text: S) -> Extent[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for Context<R> where
    R: RefUnwindSafe

impl<R> !Send for Context<R>

impl<R> !Sync for Context<R>

impl<R> Unpin for Context<R> where
    R: Unpin

impl<R> UnwindSafe for Context<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.