BRL-CAD
Loading...
Searching...
No Matches
color.h File Reference
#include "common.h"
#include "vmath.h"
#include "bu/defines.h"
#include "bu/magic.h"
Include dependency graph for color.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bu_color
 

Macros

#define RED   0
 
#define GRN   1
 
#define BLU   2
 
#define ALP   3
 
#define BU_COLOR_INDEX_RED   0
 
#define BU_COLOR_INDEX_GREEN   1
 
#define BU_COLOR_INDEX_BLUE   2
 
#define BU_COLOR_INDEX_ALPHA   3
 
#define HUE   0
 
#define SAT   1
 
#define VAL   2
 
#define BU_COLOR_INDEX_HUE   0
 
#define BU_COLOR_INDEX_SATURATION   1
 
#define BU_COLOR_INDEX_VALUE   2
 
#define BU_COLOR_NULL   ((struct bu_color *) 0)
 
#define BU_COLOR_INIT(_c)
 
#define BU_COLOR_NEAR_EQUAL(_c1, _c2, _tol)    HNEAR_EQUAL(_c1.buc_rgb, _c2.buc_rgb, _tol)
 
#define BU_COLOR_INIT_ZERO   {{0, 0, 0, 0}}
 
#define BU_COLOR_BLUE   {{0, 0, 1, 0}}
 
#define BU_COLOR_CYAN   {{0, 1, 1, 0}}
 
#define BU_COLOR_GREEN   {{0, 1, 0, 0}}
 
#define BU_COLOR_PURPLE   {{1, 0, 1, 0}}
 
#define BU_COLOR_RED   {{1, 0, 0, 0}}
 
#define BU_COLOR_WHITE   {{1, 1, 1, 0}}
 
#define BU_COLOR_YELLOW   {{1, 1, 0, 0}}
 
#define BU_COLOR_CPY(_dest, _src)
 

Typedefs

typedef struct bu_color bu_color_t
 
typedef enum bu_color_space bu_color_space_t
 
typedef enum bu_color_format bu_color_format_t
 

Enumerations

enum  bu_color_space { BU_COLOR_SPACE_RGB = 0 , BU_COLOR_SPACE_HSL , BU_COLOR_SPACE_HSV }
 
enum  bu_color_format {
  BU_COLOR_FORMAT_RGB = 0 , BU_COLOR_FORMAT_RGBA , BU_COLOR_FORMAT_HEX , BU_COLOR_FORMAT_HEXA ,
  BU_COLOR_FORMAT_HSL , BU_COLOR_FORMAT_HSLA , BU_COLOR_FORMAT_HSV , BU_COLOR_FORMAT_HSVA ,
  BU_COLOR_FORMAT_NAME
}
 
enum  bu_color_rand_t { BU_COLOR_RANDOM = 0 , BU_COLOR_RANDOM_LIGHTENED }
 

Functions

int bu_color_rand (struct bu_color *c, bu_color_rand_t type)
 
void bu_rgb_to_hsv (const unsigned char *rgb, fastf_t *hsv)
 
int bu_hsv_to_rgb (const fastf_t *hsv, unsigned char *rgb)
 
int bu_color_parse (const char *str, struct bu_color *color)
 
int bu_color_format (const struct bu_color *color, bu_color_format_t format, struct bu_vls *output)
 
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_from_rgb_floats (struct bu_color *cp, const fastf_t *rgb)
 
int bu_color_from_rgb_chars (struct bu_color *cp, const unsigned char *rgb)
 
int bu_color_from_str (struct bu_color *cp, const char *str)
 
int bu_str_to_rgb (const char *str, unsigned char *rgb)
 
int bu_color_to_rgb_floats (const struct bu_color *cp, fastf_t *rgb)
 
int bu_color_to_rgb_chars (const struct bu_color *cp, unsigned char *rgb)
 
int bu_color_to_rgb_ints (const struct bu_color *cp, int *r, int *g, int *b)