Struct RenderContext

Source
pub struct RenderContext<'cache, Target: ?Sized> { /* private fields */ }
Expand description

The whole point.

Implementations§

Source§

impl<T: AsPixmapMut + ?Sized> RenderContext<'_, T>

Source

pub fn bitmap_scale(&self) -> f64

Get the bitmap scale.

Source

pub fn set_bitmap_scale(&mut self, scale: f64)

Set the bitmap scale.

Source

pub fn tolerance(&self) -> f64

Get the flattening tolerance.

Source

pub fn set_tolerance(&mut self, tolerance: f64)

Set the flattening tolerance.

Source

pub fn target(&self) -> &T

Get the inner target.

Source

pub fn target_mut(&mut self) -> &mut T

Get the inner target.

Source

pub fn into_target(self) -> T
where T: Sized,

Unwrap this type and reduce it to the inner target.

Trait Implementations§

Source§

impl<T: AsPixmapMut + ?Sized> RenderContext for RenderContext<'_, T>

Source§

type Brush = Brush

The type of a “brush”. Read more
Source§

type Image = Image

The associated type of an image.
Source§

type Text = Text

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

type TextLayout = TextLayout

The type use to represent text layout objects.
Source§

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

Report an internal error. Read more
Source§

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

Create a new brush resource. Read more
Source§

fn gradient( &mut self, gradient: impl Into<FixedGradient>, ) -> Result<Self::Brush, Pierror>

Create a new gradient brush.
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 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 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 clip(&mut self, shape: impl Shape)

Clip to a Shape. Read more
Source§

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

Returns a reference to a shared Text object. Read more
Source§

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

Source§

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

Save the context state. Read more
Source§

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

Restore the context state. Read more
Source§

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

Finish any pending operations. Read more
Source§

fn transform(&mut self, transform: Affine)

Apply a transform. Read more
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 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 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 blurred_rect( &mut self, input_rect: Rect, blur_radius: f64, brush: &impl IntoBrush<Self>, )

Draw a rectangle with Gaussian blur. Read more
Source§

fn current_transform(&self) -> Affine

Returns the transformations currently applied to the context.
Source§

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<T: AsPixmapMut + ?Sized> IntoBrush<RenderContext<'_, T>> for Brush

Auto Trait Implementations§

§

impl<'cache, Target> Freeze for RenderContext<'cache, Target>
where Target: Freeze + ?Sized,

§

impl<'cache, Target> !RefUnwindSafe for RenderContext<'cache, Target>

§

impl<'cache, Target> !Send for RenderContext<'cache, Target>

§

impl<'cache, Target> !Sync for RenderContext<'cache, Target>

§

impl<'cache, Target> Unpin for RenderContext<'cache, Target>
where Target: Unpin + ?Sized,

§

impl<'cache, Target> !UnwindSafe for RenderContext<'cache, Target>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
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 T
where 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.

Source§

impl<T> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Performs the conversion.
Source§

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

Source§

fn round_into(self) -> U

Performs the conversion.
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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