File: oColor.ml

package info (click to toggle)
camlimages 2.00-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,536 kB
  • ctags: 2,325
  • sloc: ml: 10,848; ansic: 2,396; makefile: 599; sh: 30
file content (31 lines) | stat: -rw-r--r-- 1,273 bytes parent folder | download
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
(***********************************************************************)
(*                                                                     *)
(*                           Objective Caml                            *)
(*                                                                     *)
(*            Jun Furuse, projet Cristal, INRIA Rocquencourt           *)
(*                                                                     *)
(*  Copyright 1999,2000,2001,2002,2001,2002                            *)
(*  Institut National de Recherche en Informatique et en Automatique.  *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)
open Color

class map cmap = object
  val obj = cmap
  method colormap = obj

  method max = obj.max
  method map = obj.map

  method query_rgb x = if x < size cmap then cmap.map.(x) else raise Not_found

  method set_max max = obj.max <- max
  method set_map map = obj.map <- map

  method size = size obj
  method find_exact = find_exact obj
  method find_nearest = find_exact obj
  method add_color = add_color obj
  method add_colors = add_colors obj
end