/usr/lib/ocaml/camlimages/color.mli is in libcamlimages-ocaml-dev 1:4.2.0-1.1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
(* François Pessaux, projet Cristal, INRIA Rocquencourt *)
(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)
(* Jun Furuse, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1999-2004, *)
(* Institut National de Recherche en Informatique et en Automatique. *)
(* Distributed only by permission. *)
(* *)
(***********************************************************************)
(* $Id: color.mli,v 1.1 2006/11/28 15:43:28 rousse Exp $ *)
(** Definition of colormaps, i.e. mappings from real RGB colors to
integers. The integer corresponding to a color [c] is an index [i]
into a vector of colors whose [i]th element is [c]. *)
exception Too_many_colors;;
type 'a map = { mutable max : int; mutable map : 'a array };;
(** This is copied in Images also *)
(** Colormap manipulation functions *)
val size : 'a map -> int;;
(** Returns the size of a colormap. *)
val find_exact : 'a map -> 'a -> int;;
(** Finds a color in the colormap and returns its color index.
Raises exception [Not_found] if the color is not in the colormap. *)
val add_color : 'a map -> 'a -> int;;
(** Add a new color into the given colormap and return its index.
If the color is already in the colormap, it is not
added again, and the corresponding color index is returned. *)
val add_colors : 'a map -> 'a list -> int list;;
(** Add the list of new colors into the given colormap and return
their indices. If a color is already in the colormap, it is not
added again, and the corresponding color index is returned. *)
val copy : 'a map -> 'a map;;
(** Copy a colormap *)
(*
val find_nearest : 'a map -> 'a -> int;;
(* [find_nearest m c] finds the color [co] that is the nearest to
[c] color into the colormap [m].
Returns the color index of [co] and the distance between [c]
and [co]. *)
(* this is defined inside each color model implementation *)
*)
module Rgb : sig
type t = { mutable r : int; mutable g : int; mutable b : int }
val square_distance : t -> t -> int
val plus : t -> t -> t
val minus : t -> t -> t
val size : t map -> int
val find_exact : t map -> t -> int
val add_color : t map -> t -> int
val add_colors : t map -> t list -> int list
val find_nearest : t map -> t -> int
end;;
type rgb = Rgb.t = { mutable r : int; mutable g : int; mutable b : int };;
(* This is copied in Images also *)
(* R(ed), G(reen), B(lue) representation of colors. *)
module Rgba : sig
type t = { color : rgb; mutable alpha : int; }
val square_distance : t -> t -> int
val plus : t -> t -> t
val minus : t -> t -> t
val merge : t -> t -> t
val size : t map -> int
val find_exact : t map -> t -> int
val add_color : t map -> t -> int
val add_colors : t map -> t list -> int list
val find_nearest : t map -> t -> int
end;;
type rgba = Rgba.t = { color: rgb; mutable alpha : int; };;
(** RGB with alpha (transparent) information *)
module Cmyk :
sig
type t = {mutable c : int; mutable m : int; mutable y : int;
mutable k : int }
val square_distance : t -> t -> int
val plus : t -> t -> t
val minus : t -> t -> t
val size : t map -> int
val find_exact : t map -> t -> int
val add_color : t map -> t -> int
val add_colors : t map -> t list -> int list
val find_nearest : t map -> t -> int
end;;
type cmyk = Cmyk.t =
{ mutable c : int; mutable m : int; mutable y : int; mutable k : int; };;
(** Cyan Magenta Yellow blacK color model *)
(** Rgb specialized functions (for backward compatibility) *)
val rgb_square_distance : rgb -> rgb -> int;;
(** Compute the distance between two colours. *)
val plus : rgb -> rgb -> rgb;;
val minus : rgb -> rgb -> rgb;;
val brightness : rgb -> int;;
(********************************************************* Color name parser *)
val color_parse : string -> rgb;;
val colormap_parse : string array -> rgb array * int;;
|