Initial release of Maemo 5 port of gnuplot
[gnuplot] / src / getcolor.h
1 /*
2  * $Id: getcolor.h,v 1.9 2005/08/07 09:43:28 mikulik Exp $
3  */
4
5 /* GNUPLOT - getcolor.h */
6
7 /* Routines + constants for mapping interval [0,1] into another [0,1] to be
8  * used to get RGB triplets from gray (palette of smooth colours).
9  *
10  * Note: The code in getcolor.h,.c cannot be inside color.h,.c since gplt_x11.c
11  * compiles with getcolor.o, so it cannot load the other huge staff.
12  *
13  */
14
15 /*[
16  *
17  * Petr Mikulik, since December 1998
18  * Copyright: open source as much as possible
19  *
20 ]*/
21
22
23 #ifndef GETCOLOR_H
24 #define GETCOLOR_H
25
26 #include "syscfg.h"
27 #include "color.h"
28
29 enum color_models_id {
30     C_MODEL_RGB = 'r',
31     C_MODEL_HSV = 'h',
32     C_MODEL_CMY = 'c',
33     C_MODEL_YIQ = 'y',
34     C_MODEL_XYZ = 'x'
35 };
36
37
38 /* main gray --> rgb color mapping */
39 void rgb1_from_gray __PROTO(( double gray, rgb_color *color ));
40 void rgb255_from_rgb1 __PROTO(( rgb_color rgb1, rgb255_color *rgb255 ));
41 /* main gray --> rgb color mapping as above, with take care of palette maxcolors */
42 void rgb1maxcolors_from_gray __PROTO(( double gray, rgb_color *color ));
43 void rgb255maxcolors_from_gray __PROTO(( double gray, rgb255_color *rgb255 ));
44
45 /* used to (de-)serialize color/gradient information */
46 char *gradient_entry_to_str __PROTO(( gradient_struct *gs ));
47 void str_to_gradient_entry __PROTO(( char *s, gradient_struct *gs ));
48
49 /* check if two palettes p1 and p2 differ */
50 int palettes_differ __PROTO(( t_sm_palette *p1, t_sm_palette *p2 ));
51
52 /* construct minimal gradient to approximate palette */
53 gradient_struct *approximate_palette __PROTO(( t_sm_palette *palette, int maxsamples, double allowed_deviation, int *gradient_num ));
54
55 double GetColorValueFromFormula __PROTO((int formula, double x));
56
57 extern const char *ps_math_color_formulae[];
58
59 #endif /* GETCOLOR_H */
60
61 /* eof getcolor.h */