[][src]Struct raqote::DrawTarget

pub struct DrawTarget { /* fields omitted */ }

The main type used for drawing

Methods

impl DrawTarget[src]

pub fn new(width: i32, height: i32) -> DrawTarget[src]

pub fn width(&self) -> i32[src]

pub fn height(&self) -> i32[src]

pub fn set_transform(&mut self, transform: &Transform)[src]

sets a transform that will be applied to all drawing operations

pub fn get_transform(&self) -> &Transform[src]

pub fn push_clip_rect(&mut self, rect: IntRect)[src]

pub fn pop_clip(&mut self)[src]

pub fn push_clip(&mut self, path: &Path)[src]

pub fn push_layer(&mut self, opacity: f32)[src]

Pushes a new layer as the drawing target. This is used for implementing group opacity effects.

pub fn pop_layer(&mut self)[src]

Draws the most recently pushed layer to the drawing target with the pushed opacity applied.

pub fn draw_image_with_size_at(
    &mut self,
    width: f32,
    height: f32,
    x: f32,
    y: f32,
    image: &Image,
    options: &DrawOptions
)
[src]

Draws an image at (x, y) with the size (width, height). This will rescale the image to the destination size.

pub fn draw_image_at(
    &mut self,
    x: f32,
    y: f32,
    image: &Image,
    options: &DrawOptions
)
[src]

Draws an image at x, y

pub fn mask(&mut self, src: &Source, x: i32, y: i32, mask: &Mask)[src]

Draws src through an untransformed mask positioned at x, y in device space

pub fn stroke(
    &mut self,
    path: &Path,
    src: &Source,
    style: &StrokeStyle,
    options: &DrawOptions
)
[src]

Strokes path with style and fills the result with src

pub fn fill(&mut self, path: &Path, src: &Source, options: &DrawOptions)[src]

Fills path with src

pub fn clear(&mut self, solid: SolidSource)[src]

Fills the current clip with the solid color solid

pub fn draw_text(
    &mut self,
    font: &Font,
    point_size: f32,
    text: &str,
    start: Point,
    src: &Source,
    options: &DrawOptions
)
[src]

pub fn draw_glyphs(
    &mut self,
    font: &Font,
    point_size: f32,
    ids: &[u32],
    positions: &[Point],
    src: &Source,
    options: &DrawOptions
)
[src]

pub fn copy_surface(
    &mut self,
    src: &DrawTarget,
    src_rect: IntRect,
    dst: IntPoint
)
[src]

Draws src_rect of src at dst. The current transform and clip are ignored

pub fn get_data(&self) -> &[u32][src]

Returns a reference to the underlying pixel data

pub fn get_data_mut(&mut self) -> &mut [u32][src]

Returns a mut reference to the underlying pixel data

pub fn get_data_u8_mut(&mut self) -> &mut [u8][src]

Returns a mut reference to the underlying pixel data as individual bytes

pub fn into_vec(self) -> Vec<u32>[src]

Take ownership of the buffer backing the DrawTarget

pub fn write_png<P: AsRef<Path>>(&self, path: P) -> Result<(), EncodingError>[src]

Saves the current pixel to a png file at path

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]