module Private:sig
..end
Warning.
Vg
users should not use these definitions, they exposes Vg
's
internals for implementing renderers. This functionality is
subject to change even between minor versions of the
library.
In order to provide a consistant interface for Vg
users,
renderer writers should follow the guidelines below. You may
want to drop an email to Daniel Bünzli <daniel.buenzl i@erratique.ch> for help and discussion.
Vgr_bla
(lowercase).Vgr_bla.target
.Vg.Vgr.render
function. If you
are writing a batch renderer provide support for each of the
Vg.Vgr.dst
types and especially the non-blocking interface.Vg.Vgr.xmp
.limit
parameter of Vg.Vgr.render
.Vg
's
coordinate system conventions to
specify the relationship between a target and the view
rectangle to render.Vg
's full rendering model or
diverges from its semantics it must ignore unsupported features
and warn the client via the Vg.Vgr.Private.warn
function.module Data:sig
..end
module Font:sig
..end
module P:sig
..end
module I:sig
..end
type
renderer
typek =
renderer -> [ `Ok | `Partial ]
typerender_fun =
[ `End | `Image of Gg.size2 * Gg.box2 * Data.image ] ->
k -> k
type[< Vg.Vgr.dst ]
render_target =renderer ->
([< Vg.Vgr.dst ] as 'a) -> bool * render_fun
val create_target : ([< Vg.Vgr.dst ] as 'a) render_target -> 'a Vg.Vgr.target
create_target t
makes an end-user render target from t
.val renderer : Vg.Vgr.t -> renderer
renderer r
is r
's internal representation.val limit : renderer -> int
limit r
is r
's render limit.val warn : renderer -> Vg.Vgr.warning -> unit
warn r w
reports the warning w
on r
.val partial : k -> renderer -> [> `Partial ]
partial k r
suspends the renderer r
and returns `Partial
.
Rendering will continue with k r
, on Vg.Vgr.render
`Await
.Vg.Vgr.dst_stored
destinationsval flush : k -> renderer -> [ `Ok | `Partial ]
flush k r
flushes the renderer r
. If r
writes
on a stored destination this function must be called
by the rendering function on `End
.val writeb : int -> k -> renderer -> [ `Ok | `Partial ]
writeb b k r
writes the byte b
and k
ontinues.val writes : string ->
int ->
int -> k -> renderer -> [ `Ok | `Partial ]
writes s j l k r
writes l
bytes from s
starting at j
and k
ontinues.val writebuf : Buffer.t ->
int ->
int -> k -> renderer -> [ `Ok | `Partial ]
writebuf buf j l k r
write l
bytes from buf
starting at j
and k
ontinues.val add_xml_data : Buffer.t -> string -> unit
add_xml_data b s
adds s
to b
, escapes
'<', '>', '&'
and '"'
(but not single quotes) and
maps illegal XML unicode characters to the replacement character
U+FFFD.