/misc/src/release/graphviz-2.18-1/src/graphviz-2.18/lib/common/color.h

Go to the documentation of this file.
00001 /* $Id: color.h,v 1.5 2006/12/07 23:42:18 erg Exp $ $Revision: 1.5 $ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /**********************************************************
00005 *      This software is part of the graphviz package      *
00006 *                http://www.graphviz.org/                 *
00007 *                                                         *
00008 *            Copyright (c) 1994-2004 AT&T Corp.           *
00009 *                and is licensed under the                *
00010 *            Common Public License, Version 1.0           *
00011 *                      by AT&T Corp.                      *
00012 *                                                         *
00013 *        Information and Software Systems Research        *
00014 *              AT&T Research, Florham Park NJ             *
00015 **********************************************************/
00016 
00017 #ifndef GV_COLOR_H
00018 #define GV_COLOR_H
00019 
00020 /* #include "arith.h" */
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 typedef struct hsvrgbacolor_t {
00027     char *name;
00028     unsigned char h, s, v;
00029     unsigned char r, g, b, a;
00030 } hsvrgbacolor_t;
00031 
00032 /* possible representations of color in gvcolor_t */
00033 typedef enum { HSVA_DOUBLE, RGBA_BYTE, RGBA_WORD, CMYK_BYTE,
00034                 RGBA_DOUBLE, COLOR_STRING, COLOR_INDEX } color_type_t;
00035 
00036 /* gvcolor_t can hold a color spec in a choice or representations */
00037 typedef struct color_s {
00038     union {
00039         double RGBA[4];
00040         double HSVA[4];
00041         unsigned char rgba[4];
00042         unsigned char cmyk[4];
00043         int rrggbbaa[4];
00044         char *string;
00045         int index;
00046     } u;
00047     color_type_t type;
00048 } gvcolor_t;
00049 
00050 #define COLOR_MALLOC_FAIL -1
00051 #define COLOR_UNKNOWN 1
00052 #define COLOR_OK 0
00053 
00054 #ifdef __cplusplus
00055 }
00056 #endif
00057 #endif

Generated on Mon Mar 31 19:03:24 2008 for Graphviz by  doxygen 1.5.1