[−][src]Struct piet_cairo::CairoRenderContext
Methods
impl<'a> CairoRenderContext<'a>
[src]
pub fn new(ctx: &mut Context) -> CairoRenderContext
[src]
Create a new Cairo back-end.
At the moment, it uses the "toy text API" for text layout, but when we change to a more sophisticated text layout approach, we'll probably need a factory for that as an additional argument.
Trait Implementations
impl<'a> RenderContext for CairoRenderContext<'a>
[src]
type Point = Vec2
Cairo mostly uses raw f64, so this is as convenient as anything.
type Coord = f64
The type of 1D measurements, for example stroke width. Read more
type Brush = Brush
The type of a "brush". Read more
type Text = CairoText
An associated factory for creating text layouts and related resources.
type TextLayout = CairoTextLayout
type Image = ImageSurface
The associated type of an image.
fn status(&mut self) -> Result<(), Error>
[src]
fn clear(&mut self, rgb: u32)
[src]
fn solid_brush(&mut self, rgba: u32) -> Result<Brush, Error>
[src]
fn gradient(&mut self, gradient: Gradient) -> Result<Brush, Error>
[src]
fn fill(&mut self, shape: impl Shape, brush: &Self::Brush, fill_rule: FillRule)
[src]
fn clip(&mut self, shape: impl Shape, fill_rule: FillRule)
[src]
fn stroke(
&mut self,
shape: impl Shape,
brush: &Self::Brush,
width: impl RoundInto<Self::Coord>,
style: Option<&StrokeStyle>
)
[src]
&mut self,
shape: impl Shape,
brush: &Self::Brush,
width: impl RoundInto<Self::Coord>,
style: Option<&StrokeStyle>
)
fn text(&mut self) -> &mut Self::Text
[src]
fn draw_text(
&mut self,
layout: &Self::TextLayout,
pos: impl RoundInto<Self::Point>,
brush: &Self::Brush
)
[src]
&mut self,
layout: &Self::TextLayout,
pos: impl RoundInto<Self::Point>,
brush: &Self::Brush
)
fn save(&mut self) -> Result<(), Error>
[src]
fn restore(&mut self) -> Result<(), Error>
[src]
fn finish(&mut self) -> Result<(), Error>
[src]
fn transform(&mut self, transform: Affine)
[src]
fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
[src]
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
fn draw_image(
&mut self,
image: &Self::Image,
rect: impl Into<Rect>,
interp: InterpolationMode
)
[src]
&mut self,
image: &Self::Image,
rect: impl Into<Rect>,
interp: InterpolationMode
)
fn with_save<impl FnOnce(&mut Self) -> Result<(), Error>>(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error> where
impl FnOnce(&mut Self) -> Result<(), Error>: FnOnce(&mut Self) -> Result<(), Error>,
[src]
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error> where
impl FnOnce(&mut Self) -> Result<(), Error>: FnOnce(&mut Self) -> Result<(), Error>,
Do graphics operations with the context state saved and then restored. Read more
Auto Trait Implementations
impl<'a> !Send for CairoRenderContext<'a>
impl<'a> !Sync for CairoRenderContext<'a>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> RoundFrom for T
[src]
fn round_from(x: T) -> T
[src]
impl<T, U> RoundInto for T where
U: RoundFrom<T>,
[src]
U: RoundFrom<T>,