Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

open-axiom repository from github

24005 views
1
/*
2
Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
3
All rights reserved.
4
Copyright (C) 2007-2010, Gabriel Dos Reis
5
All rights reserved.
6
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions are
9
met:
10
11
- Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
14
- Redistributions in binary form must reproduce the above copyright
15
notice, this list of conditions and the following disclaimer in
16
the documentation and/or other materials provided with the
17
distribution.
18
19
- Neither the name of The Numerical ALgorithms Group Ltd. nor the
20
names of its contributors may be used to endorse or promote products
21
derived from this software without specific prior written permission.
22
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
26
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
27
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
#ifndef OPENAXIOM_SPADCOLORS_included
37
#define OPENAXIOM_SPADCOLORS_included
38
39
#include <X11/Xlib.h>
40
#include "rgb.h"
41
42
#define numOfColors 240
43
#define totalHuesConst 27
44
#define totalShadesConst 5
45
#define hueEnd 360
46
#define hueStep 12 /* hueEnd/totalHuesConst */
47
48
#define numPlanes 1
49
#define numColors 10
50
#define startColor 0
51
#define endColor (startColor+numColors)
52
53
#define colorStep ((maxColors+1)/numColors)
54
55
#define yes 1
56
#define no 0
57
58
#define smoothConst 50
59
#define saymem(a,b,c) saymemWithLine(a,b,c,0)
60
#define Colorcells 256 /* KF number of elements in permutation vector */
61
/* #define shade 5 */
62
#define saturation 0.8
63
64
extern RGB HSVtoRGB(HSV );
65
extern RGB HLStoRGB(HLS );
66
extern float value(float , float , float );
67
extern int makeColors(Display * , int , Colormap * , unsigned long * * , int * );
68
extern int makePermVector(Display * , int , unsigned long * * );
69
extern int makeNewColorMap(Display * , Colormap , int );
70
extern unsigned long XPixelColor(int );
71
extern void FreePixels(Display * , Colormap , int );
72
extern int AllocCells(Display * , Colormap , int );
73
74
extern int smoothHue;
75
extern Colormap colorMap;
76
extern int num;
77
extern int scrn;
78
79
#define maxColors DisplayCells(dsply,scrn)-1
80
81
#endif /* OPENAXIOM_SPADCOLORS_included */
82
83