[−][src]Struct skia_safe::Canvas
The canvas type that is returned when it is managed by another instance, like Surface, for example. For these cases, the Canvas' reference that is returned is bound to the lifetime of the owner.
Methods
impl Canvas
[src]
pub fn annotate_rect_with_url(
&mut self,
rect: impl AsRef<Rect>,
data: &Data
) -> &mut Self
[src]
&mut self,
rect: impl AsRef<Rect>,
data: &Data
) -> &mut Self
pub fn annotate_named_destination(
&mut self,
point: impl Into<Point>,
data: &Data
) -> &mut Self
[src]
&mut self,
point: impl Into<Point>,
data: &Data
) -> &mut Self
pub fn annotate_link_to_destination(
&mut self,
rect: impl AsRef<Rect>,
data: &Data
) -> &mut Self
[src]
&mut self,
rect: impl AsRef<Rect>,
data: &Data
) -> &mut Self
impl Canvas
[src]
pub fn from_raster_direct<'pixels>(
info: &ImageInfo,
pixels: &'pixels mut [u8],
row_bytes: impl Into<Option<usize>>,
props: Option<&SurfaceProps>
) -> Option<OwnedCanvas<'pixels>>
[src]
info: &ImageInfo,
pixels: &'pixels mut [u8],
row_bytes: impl Into<Option<usize>>,
props: Option<&SurfaceProps>
) -> Option<OwnedCanvas<'pixels>>
pub fn from_raster_direct_n32<'pixels>(
size: impl Into<ISize>,
pixels: &'pixels mut [u32],
row_bytes: impl Into<Option<usize>>
) -> Option<OwnedCanvas<'pixels>>
[src]
size: impl Into<ISize>,
pixels: &'pixels mut [u32],
row_bytes: impl Into<Option<usize>>
) -> Option<OwnedCanvas<'pixels>>
pub fn new<'lt>(
size: impl Into<ISize>,
props: Option<&SurfaceProps>
) -> Option<OwnedCanvas<'lt>>
[src]
size: impl Into<ISize>,
props: Option<&SurfaceProps>
) -> Option<OwnedCanvas<'lt>>
pub fn from_bitmap<'lt>(
bitmap: &Bitmap,
props: Option<&SurfaceProps>
) -> OwnedCanvas<'lt>
[src]
bitmap: &Bitmap,
props: Option<&SurfaceProps>
) -> OwnedCanvas<'lt>
pub fn image_info(&self) -> ImageInfo
[src]
pub fn props(&self) -> Option<SurfaceProps>
[src]
pub fn flush(&mut self) -> &mut Self
[src]
pub fn base_layer_size(&self) -> ISize
[src]
pub fn new_surface(
&mut self,
info: &ImageInfo,
props: Option<&SurfaceProps>
) -> Option<Surface>
[src]
&mut self,
info: &ImageInfo,
props: Option<&SurfaceProps>
) -> Option<Surface>
pub fn gpu_context(&mut self) -> Option<Context>
[src]
pub fn access_top_layer_pixels(&mut self) -> Option<TopLayerPixels>
[src]
pub fn peek_pixels(&mut self) -> Option<Borrows<Pixmap>>
[src]
#[must_use]
pub fn read_pixels(
&mut self,
info: &ImageInfo,
dst_pixels: &mut [u8],
dst_row_bytes: usize,
src_point: impl Into<IPoint>
) -> bool
[src]
&mut self,
info: &ImageInfo,
dst_pixels: &mut [u8],
dst_row_bytes: usize,
src_point: impl Into<IPoint>
) -> bool
#[must_use]
pub fn read_pixels_to_pixmap(
&mut self,
pixmap: &mut Pixmap,
src: impl Into<IPoint>
) -> bool
[src]
&mut self,
pixmap: &mut Pixmap,
src: impl Into<IPoint>
) -> bool
#[must_use]
pub fn read_pixels_to_bitmap(
&mut self,
bitmap: &mut Bitmap,
src: impl Into<IPoint>
) -> bool
[src]
&mut self,
bitmap: &mut Bitmap,
src: impl Into<IPoint>
) -> bool
#[must_use]
pub fn write_pixels(
&mut self,
info: &ImageInfo,
pixels: &[u8],
row_bytes: usize,
offset: impl Into<IPoint>
) -> bool
[src]
&mut self,
info: &ImageInfo,
pixels: &[u8],
row_bytes: usize,
offset: impl Into<IPoint>
) -> bool
#[must_use]
pub fn write_pixels_from_bitmap(
&mut self,
bitmap: &Bitmap,
offset: impl Into<IPoint>
) -> bool
[src]
&mut self,
bitmap: &Bitmap,
offset: impl Into<IPoint>
) -> bool
pub fn save(&mut self) -> usize
[src]
pub fn save_layer(&mut self, layer_rec: &SaveLayerRec) -> usize
[src]
pub fn restore(&mut self) -> &mut Self
[src]
pub fn save_count(&self) -> usize
[src]
pub fn restore_to_count(&mut self, count: usize) -> &mut Self
[src]
pub fn translate(&mut self, d: impl Into<Vector>) -> &mut Self
[src]
pub fn scale(&mut self, (sx, sy): (scalar, scalar)) -> &mut Self
[src]
pub fn rotate(&mut self, degrees: scalar, point: Option<Point>) -> &mut Self
[src]
pub fn skew(&mut self, (sx, sy): (scalar, scalar)) -> &mut Self
[src]
pub fn concat(&mut self, matrix: &Matrix) -> &mut Self
[src]
pub fn set_matrix(&mut self, matrix: &Matrix) -> &mut Self
[src]
pub fn reset_matrix(&mut self) -> &mut Self
[src]
pub fn clip_rect(
&mut self,
rect: impl AsRef<Rect>,
op: impl Into<Option<ClipOp>>,
do_anti_alias: impl Into<Option<bool>>
) -> &mut Self
[src]
&mut self,
rect: impl AsRef<Rect>,
op: impl Into<Option<ClipOp>>,
do_anti_alias: impl Into<Option<bool>>
) -> &mut Self
pub fn clip_rrect(
&mut self,
rrect: impl AsRef<RRect>,
op: impl Into<Option<ClipOp>>,
do_anti_alias: impl Into<Option<bool>>
) -> &mut Self
[src]
&mut self,
rrect: impl AsRef<RRect>,
op: impl Into<Option<ClipOp>>,
do_anti_alias: impl Into<Option<bool>>
) -> &mut Self
pub fn clip_path(
&mut self,
path: &Path,
op: impl Into<Option<ClipOp>>,
do_anti_alias: impl Into<Option<bool>>
) -> &mut Self
[src]
&mut self,
path: &Path,
op: impl Into<Option<ClipOp>>,
do_anti_alias: impl Into<Option<bool>>
) -> &mut Self
pub fn clip_region(
&mut self,
device_rgn: &Region,
op: impl Into<Option<ClipOp>>
) -> &mut Self
[src]
&mut self,
device_rgn: &Region,
op: impl Into<Option<ClipOp>>
) -> &mut Self
pub fn local_clip_bounds(&self) -> Option<Rect>
[src]
pub fn device_clip_bounds(&self) -> Option<IRect>
[src]
pub fn draw_color(
&mut self,
color: impl Into<Color>,
mode: impl Into<Option<BlendMode>>
) -> &mut Self
[src]
&mut self,
color: impl Into<Color>,
mode: impl Into<Option<BlendMode>>
) -> &mut Self
pub fn clear(&mut self, color: impl Into<Color>) -> &mut Self
[src]
pub fn discard(&mut self) -> &mut Self
[src]
pub fn draw_paint(&mut self, paint: &Paint) -> &mut Self
[src]
pub fn draw_points(
&mut self,
mode: PointMode,
pts: &[Point],
paint: &Paint
) -> &mut Self
[src]
&mut self,
mode: PointMode,
pts: &[Point],
paint: &Paint
) -> &mut Self
pub fn draw_point(&mut self, p: impl Into<Point>, paint: &Paint) -> &mut Self
[src]
pub fn draw_line(
&mut self,
p1: impl Into<Point>,
p2: impl Into<Point>,
paint: &Paint
) -> &mut Self
[src]
&mut self,
p1: impl Into<Point>,
p2: impl Into<Point>,
paint: &Paint
) -> &mut Self
pub fn draw_rect(&mut self, rect: impl AsRef<Rect>, paint: &Paint) -> &mut Self
[src]
pub fn draw_irect(
&mut self,
rect: impl AsRef<IRect>,
paint: &Paint
) -> &mut Self
[src]
&mut self,
rect: impl AsRef<IRect>,
paint: &Paint
) -> &mut Self
pub fn draw_region(&mut self, region: &Region, paint: &Paint) -> &mut Self
[src]
pub fn draw_oval(&mut self, oval: impl AsRef<Rect>, paint: &Paint) -> &mut Self
[src]
pub fn draw_rrect(
&mut self,
rrect: impl AsRef<RRect>,
paint: &Paint
) -> &mut Self
[src]
&mut self,
rrect: impl AsRef<RRect>,
paint: &Paint
) -> &mut Self
pub fn draw_drrect(
&mut self,
outer: impl AsRef<RRect>,
inner: impl AsRef<RRect>,
paint: &Paint
) -> &mut Self
[src]
&mut self,
outer: impl AsRef<RRect>,
inner: impl AsRef<RRect>,
paint: &Paint
) -> &mut Self
pub fn draw_circle(
&mut self,
center: impl Into<Point>,
radius: scalar,
paint: &Paint
) -> &mut Self
[src]
&mut self,
center: impl Into<Point>,
radius: scalar,
paint: &Paint
) -> &mut Self
pub fn draw_arc(
&mut self,
oval: impl AsRef<Rect>,
start_angle: scalar,
sweep_angle: scalar,
use_center: bool,
paint: &Paint
) -> &mut Self
[src]
&mut self,
oval: impl AsRef<Rect>,
start_angle: scalar,
sweep_angle: scalar,
use_center: bool,
paint: &Paint
) -> &mut Self
pub fn draw_round_rect(
&mut self,
rect: impl AsRef<Rect>,
rx: scalar,
ry: scalar,
paint: &Paint
) -> &mut Self
[src]
&mut self,
rect: impl AsRef<Rect>,
rx: scalar,
ry: scalar,
paint: &Paint
) -> &mut Self
pub fn draw_path(&mut self, path: &Path, paint: &Paint) -> &mut Self
[src]
pub fn draw_image(
&mut self,
image: impl AsRef<Image>,
left_top: impl Into<Point>,
paint: Option<&Paint>
) -> &mut Self
[src]
&mut self,
image: impl AsRef<Image>,
left_top: impl Into<Point>,
paint: Option<&Paint>
) -> &mut Self
pub fn draw_image_rect(
&mut self,
image: impl AsRef<Image>,
src: Option<(&Rect, SrcRectConstraint)>,
dst: impl AsRef<Rect>,
paint: &Paint
) -> &mut Self
[src]
&mut self,
image: impl AsRef<Image>,
src: Option<(&Rect, SrcRectConstraint)>,
dst: impl AsRef<Rect>,
paint: &Paint
) -> &mut Self
pub fn draw_image_nine(
&mut self,
image: impl AsRef<Image>,
center: impl AsRef<IRect>,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
[src]
&mut self,
image: impl AsRef<Image>,
center: impl AsRef<IRect>,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
pub fn draw_bitmap(
&mut self,
bitmap: &Bitmap,
left_top: impl Into<Point>,
paint: Option<&Paint>
) -> &mut Self
[src]
&mut self,
bitmap: &Bitmap,
left_top: impl Into<Point>,
paint: Option<&Paint>
) -> &mut Self
pub fn draw_bitmap_rect(
&mut self,
bitmap: &Bitmap,
src: Option<&Rect>,
dst: impl AsRef<Rect>,
paint: &Paint,
constraint: impl Into<Option<SrcRectConstraint>>
) -> &mut Self
[src]
&mut self,
bitmap: &Bitmap,
src: Option<&Rect>,
dst: impl AsRef<Rect>,
paint: &Paint,
constraint: impl Into<Option<SrcRectConstraint>>
) -> &mut Self
pub fn draw_bitmap_nine(
&mut self,
bitmap: &Bitmap,
center: impl AsRef<IRect>,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
[src]
&mut self,
bitmap: &Bitmap,
center: impl AsRef<IRect>,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
pub fn draw_bitmap_lattice(
&mut self,
bitmap: &Bitmap,
lattice: &Lattice,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
[src]
&mut self,
bitmap: &Bitmap,
lattice: &Lattice,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
pub fn draw_image_lattice(
&mut self,
image: impl AsRef<Image>,
lattice: &Lattice,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
[src]
&mut self,
image: impl AsRef<Image>,
lattice: &Lattice,
dst: impl AsRef<Rect>,
paint: Option<&Paint>
) -> &mut Self
pub fn draw_str(
&mut self,
str: impl AsRef<str>,
origin: impl Into<Point>,
font: &Font,
paint: &Paint
) -> &mut Self
[src]
&mut self,
str: impl AsRef<str>,
origin: impl Into<Point>,
font: &Font,
paint: &Paint
) -> &mut Self
pub fn draw_text_blob(
&mut self,
blob: impl AsRef<TextBlob>,
origin: impl Into<Point>,
paint: &Paint
) -> &mut Self
[src]
&mut self,
blob: impl AsRef<TextBlob>,
origin: impl Into<Point>,
paint: &Paint
) -> &mut Self
pub fn draw_picture(
&mut self,
picture: impl AsRef<Picture>,
matrix: Option<&Matrix>,
paint: Option<&Paint>
) -> &mut Self
[src]
&mut self,
picture: impl AsRef<Picture>,
matrix: Option<&Matrix>,
paint: Option<&Paint>
) -> &mut Self
pub fn draw_vertices(
&mut self,
vertices: &Vertices,
bones: Option<&[Bone]>,
mode: BlendMode,
paint: &Paint
) -> &mut Self
[src]
&mut self,
vertices: &Vertices,
bones: Option<&[Bone]>,
mode: BlendMode,
paint: &Paint
) -> &mut Self
pub fn draw_patch(
&mut self,
cubics: &[Point; 12],
colors: &[Color; 4],
tex_coords: &[Point; 4],
mode: impl Into<Option<BlendMode>>,
paint: &Paint
) -> &mut Self
[src]
&mut self,
cubics: &[Point; 12],
colors: &[Color; 4],
tex_coords: &[Point; 4],
mode: impl Into<Option<BlendMode>>,
paint: &Paint
) -> &mut Self
pub fn draw_drawable(
&mut self,
drawable: &mut Drawable,
matrix: Option<&Matrix>
)
[src]
&mut self,
drawable: &mut Drawable,
matrix: Option<&Matrix>
)
pub fn draw_drawable_at(
&mut self,
drawable: &mut Drawable,
offset: impl Into<Point>
)
[src]
&mut self,
drawable: &mut Drawable,
offset: impl Into<Point>
)
pub fn draw_annotation(
&mut self,
rect: impl AsRef<Rect>,
key: &str,
value: &Data
) -> &mut Self
[src]
&mut self,
rect: impl AsRef<Rect>,
key: &str,
value: &Data
) -> &mut Self
pub fn is_clip_empty(&self) -> bool
[src]
pub fn is_clip_rect(&self) -> bool
[src]
pub fn total_matrix(&self) -> &Matrix
[src]
impl Canvas
[src]
pub fn new_null() -> OwnedCanvas<'static>
[src]
impl Canvas
[src]
pub fn draw_shadow(
&mut self,
path: &Path,
z_plane_params: impl Into<Point3>,
light_pos: impl Into<Point3>,
light_radius: scalar,
ambient_color: impl Into<Color>,
spot_color: impl Into<Color>,
flags: impl Into<Option<ShadowFlags>>
) -> &mut Self
[src]
&mut self,
path: &Path,
z_plane_params: impl Into<Point3>,
light_pos: impl Into<Point3>,
light_radius: scalar,
ambient_color: impl Into<Color>,
spot_color: impl Into<Color>,
flags: impl Into<Option<ShadowFlags>>
) -> &mut Self
impl Canvas
[src]
pub fn draw_str_align(
&mut self,
text: impl AsRef<str>,
p: impl Into<Point>,
font: &Font,
paint: &Paint,
align: Align
) -> &mut Self
[src]
&mut self,
text: impl AsRef<str>,
p: impl Into<Point>,
font: &Font,
paint: &Paint,
align: Align
) -> &mut Self
Trait Implementations
impl QuickReject<Rect> for Canvas
[src]
fn quick_reject(&self, other: &Rect) -> bool
[src]
impl AsMut<Canvas> for Canvas
[src]
impl<'lt> AsMut<Canvas> for OwnedCanvas<'lt>
[src]
Auto Trait Implementations
impl !Send for Canvas
impl Unpin for Canvas
impl !Sync for Canvas
impl RefUnwindSafe for Canvas
impl UnwindSafe for Canvas
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,