package kicadsch

  1. Overview
  2. Docs

A module able to paint a canvas with several graphic primitives and then to process the canvas into a picture file format. The functions are supposed to be pure

type t

the canvas of the painter

val paint_text : ?kolor:kolor -> String.t -> orientation -> coord -> size -> justify -> style -> t -> t

paint ?kolor text orient coord size justification style canvas adds a text with the given orient, size, justification and style at the given coord to canvas.

  • returns

    the modified canvas

val paint_line : ?kolor:kolor -> ?width:size -> coord -> coord -> t -> t

paint_line ?kolor width start end canvas paints a line with the given kolor and width between start and stop on canvas.

  • returns

    the modified canvas

val paint_circle : ?kolor:kolor -> ?fill:kolor -> coord -> int -> t -> t

paint_circle ?kolor center radius canvas paints a circle filled with the given kolor defined by center and radius on canvas.

  • returns

    the modified canvas

val paint_rect : ?kolor:kolor -> ?fill:kolor -> coord -> coord -> t -> t

paint_rect ?kolor corner1 corner2 canvas paints a rectangle filled with the given kolor defined by corner1 and corner2 on canvas.

  • returns

    the modified canvas

val paint_image : coord -> float -> Buffer.t -> t -> t

paint_image corner scale png canvas paints a png image filled at corner, scaled at scale on canvas.

  • returns

    the modified canvas

val paint_arc : ?kolor:kolor -> ?fill:kolor -> coord -> coord -> coord -> int -> t -> t

paint_arc ?kolor center start end radius canvas paints an arc filled with kolor between start and end of radius around center on canvas.

  • returns

    the modified canvas

val set_canevas_size : int -> int -> t -> t

set_canevas x y canvas set the size of the canevas

  • returns

    the modified canvas

val get_context : unit -> t

get_context ()

  • returns

    a new painting canvas

OCaml

Innovation. Community. Security.