summaryrefslogtreecommitdiff
path: root/ipl/gprocs/imgcolor.icn
blob: 39bba907029181de0720526afaa62b834043d350 (plain)
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
############################################################################
#
#	File:     imgcolor.icn
#
#	Subject:  Procedure to produce table of colors in area
#
#	Author:   Ralph E. Griswold
#
#	Date:     January 5, 1995
#
############################################################################
#
#   This file is in the public domain.
#
############################################################################
#
#   This procedure produces a table of all the colors in a specified
#   area of a window.  The value corresponding to a color key is
#   the number of pixels with that color
#
############################################################################
#
#  Requires:  Version 9 graphics
#
############################################################################

procedure imgcolor(win, x, y, w, h)
   local colors

   colors := table(0)

   every colors[Pixel(win, x, y, w, h)] +:= 1

   return colors

end