Blender  V2.59
Defines | Functions
BLI_math_color.h File Reference

Go to the source code of this file.

Defines

#define BLI_XYZ_SMPTE   0
#define BLI_XYZ_REC709_SRGB   1
#define BLI_XYZ_CIE   2
#define BLI_PR_NONE   0
#define BLI_PR_SRGB   1
#define BLI_PR_REC709   2
#define BLI_YCC_ITU_BT601   0
#define BLI_YCC_ITU_BT709   1
#define BLI_YCC_JFIF_0_255   2

Functions

void hsv_to_rgb (float h, float s, float v, float *r, float *g, float *b)
void hex_to_rgb (char *hexcol, float *r, float *g, float *b)
void yuv_to_rgb (float y, float u, float v, float *lr, float *lg, float *lb)
void ycc_to_rgb (float y, float cb, float cr, float *lr, float *lg, float *lb, int colorspace)
void xyz_to_rgb (float x, float y, float z, float *r, float *g, float *b, int colorspace)
void cpack_to_rgb (unsigned int col, float *r, float *g, float *b)
void rgb_to_yuv (float r, float g, float b, float *ly, float *lu, float *lv)
void rgb_to_ycc (float r, float g, float b, float *ly, float *lcb, float *lcr, int colorspace)
void rgb_to_hsv (float r, float g, float b, float *lh, float *ls, float *lv)
void rgb_to_hsv_compat (float r, float g, float b, float *lh, float *ls, float *lv)
unsigned int rgb_to_cpack (float r, float g, float b)
unsigned int hsv_to_cpack (float h, float s, float v)
float rgb_to_grayscale (float rgb[3])
unsigned char rgb_to_grayscale_byte (unsigned char rgb[3])
void gamma_correct (float *c, float gamma)
float rec709_to_linearrgb (float c)
float linearrgb_to_rec709 (float c)
float srgb_to_linearrgb (float c)
float linearrgb_to_srgb (float c)
void srgb_to_linearrgb_v3_v3 (float *col_to, float *col_from)
void linearrgb_to_srgb_v3_v3 (float *col_to, float *col_from)
void srgb_to_linearrgb_rgba_buf (float *col, int tot)
void linearrgb_to_srgb_rgba_buf (float *col, int tot)
void srgb_to_linearrgb_rgba_rgba_buf (float *col_to, float *col_from, int tot)
void linearrgb_to_srgb_rgba_rgba_buf (float *col_to, float *col_from, int tot)
int constrain_rgb (float *r, float *g, float *b)
void minmax_rgb (short c[3])
void rgb_float_set_hue_float_offset (float *rgb, float hue_offset)
void rgb_byte_set_hue_float_offset (unsigned char *rgb, float hue_offset)
void lift_gamma_gain_to_asc_cdl (float *lift, float *gamma, float *gain, float *offset, float *slope, float *power)
void rgb_byte_to_float (const unsigned char *in, float *out)
void rgb_float_to_byte (const float *in, unsigned char *out)

Detailed Description

Definition in file BLI_math_color.h.


Define Documentation

#define BLI_PR_NONE   0
#define BLI_PR_REC709   2

Definition at line 47 of file BLI_math_color.h.

#define BLI_PR_SRGB   1

Definition at line 46 of file BLI_math_color.h.

#define BLI_XYZ_CIE   2

Definition at line 42 of file BLI_math_color.h.

Referenced by add_lamp(), and xyz_to_rgb().

#define BLI_XYZ_REC709_SRGB   1

Definition at line 41 of file BLI_math_color.h.

Referenced by xyz_to_rgb().

#define BLI_XYZ_SMPTE   0

Definition at line 40 of file BLI_math_color.h.

Referenced by xyz_to_rgb().

#define BLI_YCC_ITU_BT601   0
#define BLI_YCC_ITU_BT709   1
#define BLI_YCC_JFIF_0_255   2

Function Documentation

int constrain_rgb ( float *  r,
float *  g,
float *  b 
)

Definition at line 465 of file math_color.c.

References g, and simple_enum_gen::w.

void cpack_to_rgb ( unsigned int  col,
float *  r,
float *  g,
float *  b 
)

