aboutsummaryrefslogtreecommitdiff
path: root/script.it/layer/repr.ml
blob: 4bc5520784c51cb7344e1e81f88c5ca767fc398a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module Path = Script_path

module type PRINTER = sig
  type t

  val create : unit -> t

  (* Start a new path. *)
  val move_to : Gg.v2 -> t -> t

  val line_to : Gg.v2 -> t -> t

  val quadratic_to : Gg.v2 -> Gg.v2 -> Gg.v2 -> t -> t
  (** [quadratic_to ctrl0 ctrl1 p1] create a quadratic curve from the current
      point to [p1], with control points [ctrl0] and [ctrl1] *)

  val close : t -> t
  (** Request for the path to be closed *)
end

module type ENGINE = sig
  type t

  type point = Path.Point.t

  type repr

  val get : t -> repr

  val create_path : (repr -> repr) -> t

  val start : point -> point -> t -> t

  val line_to : point * point -> point * point -> t -> t

  val quadratic_to :
    point * Gg.v2 * Gg.v2 * point -> point * Gg.v2 * Gg.v2 * point -> t -> t

  val stop : t -> t
end