Struct piet_svg::RenderContext
source · pub struct RenderContext { /* private fields */ }
Expand description
piet::RenderContext
for generating SVG images
Implementations§
source§impl RenderContext
impl RenderContext
sourcepub fn size(&self) -> Size
pub fn size(&self) -> Size
The size that the SVG will render at.
The size is used to set the view box for the svg.
Trait Implementations§
source§impl RenderContext for RenderContext
impl RenderContext for RenderContext
§type TextLayout = TextLayout
type TextLayout = TextLayout
The type use to represent text layout objects.
source§fn gradient(
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Brush, Error>
fn gradient(
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Brush, Error>
Create a new gradient brush.
source§fn fill(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
fn fill(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
Fill a [
Shape
], using the non-zero fill rule.source§fn fill_even_odd(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
fn fill_even_odd(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>)
Fill a shape, using the even-odd fill rule.
source§fn stroke(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>, width: f64)
fn stroke(&mut self, shape: impl Shape, brush: &impl IntoBrush<Self>, width: f64)
Stroke a [
Shape
], using the default StrokeStyle
.source§fn stroke_styled(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64,
style: &StrokeStyle
)
fn stroke_styled(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<Self>,
width: f64,
style: &StrokeStyle
)
Stroke a [
Shape
], providing a custom StrokeStyle
.source§fn draw_text(&mut self, layout: &Self::TextLayout, pos: impl Into<Point>)
fn draw_text(&mut self, layout: &Self::TextLayout, pos: impl Into<Point>)
Draw a
TextLayout
. Read moresource§fn current_transform(&self) -> Affine
fn current_transform(&self) -> Affine
Returns the transformations currently applied to the context.
source§fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Error>
source§fn draw_image(
&mut self,
image: &Self::Image,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
fn draw_image(
&mut self,
image: &Self::Image,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
source§fn draw_image_area(
&mut self,
image: &Self::Image,
src_rect: impl Into<Rect>,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
fn draw_image_area(
&mut self,
image: &Self::Image,
src_rect: impl Into<Rect>,
dst_rect: impl Into<Rect>,
interp: InterpolationMode
)
impl IntoBrush<RenderContext> for Brush
Auto Trait Implementations§
impl !RefUnwindSafe for RenderContext
impl !Send for RenderContext
impl !Sync for RenderContext
impl Unpin for RenderContext
impl !UnwindSafe for RenderContext
Blanket Implementations§
source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.