sig
module Font :
sig
type weight =
[ `W100
| `W200
| `W300
| `W400
| `W500
| `W600
| `W700
| `W800
| `W900 ]
type slant = [ `Italic | `Normal | `Oblique ]
type t = {
name : string;
slant : Vg.Font.slant;
weight : Vg.Font.weight;
size : float;
}
val equal : Vg.Font.t -> Vg.Font.t -> bool
val equal_f :
(float -> float -> bool) -> Vg.Font.t -> Vg.Font.t -> bool
val compare : Vg.Font.t -> Vg.Font.t -> int
val compare_f :
(float -> float -> int) -> Vg.Font.t -> Vg.Font.t -> int
val to_string : Vg.Font.t -> string
val pp : Format.formatter -> Vg.Font.t -> unit
end
type font = Vg.Font.t
type glyph = int
type path
type image
val ( >> ) : 'a -> ('a -> 'b) -> 'b
module P :
sig
type cap = [ `Butt | `Round | `Square ]
type join = [ `Bevel | `Miter | `Round ]
type dashes = float * float list
type outline = {
width : float;
cap : Vg.P.cap;
join : Vg.P.join;
miter_angle : float;
dashes : Vg.P.dashes option;
}
val o : Vg.P.outline
val pp_outline : Format.formatter -> Vg.P.outline -> unit
type area = [ `Aeo | `Anz | `O of Vg.P.outline ]
val pp_area : Format.formatter -> Vg.P.area -> unit
type t = Vg.path
val empty : Vg.path
val sub : ?rel:bool -> Gg.p2 -> Vg.path -> Vg.path
val line : ?rel:bool -> Gg.p2 -> Vg.path -> Vg.path
val qcurve : ?rel:bool -> Gg.p2 -> Gg.p2 -> Vg.path -> Vg.path
val ccurve : ?rel:bool -> Gg.p2 -> Gg.p2 -> Gg.p2 -> Vg.path -> Vg.path
val earc :
?rel:bool ->
?large:bool ->
?cw:bool -> ?angle:float -> Gg.size2 -> Gg.p2 -> Vg.path -> Vg.path
val close : Vg.path -> Vg.path
val circle : ?rel:bool -> Gg.p2 -> float -> Vg.path -> Vg.path
val ellipse :
?rel:bool -> ?angle:float -> Gg.p2 -> Gg.size2 -> Vg.path -> Vg.path
val rect : ?rel:bool -> Gg.box2 -> Vg.path -> Vg.path
val rrect : ?rel:bool -> Gg.box2 -> Gg.size2 -> Vg.path -> Vg.path
val last_pt : Vg.path -> Gg.p2
val append : Vg.path -> Vg.path -> Vg.path
val tr : Gg.m3 -> Vg.path -> Vg.path
type fold =
[ `Ccurve of Gg.p2 * Gg.p2 * Gg.p2
| `Close
| `Earc of bool * bool * float * Gg.size2 * Gg.p2
| `Line of Gg.p2
| `Qcurve of Gg.p2 * Gg.p2
| `Sub of Gg.p2 ]
val fold : ?rev:bool -> ('a -> Vg.P.fold -> 'a) -> 'a -> Vg.path -> 'a
val is_empty : Vg.path -> bool
val equal : Vg.path -> Vg.path -> bool
val equal_f : (float -> float -> bool) -> Vg.path -> Vg.path -> bool
val compare : Vg.path -> Vg.path -> int
val compare_f : (float -> float -> int) -> Vg.path -> Vg.path -> int
val to_string : Vg.path -> string
val pp : Format.formatter -> Vg.path -> unit
val pp_f :
(Format.formatter -> float -> unit) ->
Format.formatter -> Vg.path -> unit
end
module I :
sig
type t = Vg.image
val void : Vg.image
val const : Gg.color -> Vg.image
val axial : Gg.Color.stops -> Gg.p2 -> Gg.p2 -> Vg.image
val radial : Gg.Color.stops -> ?f:Gg.p2 -> Gg.p2 -> float -> Vg.image
val cut : ?area:Vg.P.area -> Vg.path -> Vg.image -> Vg.image
val cut_glyphs :
?area:[ `O of Vg.P.outline ] ->
?text:string ->
?blocks:bool * (int * int) list ->
?advances:Gg.v2 list ->
Vg.font -> Vg.glyph list -> Vg.image -> Vg.image
val blend : Vg.image -> Vg.image -> Vg.image
val move : Gg.v2 -> Vg.image -> Vg.image
val rot : float -> Vg.image -> Vg.image
val scale : Gg.v2 -> Vg.image -> Vg.image
val tr : Gg.m3 -> Vg.image -> Vg.image
val is_void : Vg.image -> bool
val equal : Vg.image -> Vg.image -> bool
val equal_f : (float -> float -> bool) -> Vg.image -> Vg.image -> bool
val compare : Vg.image -> Vg.image -> int
val compare_f : (float -> float -> int) -> Vg.image -> Vg.image -> int
val to_string : Vg.image -> string
val pp : Format.formatter -> Vg.image -> unit
val pp_f :
(Format.formatter -> float -> unit) ->
Format.formatter -> Vg.image -> unit
end
type renderer
module Vgr :
sig
type warning =
[ `Other of string
| `Textless_glyph_cut of Vg.I.t
| `Unsupported_cut of Vg.P.area * Vg.I.t
| `Unsupported_glyph_cut of Vg.P.area * Vg.I.t ]
val pp_warning : Format.formatter -> Vg.Vgr.warning -> unit
type warn = Vg.Vgr.warning -> unit
val xmp :
?title:string ->
?authors:string list ->
?subjects:string list ->
?description:string ->
?rights:string ->
?creator_tool:string -> ?create_date:float -> unit -> string
type renderable = Gg.size2 * Gg.box2 * Vg.image
type dst_stored =
[ `Buffer of Buffer.t
| `Channel of Pervasives.out_channel
| `Manual ]
type dst =
[ `Buffer of Buffer.t
| `Channel of Pervasives.out_channel
| `Manual
| `Other ]
type 'a target constraint 'a = [< Vg.Vgr.dst ]
type t = Vg.renderer
val create :
?limit:int ->
?warn:Vg.Vgr.warn ->
([< Vg.Vgr.dst ] as 'a) Vg.Vgr.target -> 'a -> Vg.renderer
val render :
Vg.renderer ->
[< `Await | `End | `Image of Vg.Vgr.renderable ] ->
[ `Ok | `Partial ]
val renderer_dst : Vg.renderer -> Vg.Vgr.dst
val renderer_limit : Vg.renderer -> int
module Manual :
sig
val dst : Vg.renderer -> string -> int -> int -> unit
val dst_rem : Vg.renderer -> int
end
module Private :
sig
module Data :
sig
type segment =
[ `Ccurve of Gg.p2 * Gg.p2 * Gg.p2
| `Close
| `Earc of bool * bool * float * Gg.size2 * Gg.p2
| `Line of Gg.p2
| `Qcurve of Gg.p2 * Gg.p2
| `Sub of Gg.p2 ]
type path = Vg.Vgr.Private.Data.segment list
val of_path : Vg.P.t -> Vg.Vgr.Private.Data.path
type tr =
Move of Gg.v2
| Rot of float
| Scale of Gg.v2
| Matrix of Gg.m3
val tr_to_m3 : Vg.Vgr.Private.Data.tr -> Gg.M3.t
val inv_tr_to_m3 : Vg.Vgr.Private.Data.tr -> Gg.M3.t
type blender =
[ `Atop | `Copy | `In | `Out | `Over | `Plus | `Xor ]
type primitive =
Const of Gg.color
| Axial of Gg.Color.stops * Gg.p2 * Gg.p2
| Radial of Gg.Color.stops * Gg.p2 * Gg.p2 * float
| Raster of Gg.box2 * Gg.raster
type glyph_run = {
font : Vg.font;
text : string option;
o : Gg.p2;
blocks : bool * (int * int) list;
advances : Gg.v2 list;
glyphs : Vg.glyph list;
}
type image =
Primitive of Vg.Vgr.Private.Data.primitive
| Cut of Vg.P.area * Vg.Vgr.Private.Data.path *
Vg.Vgr.Private.Data.image
| Cut_glyphs of Vg.P.area * Vg.Vgr.Private.Data.glyph_run *
Vg.Vgr.Private.Data.image
| Blend of Vg.Vgr.Private.Data.blender * float option *
Vg.Vgr.Private.Data.image * Vg.Vgr.Private.Data.image
| Tr of Vg.Vgr.Private.Data.tr * Vg.Vgr.Private.Data.image
val of_image : Vg.I.t -> Vg.Vgr.Private.Data.image
end
module Font :
sig
val css_font : unit:string -> Vg.font -> string
val css_weight : Vg.font -> string
val css_slant : Vg.font -> string
end
module P :
sig
val of_data : Vg.Vgr.Private.Data.path -> Vg.P.t
val earc_params :
Gg.p2 ->
large:bool ->
cw:bool ->
float ->
Gg.v2 -> Gg.p2 -> (Gg.p2 * Gg.m2 * float * float) option
val miter_limit : Vg.P.outline -> float
end
module I :
sig val of_data : Vg.Vgr.Private.Data.image -> Vg.I.t end
type renderer
type k = Vg.Vgr.Private.renderer -> [ `Ok | `Partial ]
type render_fun =
[ `End
| `Image of Gg.size2 * Gg.box2 * Vg.Vgr.Private.Data.image ] ->
Vg.Vgr.Private.k -> Vg.Vgr.Private.k
type 'a render_target =
Vg.Vgr.Private.renderer ->
'a -> bool * Vg.Vgr.Private.render_fun
constraint 'a = [< Vg.Vgr.dst ]
val create_target :
([< Vg.Vgr.dst ] as 'a) Vg.Vgr.Private.render_target ->
'a Vg.Vgr.target
val renderer : Vg.Vgr.t -> Vg.Vgr.Private.renderer
val limit : Vg.Vgr.Private.renderer -> int
val warn : Vg.Vgr.Private.renderer -> Vg.Vgr.warning -> unit
val partial :
Vg.Vgr.Private.k -> Vg.Vgr.Private.renderer -> [> `Partial ]
val flush :
Vg.Vgr.Private.k -> Vg.Vgr.Private.renderer -> [ `Ok | `Partial ]
val writeb :
int ->
Vg.Vgr.Private.k -> Vg.Vgr.Private.renderer -> [ `Ok | `Partial ]
val writes :
string ->
int ->
int ->
Vg.Vgr.Private.k -> Vg.Vgr.Private.renderer -> [ `Ok | `Partial ]
val writebuf :
Buffer.t ->
int ->
int ->
Vg.Vgr.Private.k -> Vg.Vgr.Private.renderer -> [ `Ok | `Partial ]
val add_xml_data : Buffer.t -> string -> unit
end
end
end