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, size=(512, 512), view_mode=<ViewMode.PREVIEW: 4>, show_pen_up=False, show_points=False, pen_width=1.1, pen_opacity=0.8, show_ruler=False, pixel_factor=1.0, unit_type=<UnitType.METRIC: 1>, scale=None, origin=None)¶
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 rendershow_pen_up (
bool
) -- render pen-up trajectoriesshow_points (
bool
) -- render pointspen_width (
float
) -- pen width (ViewMode.PREVIEW
only)pen_opacity (
float
) -- pen opacity (ViewMode.PREVIEW
only)show_ruler (
bool
) -- display the rulerspixel_factor (
float
) -- pixel factor (HiDPI screen support)unit_type (
UnitType
) -- type of unit to use for the rulerorigin (
Optional
[Tuple
[float
,float
]]) -- manually set origin
- Returns
the rendered image
- Return type
- show(document, view_mode=<ViewMode.PREVIEW: 4>, show_pen_up=False, show_points=False, argv=None)¶
Show a viewer for the provided
vpype.Document
instance.This function returns when the user close the window.