[−]Struct druid::piet::CoreGraphicsContext
Implementations
impl<'a> CoreGraphicsContext<'a>
pub fn new_y_up(ctx: &mut CGContextRef, height: f64) -> CoreGraphicsContext
Create a new context with the y-origin at the top-left corner.
This is not the default for CoreGraphics; but it is the defualt for piet. To map between the two coordinate spaces you must also pass an explicit height argument.
pub fn new_y_down(ctx: &mut CGContextRef) -> CoreGraphicsContext
Create a new context with the y-origin at the bottom right corner.
This is the default for core graphics, but not for piet.
Trait Implementations
impl<'a> Drop for CoreGraphicsContext<'a>
fn drop(&mut self)
impl<'a> IntoBrush<CoreGraphicsContext<'a>> for Brush
fn make_brush(
&'b self,
_piet: &mut CoreGraphicsContext,
_bbox: impl FnOnce() -> Rect
) -> Cow<'b, Brush>
&'b self,
_piet: &mut CoreGraphicsContext,
_bbox: impl FnOnce() -> Rect
) -> Cow<'b, Brush>
impl<'a> RenderContext for CoreGraphicsContext<'a>
type Brush = Brush
The type of a "brush". Read more
type Text = CoreGraphicsText<'a>
An associated factory for creating text layouts and related resources.
type TextLayout = CoreGraphicsTextLayout
type Image = CGImage
The associated type of an image.
fn clear(&mut self, color: Color)
fn solid_brush(&mut self, color: Color) -> Brush
fn gradient(
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Brush, Error>
&mut self,
gradient: impl Into<FixedGradient>
) -> Result<Brush, Error>
fn fill(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
Fill a shape.
fn fill_even_odd(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
fn clip(&mut self, shape: impl Shape)
fn stroke(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>,
width: f64
)
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>,
width: f64
)
fn stroke_styled(
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>,
width: f64,
style: &StrokeStyle
)
&mut self,
shape: impl Shape,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>,
width: f64,
style: &StrokeStyle
)
fn text(&mut self) -> &mut <CoreGraphicsContext<'a> as RenderContext>::Text
fn draw_text(
&mut self,
layout: &<CoreGraphicsContext<'a> as RenderContext>::TextLayout,
pos: impl Into<Point>,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
&mut self,
layout: &<CoreGraphicsContext<'a> as RenderContext>::TextLayout,
pos: impl Into<Point>,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
fn save(&mut self) -> Result<(), Error>
fn restore(&mut self) -> Result<(), Error>
fn finish(&mut self) -> Result<(), Error>
fn transform(&mut self, transform: Affine)
fn make_image(
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<<CoreGraphicsContext<'a> as RenderContext>::Image, Error>
&mut self,
width: usize,
height: usize,
buf: &[u8],
format: ImageFormat
) -> Result<<CoreGraphicsContext<'a> as RenderContext>::Image, Error>
fn draw_image(
&mut self,
image: &<CoreGraphicsContext<'a> as RenderContext>::Image,
rect: impl Into<Rect>,
interp: InterpolationMode
)
&mut self,
image: &<CoreGraphicsContext<'a> as RenderContext>::Image,
rect: impl Into<Rect>,
interp: InterpolationMode
)
fn draw_image_area(
&mut self,
image: &<CoreGraphicsContext<'a> as RenderContext>::Image,
src_rect: impl Into<Rect>,
dst_rect: impl Into<Rect>,
_interp: InterpolationMode
)
&mut self,
image: &<CoreGraphicsContext<'a> as RenderContext>::Image,
src_rect: impl Into<Rect>,
dst_rect: impl Into<Rect>,
_interp: InterpolationMode
)
fn blurred_rect(
&mut self,
rect: Rect,
blur_radius: f64,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
&mut self,
rect: Rect,
blur_radius: f64,
brush: &impl IntoBrush<CoreGraphicsContext<'a>>
)
fn current_transform(&self) -> Affine
fn status(&mut self) -> Result<(), Error>
fn with_save(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error>
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>
) -> Result<(), Error>
Auto Trait Implementations
impl<'a> !RefUnwindSafe for CoreGraphicsContext<'a>
impl<'a> Send for CoreGraphicsContext<'a>
impl<'a> !Sync for CoreGraphicsContext<'a>
impl<'a> Unpin for CoreGraphicsContext<'a>
impl<'a> !UnwindSafe for CoreGraphicsContext<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
fn round_into(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,