Skip to contents

Create a backend device contract

Usage

device_backend(begin, end, draw, push_clip, pop_clip, svg, save)

Arguments

begin

Function called with width_mm and height_mm before rendering.

end

Function called after rendering completes.

draw

Function called as draw(shape, data, resolved_aes) for each primitive.

push_clip

Function called as push_clip(box) when entering a clipped viewport.

pop_clip

Function called when leaving a clipped viewport.

svg

Function returning a serialized representation of the device output.

save

Function called as save(path) to write device output to disk.

Value

A device_backend object.