vpype_viewer¶
This module implements a flexible, GPU-accelerated viewer for interactive and offscreen
rendering of vpype.Document
instances. It includes a Qt-based interactive backend as
well as a Pillow-based offscreen rendering backend.
Functions
Render a |
|
Show a viewer for the provided |
Classes
|
OpenGL-based rendering engine for |
|
Viewer engine wrapper class to render to a |
|
Full-featured, stand-alone viewer suitable for displaying a |
|
Type of unit to use for display purposes. |
|
View mode enum. |
Functions¶
- render_image(document: Document, size: tuple[int, int] = (512, 512), view_mode: ViewMode = ViewMode.PREVIEW, show_pen_up: bool = False, show_points: bool = False, default_pen_width: float = 1.1, default_pen_opacity: float = 0.8, override_pen_width: bool = False, override_pen_opacity: bool = False, show_ruler: bool = False, pixel_factor: float = 1.0, unit_type: UnitType = UnitType.METRIC, scale: float | None = None, origin: tuple[float, float] | None = None) Image ¶
Render a
vpype.Document
instance as a PillowPIL.Image.Image
.By default, the document is scaled and offset to entirely fit in the image. This behaviour can be overridden using the
scale
andoffset
arguments.- Parameters:
document (Document) -- document to render
show_pen_up (bool) -- render pen-up trajectories
show_points (bool) -- render points
default_pen_width (float) -- pen width (
ViewMode.PREVIEW
only)default_pen_opacity (float) -- pen opacity (
ViewMode.PREVIEW
only)override_pen_width (bool) -- override pen width property (
ViewMode.PREVIEW
only)override_pen_opacity (bool) -- override pen opacity property (
ViewMode.PREVIEW
only)show_ruler (bool) -- display the rulers
pixel_factor (float) -- pixel factor (HiDPI screen support)
unit_type (UnitType) -- type of unit to use for the ruler
scale (float | None) -- manually set scale
- Returns:
the rendered image
- Return type: