2 * $Id: getcolor.h,v 1.9 2005/08/07 09:43:28 mikulik Exp $
5 /* GNUPLOT - getcolor.h */
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).
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.
17 * Petr Mikulik, since December 1998
18 * Copyright: open source as much as possible
29 enum color_models_id {
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 ));
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 ));
49 /* check if two palettes p1 and p2 differ */
50 int palettes_differ __PROTO(( t_sm_palette *p1, t_sm_palette *p2 ));
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 ));
55 double GetColorValueFromFormula __PROTO((int formula, double x));
57 extern const char *ps_math_color_formulae[];
59 #endif /* GETCOLOR_H */