47#define BU_COLOR_INDEX_RED 0
48#define BU_COLOR_INDEX_GREEN 1
49#define BU_COLOR_INDEX_BLUE 2
50#define BU_COLOR_INDEX_ALPHA 3
56#define BU_COLOR_INDEX_HUE 0
57#define BU_COLOR_INDEX_SATURATION 1
58#define BU_COLOR_INDEX_VALUE 2
68#define BU_COLOR_NULL ((struct bu_color *) 0)
93#define BU_COLOR_INIT(_c) { \
94 (_c)->buc_rgb[RED] = (_c)->buc_rgb[GRN] = (_c)->buc_rgb[BLU] = 0; (_c)->buc_rgb[ALP] = 0; \
100#define BU_COLOR_NEAR_EQUAL(_c1, _c2, _tol) \
101 HNEAR_EQUAL(_c1.buc_rgb, _c2.buc_rgb, _tol)
108#define BU_COLOR_INIT_ZERO {{0, 0, 0, 0}}
111#define BU_COLOR_BLUE {{0, 0, 1, 0}}
112#define BU_COLOR_CYAN {{0, 1, 1, 0}}
113#define BU_COLOR_GREEN {{0, 1, 0, 0}}
114#define BU_COLOR_PURPLE {{1, 0, 1, 0}}
115#define BU_COLOR_RED {{1, 0, 0, 0}}
116#define BU_COLOR_WHITE {{1, 1, 1, 0}}
117#define BU_COLOR_YELLOW {{1, 1, 0, 0}}
122#define BU_COLOR_CPY(_dest, _src) {\
123 (_dest)->buc_rgb[RED] = (_src)->buc_rgb[RED]; \
124 (_dest)->buc_rgb[GRN] = (_src)->buc_rgb[GRN]; \
125 (_dest)->buc_rgb[BLU] = (_src)->buc_rgb[BLU]; \
126 (_dest)->buc_rgb[ALP] = (_src)->buc_rgb[ALP]; \
Header file for the BRL-CAD common definitions.
int bu_color_convert(const double in[4], bu_color_space_t in_space, bu_color_space_t out_space, double out[4])
int bu_color_to_rgb_ints(const struct bu_color *cp, int *r, int *g, int *b)
int bu_color_from_str(struct bu_color *cp, const char *str)
int bu_color_from_rgb_floats(struct bu_color *cp, const fastf_t *rgb)
enum bu_color_format bu_color_format_t
void bu_rgb_to_hsv(const unsigned char *rgb, fastf_t *hsv)
int bu_str_to_rgb(const char *str, unsigned char *rgb)
int bu_hsv_to_rgb(const fastf_t *hsv, unsigned char *rgb)
int bu_color_from_rgb_chars(struct bu_color *cp, const unsigned char *rgb)
int bu_color_rand(struct bu_color *c, bu_color_rand_t type)
enum bu_color_space bu_color_space_t
int bu_color_to_rgb_chars(const struct bu_color *cp, unsigned char *rgb)
int bu_color_to_rgb_floats(const struct bu_color *cp, fastf_t *rgb)
int bu_color_parse(const char *str, struct bu_color *color)
@ BU_COLOR_RANDOM_LIGHTENED
double fastf_t
fastest 64-bit (or larger) floating point type
fastf_t hvect_t[ELEMENTS_PER_HVECT]
4-tuple vector
Global registry of recognized magic numbers.
fundamental vector, matrix, quaternion math macros