package brr

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module C2d.PathSource

Path2D objects.

Sourcetype t

The type for Path2D objects.

Sourceval create : unit -> t

create () is a new empty path.

Sourceval of_svg : Jstr.t -> t

of_svg p is a path from the SVG path data p.

Sourceval of_path : t -> t

of_path p is a copy of p.

Sourceval add : ?tr:Matrix4.t -> t -> t -> unit

add p ~tr p' adds path p' transformed by tr to p.

Sourceval close : t -> unit

close p closes path p.

Sourceval move_to : t -> x:float -> y:float -> unit

move_to p x y moves to (x,y).

Sourceval line_to : t -> x:float -> y:float -> unit

line_to p x y lines to (x,y).

Sourceval qcurve_to : t -> cx:float -> cy:float -> x:float -> y:float -> unit

qcurve_to p ~cx ~cy x y is a quadratic curve to (x,y) with control point (cx,cy).

Sourceval ccurve_to : t -> cx:float -> cy:float -> cx':float -> cy':float -> x:float -> y:float -> unit

ccurve_to p ~cx ~cy ~cx' ~cy' x y is a cubic bezier curve to (x,y) with control point (cx,cy) and (cx',cy').

Sourceval arc_to : t -> cx:float -> cy:float -> cx':float -> cy':float -> r:float -> unit

arc_to p ~cx ~cy ~cx' ~cy' r is a circular arc with control points (cx,cy), (cx',cy') and radius r.

Sourceval arc : ?anticlockwise:bool -> t -> cx:float -> cy:float -> r:float -> start:float -> stop:float -> unit

arc p ~anticlockwise ~cx ~cy ~r ~start ~stop is a circular arc centered on (cx,cy) with radius r starting at angle start and stopping at stop.

Sourceval rect : t -> x:float -> y:float -> w:float -> h:float -> unit

react p x y ~w ~h is a rectangle with top-left corner (x,y) extending down by w units and right by h units (or the opposite directions with negative values).

Sourceval ellipse : ?anticlockwise:bool -> t -> cx:float -> cy:float -> rx:float -> ry:float -> rot:float -> start:float -> stop:float -> unit

ellipse p ~anticlockwise ~cx ~cy ~rot ~rx ~ry ~start ~stop is an elliptical arc centered on (cx,cy) with radii (rx,ry) rotated by rot starting at angle start and stopping at stop.

OCaml

Innovation. Community. Security.