Blender V5.3
BLI_math_color_c.hh File Reference

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

Defines

Some of the logic for merging is quite involved, support disabling some parts of this.

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

Functions

Conversion to RGB
void blender::hsv_to_rgb (float h, float s, float v, float *r_r, float *r_g, float *r_b)
void blender::hsv_to_rgb_v (const float hsv[3], float r_rgb[3])
void blender::hsl_to_rgb (float h, float s, float l, float *r_r, float *r_g, float *r_b)
void blender::hsl_to_rgb_v (const float hsl[3], float r_rgb[3])
void blender::hex_to_rgb (const char *hexcol, float *r_r, float *r_g, float *r_b)
void blender::yuv_to_rgb (float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace)
void blender::ycc_to_rgb (float y, float cb, float cr, float *r_r, float *r_g, float *r_b, int colorspace)
void blender::cpack_to_rgb (unsigned int col, float *r_r, float *r_g, float *r_b)
Conversion to RGBA
bool blender::hex_to_rgba (const char *hexcol, float *r_r, float *r_g, float *r_b, float *r_a)
Conversion from RGB
void blender::rgb_to_yuv (float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace)
void blender::rgb_to_ycc (float r, float g, float b, float *r_y, float *r_cb, float *r_cr, int colorspace)
void blender::rgb_to_hsv (float r, float g, float b, float *r_h, float *r_s, float *r_v)
void blender::rgb_to_hsv_v (const float rgb[3], float r_hsv[3])
void blender::rgb_to_hsl (float r, float g, float b, float *r_h, float *r_s, float *r_l)
void blender::rgb_to_hsl_v (const float rgb[3], float r_hsl[3])
void blender::rgb_to_hsl_compat (float r, float g, float b, float *r_h, float *r_s, float *r_l)
void blender::rgb_to_hsl_compat_v (const float rgb[3], float r_hsl[3])
void blender::rgb_to_hsv_compat (float r, float g, float b, float *r_h, float *r_s, float *r_v)
void blender::rgb_to_hsv_compat_v (const float rgb[3], float r_hsv[3])
unsigned int blender::rgb_to_cpack (float r, float g, float b)
unsigned int blender::hsv_to_cpack (float h, float s, float v)
Profile Transformations
float blender::srgb_to_linearrgb (float c)
float blender::linearrgb_to_srgb (float c)
void blender::srgb_to_linearrgb_v3_v3 (float linear[3], const float srgb[3])
void blender::linearrgb_to_srgb_v3_v3 (float srgb[3], const float linear[3])
MINLINE void blender::srgb_to_linearrgb_v4 (float linear[4], const float srgb[4])
MINLINE void blender::linearrgb_to_srgb_v4 (float srgb[4], const float linear[4])
MINLINE void blender::srgb_to_linearrgb_predivide_v4 (float linear[4], const float srgb[4])
MINLINE void blender::linearrgb_to_srgb_predivide_v4 (float srgb[4], const float linear[4])
MINLINE void blender::srgb_to_linearrgb_uchar4 (float linear[4], const unsigned char srgb[4])
MINLINE void blender::srgb_to_linearrgb_uchar4_predivide (float linear[4], const unsigned char srgb[4])
MINLINE void blender::linearrgb_to_srgb_uchar3 (unsigned char srgb[3], const float linear[3])
MINLINE void blender::linearrgb_to_srgb_uchar4 (unsigned char srgb[4], const float linear[4])
void blender::linearrgb_to_srgb_uchar4_n (unsigned char(*srgb)[4], const float(*linear)[4], int size, const float(*matrix)[3]=nullptr)
void blender::BLI_init_srgb_conversion ()
Alpha Transformations
MINLINE void blender::premul_to_straight_v4_v4 (float straight[4], const float premul[4])
MINLINE void blender::premul_to_straight_v4 (float color[4])
MINLINE void blender::straight_to_premul_v4_v4 (float premul[4], const float straight[4])
MINLINE void blender::straight_to_premul_v4 (float color[4])
MINLINE void blender::straight_uchar_to_premul_float (float result[4], const unsigned char color[4])
MINLINE void blender::premul_float_to_straight_uchar (unsigned char *result, const float color[4])

Other

#define rgba_char_args_set_fl(col, r, g, b, a)
#define rgba_float_args_set_ch(col, r, g, b, a)
void blender::hsv_clamp_v (float hsv[3], float v_max)
void blender::rgb_float_set_hue_float_offset (float rgb[3], float hue_offset)
void blender::rgb_byte_set_hue_float_offset (unsigned char rgb[3], float hue_offset)
MINLINE void blender::rgb_uchar_to_float (float r_col[3], const unsigned char col_ub[3])
MINLINE void blender::rgba_uchar_to_float (float r_col[4], const unsigned char col_ub[4])
MINLINE void blender::rgb_float_to_uchar (unsigned char r_col[3], const float col_f[3])
MINLINE void blender::rgba_float_to_uchar (unsigned char r_col[4], const float col_f[4])
MINLINE float blender::srgb_to_grayscale (const float rgb[3])
MINLINE unsigned char blender::srgb_to_grayscale_byte (const unsigned char rgb[3])
MINLINE int blender::compare_rgb_uchar (const unsigned char col_a[3], const unsigned char col_b[3], int limit)
MINLINE float blender::dither_random_value (int x, int y)
MINLINE void blender::float_to_byte_dither_v3 (unsigned char b[3], const float f[3], float dither, int x, int y)
MINLINE void blender::rgba_uchar_args_set (unsigned char col[4], unsigned char r, unsigned char g, unsigned char b, unsigned char a)
MINLINE void blender::rgba_float_args_set (float col[4], float r, float g, float b, float a)
MINLINE void blender::rgba_uchar_args_test_set (unsigned char col[4], unsigned char r, unsigned char g, unsigned char b, unsigned char a)
MINLINE void blender::cpack_cpy_3ub (unsigned char r_col[3], unsigned int pack)

Macro Definition Documentation

◆ BLI_YCC_ITU_BT601

◆ BLI_YCC_ITU_BT709

◆ BLI_YCC_JFIF_0_255

◆ BLI_YUV_ITU_BT601

#define BLI_YUV_ITU_BT601   0

Definition at line 25 of file BLI_math_color_c.hh.

Referenced by blender::rgb_to_yuv(), and blender::yuv_to_rgb().

◆ BLI_YUV_ITU_BT709

◆ rgba_char_args_set_fl

#define rgba_char_args_set_fl ( col,
r,
g,
b,
a )
Value:
rgba_char_args_set(col, (r) * 255, (g) * 255, (b) * 255, (a) * 255)

Definition at line 174 of file BLI_math_color_c.hh.

◆ rgba_float_args_set_ch

#define rgba_float_args_set_ch ( col,
r,
g,
b,
a )
Value:
rgba_float_args_set(col, (r) / 255.0f, (g) / 255.0f, (b) / 255.0f, (a) / 255.0f)

Definition at line 177 of file BLI_math_color_c.hh.

Referenced by blender::ui::widgetbase_set_uniform_colors_ubv().