Renderers do their best to support
Vg's rendering model and semantics. However they may sometimes lack capabilities provided by
Vg's rendering model.
Whenever a renderer encounters an unsupported capability it ignores it and calls the
warn callback specified at renderer creation time. The documentation of renderers indicate which warnings they report.
type warning = [
The type for render warnings.
pp_warning ppf w prints a textual representation of
type warn = warning -> unit
The type for warning callbacks.
Some renderers support the specification of metadata as an XML XMP metadata packet (ISO 16684-1). The following convenience function returns a well-formed, correctly escaped, metadata packet according to the information you provide.
val xmp : ?title:string -> ?authors:string list -> ?subjects:string list -> ?description:string -> ?rights:string -> ?creator_tool:string -> ?create_date:float -> unit -> string
xmp title authors creator_tool subject description create_date is an XML XMP metadata packet.
titleis mapped to dc:title.
authorsis mapped to dc:creator.
subjectsis mapped to dc:subject.
descriptionis mapped to dc:description.
rightsis mapped to dc:rights.
creator_toolis mapped to xmp:CreatorTool.
create_date(a POSIX timestamp in seconds) is mapped to xmp:CreateDate.
A renderable specifies a finite view rectangle and a physical size for an image render. It implicitly defines the mapping between
Vg's coordinate space and the render target, see this section for more information.
The type for renderables. The physical size on the render target in millimeters, the view rectangle and the image to render.
The type for stored renderer destination. With a
`Manual destination the client must provide output storage see
type dst = [
The type for renderer destinations. Either a stored destination or an
`Other destination, usually denoting some kind of interactive renderer.
type 'a target constraint 'a = [< dst ]
The type for render targets. The type parameter specifies the supported type of destinations. Values of this type are provided by concrete renderer implementation.
type t = renderer
The type for renderers.
create limit warn target dst is a renderer using
target to render images to
warn is called whenever the renderer lacks a capability, see warnings.
limit limits the time spent in the
render function (defaults to
max_int, unlimited). The cost model may change in a future version of the library. For now each image combinator costs one unit, when the limit is reached
render returns with
render r v is:
`Manualdestination and needs more output storage or if
rhas a limit. In the first case the client must use
Manual.dstto provide a new buffer. In both cases the client should then call
`Okwhen the encoder is ready to encode a new
`Image(if the renderer supports it) or
`Manual destinations, encoding
`End always returns
`Partial the client should as usual use
Manual.dst and continue with
`Ok is returned at which point
r is guaranteed to be the size of the last provided buffer (i.e. nothing was written).
Semantics of multiple images render. The semantics of multiple image renders are left to the backend.
val renderer_limit : renderer -> int
renderer_limit r is
module Manual : sig ... end
Manual render destinations.
module Private : sig ... end
Private functions for implementing renderers.