pub struct Vger {
pub glyph_cache: GlyphCache,
/* private fields */
}Fields§
§glyph_cache: GlyphCacheImplementations§
Source§impl Vger
impl Vger
Sourcepub fn new(
device: Arc<Device>,
queue: Arc<Queue>,
texture_format: TextureFormat,
) -> Self
pub fn new( device: Arc<Device>, queue: Arc<Queue>, texture_format: TextureFormat, ) -> Self
Create a new renderer given a device and output pixel format.
Sourcepub fn begin(
&mut self,
window_width: f32,
window_height: f32,
device_px_ratio: f32,
)
pub fn begin( &mut self, window_width: f32, window_height: f32, device_px_ratio: f32, )
Begin rendering.
Sourcepub fn encode(&mut self, render_pass: &RenderPassDescriptor<'_>)
pub fn encode(&mut self, render_pass: &RenderPassDescriptor<'_>)
Encode all rendering to a command buffer.
Sourcepub fn fill_circle<Pt: Into<LocalPoint>>(
&mut self,
center: Pt,
radius: f32,
paint_index: PaintIndex,
)
pub fn fill_circle<Pt: Into<LocalPoint>>( &mut self, center: Pt, radius: f32, paint_index: PaintIndex, )
Fills a circle.
Sourcepub fn stroke_arc<Pt: Into<LocalPoint>>(
&mut self,
center: Pt,
radius: f32,
width: f32,
rotation: f32,
aperture: f32,
paint_index: PaintIndex,
)
pub fn stroke_arc<Pt: Into<LocalPoint>>( &mut self, center: Pt, radius: f32, width: f32, rotation: f32, aperture: f32, paint_index: PaintIndex, )
Strokes an arc.
Sourcepub fn fill_rect<Rect: Into<LocalRect>>(
&mut self,
rect: Rect,
radius: f32,
paint_index: PaintIndex,
blur_radius: f32,
)
pub fn fill_rect<Rect: Into<LocalRect>>( &mut self, rect: Rect, radius: f32, paint_index: PaintIndex, blur_radius: f32, )
Fills a rectangle.
Sourcepub fn stroke_rect(
&mut self,
min: LocalPoint,
max: LocalPoint,
radius: f32,
width: f32,
paint_index: PaintIndex,
)
pub fn stroke_rect( &mut self, min: LocalPoint, max: LocalPoint, radius: f32, width: f32, paint_index: PaintIndex, )
Strokes a rectangle.
Sourcepub fn stroke_segment<Pt: Into<LocalPoint>>(
&mut self,
a: Pt,
b: Pt,
width: f32,
paint_index: PaintIndex,
)
pub fn stroke_segment<Pt: Into<LocalPoint>>( &mut self, a: Pt, b: Pt, width: f32, paint_index: PaintIndex, )
Strokes a line segment.
Sourcepub fn stroke_bezier<Pt: Into<LocalPoint>>(
&mut self,
a: Pt,
b: Pt,
c: Pt,
width: f32,
paint_index: PaintIndex,
)
pub fn stroke_bezier<Pt: Into<LocalPoint>>( &mut self, a: Pt, b: Pt, c: Pt, width: f32, paint_index: PaintIndex, )
Strokes a quadratic bezier segment.
Sourcepub fn move_to<Pt: Into<LocalPoint>>(&mut self, p: Pt)
pub fn move_to<Pt: Into<LocalPoint>>(&mut self, p: Pt)
Move the pen to a point (path fills only)
Sourcepub fn quad_to<Pt: Into<LocalPoint>>(&mut self, b: Pt, c: Pt)
pub fn quad_to<Pt: Into<LocalPoint>>(&mut self, b: Pt, c: Pt)
Makes a quadratic curve to a point (path fills only)
Sourcepub fn fill(&mut self, paint_index: PaintIndex)
pub fn fill(&mut self, paint_index: PaintIndex)
Fills a path.
pub fn render_glyph( &mut self, x: f32, y: f32, font_id: ID, glyph_id: u16, size: u32, subpx: (SubpixelBin, SubpixelBin), image: impl FnOnce() -> SwashImage, paint_index: PaintIndex, )
pub fn render_image( &mut self, x: f32, y: f32, hash: &[u8], width: u32, height: u32, image_fn: impl FnOnce() -> Image, )
pub fn render_svg( &mut self, x: f32, y: f32, hash: &[u8], width: u32, height: u32, image: impl FnOnce() -> Vec<u8>, paint_index: Option<PaintIndex>, )
Sourcepub fn translate<Vec: Into<LocalVector>>(&mut self, offset: Vec)
pub fn translate<Vec: Into<LocalVector>>(&mut self, offset: Vec)
Translates the coordinate system.
Sourcepub fn scale<Vec: Into<LocalVector>>(&mut self, scale: Vec)
pub fn scale<Vec: Into<LocalVector>>(&mut self, scale: Vec)
Scales the coordinate system.
pub fn set_z_index(&mut self, z_index: i32)
Sourcepub fn current_transform(&self) -> LocalToWorld
pub fn current_transform(&self) -> LocalToWorld
Gets the current transform.
Sourcepub fn reset_scissor(&mut self)
pub fn reset_scissor(&mut self)
Resets the current scissor rect.
Sourcepub fn color_paint(&mut self, color: Color) -> PaintIndex
pub fn color_paint(&mut self, color: Color) -> PaintIndex
Solid color paint.
Sourcepub fn linear_gradient<Pt: Into<LocalPoint>>(
&mut self,
start: Pt,
end: Pt,
inner_color: Color,
outer_color: Color,
glow: f32,
) -> PaintIndex
pub fn linear_gradient<Pt: Into<LocalPoint>>( &mut self, start: Pt, end: Pt, inner_color: Color, outer_color: Color, glow: f32, ) -> PaintIndex
Linear gradient paint.
Sourcepub fn create_image_pixels(
&mut self,
data: &[u8],
width: u32,
height: u32,
) -> ImageIndex
pub fn create_image_pixels( &mut self, data: &[u8], width: u32, height: u32, ) -> ImageIndex
Create an image from pixel data in memory. Must be RGBA8.
pub fn delete_image(&mut self, image: ImageIndex)
Auto Trait Implementations§
impl !Freeze for Vger
impl !RefUnwindSafe for Vger
impl Send for Vger
impl Sync for Vger
impl Unpin for Vger
impl !UnwindSafe for Vger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more