Struct piet_wgpu::RenderContext
source · pub struct RenderContext<'a, D: DeviceAndQueue + ?Sized> { /* private fields */ }Expand description
The whole point.
Trait Implementations§
source§impl<D: DeviceAndQueue + ?Sized> RenderContext for RenderContext<'_, D>
impl<D: DeviceAndQueue + ?Sized> RenderContext for RenderContext<'_, D>
§type TextLayout = TextLayout
type TextLayout = TextLayout
The type use to represent text layout objects.
source§fn blurred_rect(
&mut self,
rect: Rect,
blur_radius: f64,
brush: &impl IntoBrush<Self>
)
fn blurred_rect( &mut self, rect: Rect, blur_radius: f64, brush: &impl IntoBrush<Self> )
Draw a rectangle with Gaussian blur. Read more
source§fn capture_image_area(
&mut self,
src_rect: impl Into<Rect>
) -> Result<Self::Image, Pierror>
fn capture_image_area( &mut self, src_rect: impl Into<Rect> ) -> Result<Self::Image, Pierror>
Create an [
Image] of the specified region of the context. Read moresource§fn clear(&mut self, region: impl Into<Option<Rect>>, color: Color)
fn clear(&mut self, region: impl Into<Option<Rect>>, color: Color)
Replace a region of the canvas with the provided [
Color]. Read moresource§fn current_transform(&self) -> Affine
fn current_transform(&self) -> Affine
Returns the transformations currently applied to the context.
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 )
Draw a specified area of an [
Image]. Read moresource§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 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 gradient(
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Self::Brush, Pierror>
fn gradient( &mut self, gradient: impl Into<FixedGradient> ) -> Result<Self::Brush, Pierror>
Create a new gradient brush.
source§fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<Self::Image, Pierror>
fn make_image( &mut self, width: usize, height: usize, buf: &[u8], format: ImageFormat ) -> Result<Self::Image, Pierror>
Create a new [
Image] from a pixel buffer. Read moresource§fn solid_brush(&mut self, color: Color) -> Self::Brush
fn solid_brush(&mut self, color: Color) -> Self::Brush
Create a new brush resource. Read more
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].impl<D: DeviceAndQueue + ?Sized> IntoBrush<RenderContext<'_, D>> for Brush<D>
Auto Trait Implementations§
impl<'a, D> !RefUnwindSafe for RenderContext<'a, D>
impl<'a, D> !Send for RenderContext<'a, D>
impl<'a, D> !Sync for RenderContext<'a, D>
impl<'a, D: ?Sized> Unpin for RenderContext<'a, D>
impl<'a, D> !UnwindSafe for RenderContext<'a, D>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.