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>

§

type Brush = Brush<D>

The type of a “brush”. Read more
§

type Image = Image<D>

The associated type of an image.
§

type Text = Text

An associated factory for creating text layouts and related resources.
§

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> )

Draw a rectangle with Gaussian blur. Read more
source§

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 more
source§

fn clear(&mut self, region: impl Into<Option<Rect>>, color: Color)

Replace a region of the canvas with the provided [Color]. Read more
source§

fn clip(&mut self, shape: impl Shape)

Clip to a [Shape]. Read more
source§

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 )

Draw an [Image] into the provided [Rect]. Read more
source§

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 more
source§

fn draw_text(&mut self, layout: &Self::TextLayout, pos: impl Into<Point>)

Draw a [TextLayout]. Read more
source§

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>)

Fill a shape, using the even-odd fill rule.
source§

fn finish(&mut self) -> Result<(), Pierror>

Finish any pending operations. Read more
source§

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>

Create a new [Image] from a pixel buffer. Read more
source§

fn restore(&mut self) -> Result<(), Pierror>

Restore the context state. Read more
source§

fn save(&mut self) -> Result<(), Pierror>

Save the context state. Read more
source§

fn solid_brush(&mut self, color: Color) -> Self::Brush

Create a new brush resource. Read more
source§

fn status(&mut self) -> Result<(), Pierror>

Report an internal error. Read more
source§

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 )

Stroke a [Shape], providing a custom [StrokeStyle].
source§

fn text(&mut self) -> &mut Self::Text

Returns a reference to a shared [Text] object. Read more
source§

fn transform(&mut self, transform: Affine)

Apply a transform. Read more
§

fn with_save( &mut self, f: impl FnOnce(&mut Self) -> Result<(), Error> ) -> Result<(), Error>

Do graphics operations with the context state saved and then restored. Read more
source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> RoundFrom<T> for T

§

fn round_from(x: T) -> T

Performs the conversion.
§

impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,

§

fn round_into(self) -> U

Performs the conversion.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more