pub struct Vger {
pub glyph_cache: GlyphCache,
/* private fields */
}
Fields§
§glyph_cache: GlyphCache
Implementations§
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,
)
pub fn fill_rect<Rect: Into<LocalRect>>( &mut self, rect: Rect, radius: f32, paint_index: PaintIndex, )
Fills a rectangle.
Sourcepub fn fill_blurred_rect<Rect: Into<LocalRect>>(
&mut self,
rect: Rect,
radius: f32,
paint_index: PaintIndex,
blur_radius: f32,
)
pub fn fill_blurred_rect<Rect: Into<LocalRect>>( &mut self, rect: Rect, radius: f32, paint_index: PaintIndex, blur_radius: f32, )
Fills a blurred 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.
Sourcepub fn text(
&mut self,
text: &str,
size: u32,
color: Color,
max_width: Option<f32>,
)
pub fn text( &mut self, text: &str, size: u32, color: Color, max_width: Option<f32>, )
Renders text.
Sourcepub fn text_bounds(
&mut self,
text: &str,
size: u32,
max_width: Option<f32>,
) -> LocalRect
pub fn text_bounds( &mut self, text: &str, size: u32, max_width: Option<f32>, ) -> LocalRect
Calculates the bounds for text.
Sourcepub fn glyph_positions(
&mut self,
text: &str,
size: u32,
max_width: Option<f32>,
) -> Vec<LocalRect> ⓘ
pub fn glyph_positions( &mut self, text: &str, size: u32, max_width: Option<f32>, ) -> Vec<LocalRect> ⓘ
Returns local coordinates of glyphs.
pub fn line_metrics( &mut self, text: &str, size: u32, max_width: Option<f32>, ) -> Vec<LineMetrics>
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.
Sourcepub fn current_transform(&self) -> LocalToWorld
pub fn current_transform(&self) -> LocalToWorld
Gets the current transform.
Sourcepub fn rounded_scissor(&mut self, rect: LocalRect, radius: f32)
pub fn rounded_scissor(&mut self, rect: LocalRect, radius: f32)
Sets the current scissor to a rounded rect.
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