diff options
author | wlemb <wlemb> | 2001-10-05 21:45:23 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2001-10-05 21:45:23 +0000 |
commit | e8257944be52a8e1e07f5c80cecc487e88a35b50 (patch) | |
tree | 740ac630de162d3af109cb54fcf0c9bd057e5904 /src/include | |
parent | f0d222efb19a5fa01a8e8d5b3661afcea2e7c54d (diff) | |
download | groff-e8257944be52a8e1e07f5c80cecc487e88a35b50.tar.gz |
New files.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/color.h | 75 | ||||
-rw-r--r-- | src/include/geometry.h | 27 |
2 files changed, 102 insertions, 0 deletions
diff --git a/src/include/color.h b/src/include/color.h new file mode 100644 index 00000000..bd54be4d --- /dev/null +++ b/src/include/color.h @@ -0,0 +1,75 @@ +// -*- C++ -*- +/* Copyright (C) 2001 Free Software Foundation, Inc. + Written by Gaius Mulley <gaius@glam.ac.uk> + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +enum color_scheme {NONE, CMY, CMYK, RGB, GRAY}; + +// colors are internally held as CMYK values. + +class color { +private: + unsigned int cyan; + unsigned int magenta; + unsigned int yellow; + unsigned int black; + color_scheme scheme; // how was the color originally defined? + // and now the data structures necessary for the state machine + // inside the read routines + unsigned int color_space_num; // how many numbers have been read? + enum {REAL, HEX, UNDEFINED} encoding; + unsigned int hex_length; + unsigned int c[4]; + double d[4]; + + int read_encoding(const char *s, unsigned int n); + + public: + enum {MAX_COLOR_VAL = 0xffff}; + color(); + int is_equal(color *c); + int is_gray (void); + + void set_rgb(unsigned int r, unsigned int g, unsigned int b); + void set_cmy(unsigned int c, unsigned int m, unsigned int y); + void set_cmyk(unsigned int c, unsigned int m, + unsigned int y, unsigned int k); + void set_gray(unsigned int l); + + void set_rgb(double r, double g, double b); + void set_cmy(double c, double m, double y); + void set_cmyk(double c, double m, double y, double k); + void set_gray(double l); + + int read_rgb(const char *s); + int read_cmy(const char *s); + int read_cmyk(const char *s); + int read_gray(const char *s); + + void get_rgb(unsigned int *r, unsigned int *g, unsigned int *b); + void get_cmy(unsigned int *c, unsigned int *m, unsigned int *y); + void get_cmyk(unsigned int *c, unsigned int *m, + unsigned int *y, unsigned int *k); + void get_gray(unsigned int *l); + + void get_rgb(double *r, double *g, double *b); + void get_cmy(double *c, double *m, double *y); + void get_cmyk(double *c, double *m, double *y, double *k); + void get_gray(double *l); +}; diff --git a/src/include/geometry.h b/src/include/geometry.h new file mode 100644 index 00000000..d425f157 --- /dev/null +++ b/src/include/geometry.h @@ -0,0 +1,27 @@ +// -*- C++ -*- +/* Copyright (C) 2001 Free Software Foundation, Inc. + Written by Gaius Mulley <gaius@glam.ac.uk> + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +int adjust_arc_center(const int *, double *); +void check_output_arc_limits(int x, int y, + int xv1, int yv1, + int xv2, int yv2, + double c0, double c1, + int *minx, int *maxx, + int *miny, int *maxy); |