[−][src]Struct raqote::DrawTarget
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]
gets the current transform
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]
&mut self,
width: f32,
height: f32,
x: f32,
y: f32,
image: &Image,
options: &DrawOptions
)
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]
&mut self,
x: f32,
y: f32,
image: &Image,
options: &DrawOptions
)
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]
&mut self,
path: &Path,
src: &Source,
style: &StrokeStyle,
options: &DrawOptions
)
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]
&mut self,
font: &Font,
point_size: f32,
text: &str,
start: Point,
src: &Source,
options: &DrawOptions
)
pub fn draw_glyphs(
&mut self,
font: &Font,
point_size: f32,
ids: &[u32],
positions: &[Point],
src: &Source,
options: &DrawOptions
)
[src]
&mut self,
font: &Font,
point_size: f32,
ids: &[u32],
positions: &[Point],
src: &Source,
options: &DrawOptions
)
pub fn composite_surface<F: Fn(&[u32], &mut [u32])>(
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint,
f: F
)
[src]
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint,
f: F
)
Draws src_rect
of src
at dst
. The current transform and clip are ignored
pub fn copy_surface(
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint
)
[src]
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint
)
Draws src_rect
of src
at dst
. The current transform and clip are ignored
pub fn blend_surface(
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint,
blend: BlendMode
)
[src]
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint,
blend: BlendMode
)
Blends src_rect
of src
at dst
. The current transform and clip are ignored using
blend
mode.
pub fn blend_surface_with_alpha(
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint,
alpha: f32
)
[src]
&mut self,
src: &DrawTarget,
src_rect: IntRect,
dst: IntPoint,
alpha: f32
)
Blends src_rect
of src
at dst
using alpha
. 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 as ARGB with a representation like: (A << 24) | (R << 16) | (G << 8) | B
pub fn get_data_u8_mut(&mut self) -> &mut [u8]
[src]
Returns a mut reference to the underlying pixel data as individual bytes with the order BGRA on little endian.
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
impl !Sync for DrawTarget
impl !Send for DrawTarget
impl Unpin for DrawTarget
impl UnwindSafe for DrawTarget
impl !RefUnwindSafe for DrawTarget
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,