File: gradient.mli

package info (click to toggle)
advi 1.6.0-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 17,416 kB
  • ctags: 2,825
  • sloc: ml: 12,261; sh: 1,500; ansic: 935; makefile: 738; perl: 57; tcl: 10
file content (80 lines) | stat: -rw-r--r-- 3,369 bytes parent folder | download | duplicates (4)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
(***********************************************************************)
(*                                                                     *)
(*                             Active-DVI                              *)
(*                                                                     *)
(*                   Projet Cristal, INRIA Rocquencourt                *)
(*                                                                     *)
(*  Copyright 2003 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the GNU Lesser General Public License.          *)
(*                                                                     *)
(*  Pierre Weis                                                        *)
(*                                                                     *)
(*  Filling rectangles and arcs with gradients.                        *)
(*                                                                     *)
(***********************************************************************)

(* $Id: gradient.mli,v 1.1 2003/10/07 06:40:46 weis Exp $ *)

type x = int
and y = int;;
(** The types of coordinates in the library. *)

type r = int
and rx = int
and ry = int;;
(** The types of radius of graphical entities. *)

type from_angle = int
and to_angle = int;;
(** The types of angles of graphical entities. *)

type from_color = Graphics.color
and to_color = Graphics.color;;
(** The types of colors of graphical entities. *)

type w = int
and h = int;;
(** The types of width and height of graphical entities. *)

type rectangle_gradient_mode =
   | Rect_Horizontal of from_color * to_color
      (** Horizontal gradient. *)
   | Rect_Vertical of from_color * to_color
      (** Vertical gradient. *)
   | Rect_Diagonal1 of from_color * to_color
      (** Gradient along the first bissector of the rectangle. *)
   | Rect_Diagonal2 of from_color * to_color
      (** Gradient along the second bissector of the rectangle. *)
   | Rect_Centered of x * y * from_color * to_color
      (** Centered gradient. *)
   | Rect_Circular of x * y * from_color * to_color
      (** Circular gradient. *)
;;

(** Gradient modes to fill rectangles. Each mode specifies a gradient
    from [from_color] to [to_color], with the corresponding method.
    The [x] and [y] coordinates of constructors [Rect_Circular] and
    [Rect_Centered] are those of the gradient starting point. This
    point is supposed to be inside the rectangle. *)

type arc_gradient_mode =
   | Arc_Horizontal of from_color * to_color
      (** Horizontal gradient from c1 to c2 *)
   | Arc_Vertical of from_color * to_color
      (** Vertical gradient *)
   | Arc_Circular of from_color * to_color
      (** Circular gradient *)
;;
(** Gradient modes to fill arcs. Each mode specifies a gradient
    from [from_color] to [to_color], with the corresponding method. *)

val grad_arc : arc_gradient_mode ->
  x -> y -> rx -> ry -> from_angle -> to_angle -> unit;;
(** Fill an arc with the specified [arc_gradient_mode]. *)

val grad_circle : arc_gradient_mode -> x -> y -> r -> unit;;
(** Fill a circle with the specified [arc_gradient_mode]. *)

val grad_rect : rectangle_gradient_mode -> x -> y -> w -> h -> unit;;
(** Fill a rectangle with the specified  [rectangle_gradient_mode]. *)