Definition at line 325 of file math_color.c.

void gamma_correct ( float *  c,
float  gamma 
)

Definition at line 361 of file math_color.c.

References powf.

void hex_to_rgb ( char *  hexcol,
float *  r,
float *  g,
float *  b 
)

Definition at line 183 of file math_color.c.

References CLAMP().

Referenced by do_hex_rna_cb().

unsigned int hsv_to_cpack ( float  h,
float  s,
float  v 
)

Definition at line 294 of file math_color.c.

References g, and hsv_to_rgb().

void hsv_to_rgb ( float  h,
float  s,
float  v,
float *  r,
float *  g,
float *  b 
)
void lift_gamma_gain_to_asc_cdl ( float *  lift,
float *  gamma,
float *  gain,
float *  offset,
float *  slope,
float *  power 
)

Definition at line 498 of file math_color.c.

References FLT_MAX.

float linearrgb_to_rec709 ( float  c)

Definition at line 374 of file math_color.c.

References powf.

float linearrgb_to_srgb ( float  c)
void linearrgb_to_srgb_rgba_buf ( float *  col,
int  tot 
)

Definition at line 421 of file math_color.c.

References linearrgb_to_srgb_v3_v3().

void linearrgb_to_srgb_rgba_rgba_buf ( float *  col_to,
float *  col_from,
int  tot 
)
void linearrgb_to_srgb_v3_v3 ( float *  col_to,
float *  col_from 
)
void minmax_rgb ( short  c[3])
float rec709_to_linearrgb ( float  c)

Definition at line 366 of file math_color.c.

References powf.

void rgb_byte_set_hue_float_offset ( unsigned char *  rgb,
float  hue_offset 
)

Referenced by get_seq_color3ubv().

void rgb_byte_to_float ( const unsigned char *  in,
float *  out 
)
void rgb_float_set_hue_float_offset ( float *  rgb,
float  hue_offset 
)
void rgb_float_to_byte ( const float *  in,
unsigned char *  out 
)
unsigned int rgb_to_cpack ( float  r,
float  g,
float  b 
)

Definition at line 311 of file math_color.c.

float rgb_to_grayscale ( float  rgb[3])

Definition at line 486 of file math_color.c.

Referenced by IMB_color_to_bw(), and shade_lamp_loop_only_shadow().

unsigned char rgb_to_grayscale_byte ( unsigned char  rgb[3])

Definition at line 491 of file math_color.c.

Referenced by IMB_color_to_bw().

void rgb_to_hsv ( float  r,
float  g,
float  b,
float *  lh,
float *  ls,
float *  lv 
)
void rgb_to_hsv_compat ( float  r,
float  g,
float  b,
float *  lh,
float *  ls,
float *  lv 
)
void rgb_to_ycc ( float  r,
float  g,
float  b,
float *  ly,
float *  lcb,
float *  lcr,
int  colorspace 
)
void rgb_to_yuv ( float  r,
float  g,
float  b,
float *  ly,
float *  lu,
float *  lv 
)
float srgb_to_linearrgb ( float  c)
void srgb_to_linearrgb_rgba_buf ( float *  col,
int  tot 
)

Definition at line 413 of file math_color.c.

References srgb_to_linearrgb_v3_v3().

void srgb_to_linearrgb_rgba_rgba_buf ( float *  col_to,
float *  col_from,
int  tot 
)
void srgb_to_linearrgb_v3_v3 ( float *  col_to,
float *  col_from 
)
void xyz_to_rgb ( float  x,
float  y,
float  z,
float *  r,
float *  g,
float *  b,
int  colorspace 
)

Definition at line 269 of file math_color.c.

References BLI_XYZ_CIE, BLI_XYZ_REC709_SRGB, and BLI_XYZ_SMPTE.

Referenced by shadeSunView().

void ycc_to_rgb ( float  y,
float  cb,
float  cr,
float *  lr,
float *  lg,
float *  lb,
int  colorspace 
)
void yuv_to_rgb ( float  y,
float  u,
float  v,
float *  lr,
float *  lg,
float *  lb 
)

Definition at line 103 of file math_color.c.

References g.

Referenced by do_comb_yuva(), and do_yuva_to_rgba().