pub struct Context<R> where
R: Renderer, { /* private fields */ }
Implementations
impl<R> Context<R> where
R: Renderer,
impl<R> Context<R> where
R: Renderer,
pub fn create(renderer: R) -> Result<Context<R>, Error>
pub fn begin_frame<E>(
&mut self,
window_extent: E,
device_pixel_ratio: f32
) -> Result<(), Error> where
E: Into<Extent>,
pub fn cancel_frame(&mut self) -> Result<(), Error>
pub fn end_frame(&mut self) -> Result<(), Error>
pub fn save(&mut self)
pub fn restore(&mut self)
pub fn reset(&mut self)
pub fn shape_antialias(&mut self, enabled: bool)
pub fn stroke_width(&mut self, width: f32)
pub fn miter_limit(&mut self, limit: f32)
pub fn line_cap(&mut self, cap: LineCap)
pub fn line_join(&mut self, join: LineJoin)
pub fn global_alpha(&mut self, alpha: f32)
pub fn transform(&mut self, xform: Transform)
pub fn reset_transform(&mut self)
pub fn translate(&mut self, tx: f32, ty: f32)
pub fn rotate(&mut self, angle: f32)
pub fn skew_x(&mut self, angle: f32)
pub fn skew_y(&mut self, angle: f32)
pub fn scale(&mut self, sx: f32, sy: f32)
pub fn current_transform(&mut self) -> Transform
pub fn stroke_paint<T>(&mut self, paint: T) where
T: Into<Paint>,
pub fn fill_paint<T>(&mut self, paint: T) where
T: Into<Paint>,
pub fn create_image<D>(
&mut self,
flags: ImageFlags,
data: D
) -> Result<usize, Error> where
D: AsRef<[u8]>,
pub fn create_image_from_file<P>(
&mut self,
flags: ImageFlags,
path: P
) -> Result<usize, Error> where
P: AsRef<Path>,
pub fn update_image(&mut self, img: usize, data: &[u8]) -> Result<(), Error>
pub fn image_size(&self, img: usize) -> Result<(usize, usize), Error>
pub fn delete_image(&mut self, img: usize) -> Result<(), Error>
pub fn scissor<T>(&mut self, rect: T) where
T: Into<Rect>,
pub fn intersect_scissor<T>(&mut self, rect: T) where
T: Into<Rect>,
pub fn reset_scissor(&mut self)
pub fn global_composite_operation(&mut self, op: CompositeOperation)
pub fn begin_path(&mut self)
pub fn move_to<P>(&mut self, pt: P) where
P: Into<Point>,
pub fn line_to<P>(&mut self, pt: P) where
P: Into<Point>,
pub fn bezier_to<P>(&mut self, cp1: P, cp2: P, pt: P) where
P: Into<Point>,
pub fn quad_to<P>(&mut self, cp: P, pt: P) where
P: Into<Point>,
pub fn arc_to<P>(&mut self, pt1: P, pt2: P, radius: f32) where
P: Into<Point>,
pub fn close_path(&mut self)
pub fn path_solidity(&mut self, dir: Solidity)
pub fn arc<P>(&mut self, cp: P, radius: f32, a0: f32, a1: f32, dir: Solidity) where
P: Into<Point>,
pub fn rect<T>(&mut self, rect: T) where
T: Into<Rect>,
pub fn rounded_rect<T>(&mut self, rect: T, radius: f32) where
T: Into<Rect>,
pub fn rounded_rect_varying<T>(
&mut self,
rect: T,
lt: f32,
rt: f32,
rb: f32,
lb: f32
) where
T: Into<Rect>,
pub fn ellipse<P>(&mut self, center: P, radius_x: f32, radius_y: f32) where
P: Into<Point>,
pub fn circle<P>(&mut self, center: P, radius: f32) where
P: Into<Point>,
pub fn fill(&mut self) -> Result<(), Error>
pub fn stroke(&mut self) -> Result<(), Error>
pub fn create_font_from_file<N, P>(
&mut self,
name: N,
path: P
) -> Result<usize, Error> where
N: Into<String>,
P: AsRef<Path>,
pub fn create_font<N, D>(&mut self, name: N, data: D) -> Result<usize, Error> where
N: Into<String>,
D: Into<Vec<u8, Global>>,
pub fn find_font<N>(&self, name: N) -> Option<usize> where
N: AsRef<str>,
pub fn add_fallback_fontid(&mut self, base: usize, fallback: usize)
pub fn add_fallback_font<N1, N2>(&mut self, base: N1, fallback: N2) where
N1: AsRef<str>,
N2: AsRef<str>,
pub fn font_size(&mut self, size: f32)
pub fn text_letter_spacing(&mut self, spacing: f32)
pub fn text_line_height(&mut self, line_height: f32)
pub fn text_align(&mut self, align: Align)
pub fn fontid(&mut self, id: usize)
pub fn font<N>(&mut self, name: N) where
N: AsRef<str>,
pub fn text<S, P>(&mut self, pt: P, text: S) -> Result<(), Error> where
S: AsRef<str>,
P: Into<Point>,
pub fn text_metrics(&self) -> TextMetrics
pub fn text_size<S>(&self, text: S) -> Extent where
S: AsRef<str>,
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.